prevent deletion of billing_profiles

Billing-Profiles MUST NOT be deleted
Fixes: sipwise-0003127
agranig/1_0_subfix
Gerhard Jungwirth 13 years ago
parent 210140f483
commit e7d92ff670

@ -19,6 +19,7 @@ sub profile_list :Chained('/') :PathPart('billing') :CaptureArgs(0) :Args(0) {
NGCP::Panel::Utils::check_redirect_chain(c => $c);
$c->stash(has_edit => 1);
$c->stash(has_delete => 0);
$c->stash(template => 'billing/list.tt');
}
@ -102,19 +103,6 @@ sub create :Chained('profile_list') :PathPart('create') :Args(0) {
$c->stash(form => $form);
}
sub delete :Chained('base') :PathPart('delete') :Args(0) {
my ($self, $c) = @_;
unless ( defined($c->stash->{'profile_result'}) ) {
$c->flash(messages => [{type => 'error', text => 'Billing profile not found!'}]);
return;
}
$c->stash->{'profile_result'}->delete;
$c->flash(messages => [{type => 'success', text => 'Billing profile successfully deleted!'}]);
$c->response->redirect($c->uri_for);
}
sub fees_list :Chained('base') :PathPart('fees') :CaptureArgs(0) {
my ($self, $c) = @_;
@ -557,10 +545,6 @@ Show a modal to edit one billing_profile.
Show a modal to add a new billing_profile.
=head2 delete
Delete a billing_profile identified by base.
=head2 fees_list
basis for the billing_fees logic. for a certain billing_profile identified

@ -10,6 +10,7 @@
helper.edit_flag = edit_flag;
helper.form_object = form;
helper.has_edit = has_edit;
helper.has_delete = has_delete;
helper.ajax_uri = c.uri_for( c.controller.action_for('ajax') );
helper.base_uri = c.uri_for( c.controller.action_for("") );

@ -32,9 +32,11 @@ $(document).ready(function() {
'<i class="icon-edit"></i> Edit' +
'</a>' +
[%- END %]
[%- IF helper.has_delete != 0 %]
'<a class="btn btn-small btn-secondary" href="[% helper.base_uri %]/' + full[0] + '/delete" data-confirm="Delete">' +
'<i class="icon-trash"></i> Delete' +
'</a>' +
[%- END %]
[%- IF helper.extra_buttons.size %]
[% FOR b IN helper.extra_buttons %]
'<a class="btn btn-small btn-tertiary" href="[% helper.base_uri %]/' + full[0] + '/' +

Loading…
Cancel
Save