added delete function for customers


			
			
				0.9@747
			
			
		
Daniel Tiefnig 18 years ago
parent 7bf736d0c6
commit b7e62dbdc8

@ -210,6 +210,58 @@ sub update_customer : Local {
return;
}
=head2 terminate
Terminates a customer.
=cut
sub terminate : Local {
my ( $self, $c ) = @_;
my %messages;
my $customer_id = $c->request->params->{customer_id};
if($c->model('Provisioning')->call_prov( $c, 'billing', 'terminate_customer',
{ id => $customer_id },
undef))
{
$messages{topmsg} = 'Server.Voip.SubscriberDeleted';
$c->session->{messages} = \%messages;
$c->response->redirect("/customer");
return;
}
$c->response->redirect("/customer/detail?customer_id=$customer_id");
return;
}
=head2 delete
Deletes a customer.
=cut
sub delete : Local {
my ( $self, $c ) = @_;
my %messages;
my $customer_id = $c->request->params->{customer_id};
if($c->model('Provisioning')->call_prov( $c, 'billing', 'delete_customer',
{ id => $customer_id },
undef))
{
$messages{topmsg} = 'Server.Voip.SubscriberDeleted';
$c->session->{messages} = \%messages;
$c->response->redirect("/customer");
return;
}
$c->response->redirect("/customer/detail?customer_id=$customer_id");
return;
}
=head2 update_contact
Update details of a customer's contact.

@ -3,14 +3,16 @@
#[% customer.id %]</a>
</h3>
<!--
<div class="actions">
<!--
<a href="detail?customer_id=[% customer.id %]&amp;edit_customer=1" class="aaction">edit</a>
[% IF edit_customer %]
<a href="detail?customer_id=[% customer.id %]" class="aaction">cancel</a>
[% END %]
</div>
-->
<a href="delete?customer_id=[% customer.id %]" class="aaction">delete</a>
</div>
<div class="p1">
[% IF messages.custmsg %]<div class="goodmsg">[% messages.custmsg %]</div>[% END %]
[% IF messages.custerr %]<div class="errormsg">[% messages.custerr %]</div>[% END %]

Loading…
Cancel
Save