diff --git a/lib/NGCP/Panel/Controller/Contract.pm b/lib/NGCP/Panel/Controller/Contract.pm index c5d1f7b079..77b74dfe0f 100644 --- a/lib/NGCP/Panel/Controller/Contract.pm +++ b/lib/NGCP/Panel/Controller/Contract.pm @@ -515,7 +515,7 @@ sub reseller_create :Chained('reseller_list') :PathPart('create') :Args(0) { form => $form, fields => {'contact.create' => $c->uri_for('/contact/create/noreseller'), 'billing_profile.create' => $c->uri_for('/billing/create/noreseller'), - 'billing_profile.create' => $c->uri_for('/billing/create/noreseller'), + 'billing_profiles.profile.create' => $c->uri_for('/billing/create/noreseller'), }, back_uri => $c->req->uri, ); diff --git a/lib/NGCP/Panel/Field/BillingNetwork.pm b/lib/NGCP/Panel/Field/BillingNetwork.pm index e1a854c9f9..30daad3a28 100644 --- a/lib/NGCP/Panel/Field/BillingNetwork.pm +++ b/lib/NGCP/Panel/Field/BillingNetwork.pm @@ -19,7 +19,6 @@ has_field 'create' => ( do_label => 0, value => 'Create Billing Network', element_class => [qw/btn btn-tertiary pull-right/], - element_attr => { onclick => 'this.form.submit();return false;' }, #without this, only the first create button works ); no Moose; diff --git a/lib/NGCP/Panel/Field/BillingProfile.pm b/lib/NGCP/Panel/Field/BillingProfile.pm index f82966ad2b..4f04648d75 100644 --- a/lib/NGCP/Panel/Field/BillingProfile.pm +++ b/lib/NGCP/Panel/Field/BillingProfile.pm @@ -19,7 +19,6 @@ has_field 'create' => ( do_label => 0, value => 'Create Billing Profile', element_class => [qw/btn btn-tertiary pull-right/], - element_attr => { onclick => 'this.form.submit();return false;' }, #without this, only the first create button works ); no Moose; diff --git a/lib/NGCP/Panel/Field/ProfilePackage.pm b/lib/NGCP/Panel/Field/ProfilePackage.pm index 5035716df3..ce9ae0f746 100644 --- a/lib/NGCP/Panel/Field/ProfilePackage.pm +++ b/lib/NGCP/Panel/Field/ProfilePackage.pm @@ -19,7 +19,6 @@ has_field 'create' => ( do_label => 0, value => 'Create Profile Package', element_class => [qw/btn btn-tertiary pull-right/], - #element_attr => { onclick => 'this.form.submit();return false;' }, #without this, only the first create button works ); no Moose; diff --git a/share/templates/helpers/modal.tt b/share/templates/helpers/modal.tt index 6d3c591ac3..3f1b89612f 100644 --- a/share/templates/helpers/modal.tt +++ b/share/templates/helpers/modal.tt @@ -31,50 +31,18 @@ var modalFormScript = function (formitem,repeat) { $('#mod_edit').modal({keyboard: false, backdrop: 'static'}); $('.mod_close').click(function(event) { - [%IF m.close_target_direct%] - [%m.close_target_direct%] - [%ELSIF m.ajax_load%] - $('#mod_edit').modal('hide'); - $('#mod_edit').parent('div').html(''); - [%ELSE%] console.log("redirecting to [% m.close_target ? m.close_target : c.uri_for() %]"); window.location.href="[% m.close_target ? m.close_target : c.uri_for() %]"; - [%END%] }); - [%IF m.ajax_load%] - $('#mod_edit script').each(function( key, value ) { - eval(value.innerHTML); - }); - [%END%] // on clicking a button within the form, add a hidden field "submitid" // determining the name of the button being clicked - $('input[type=button]').click(function() { + $('#mod_edit form').on("click", "input[type=button]", function() { $(this).parents('form').find('#submitid').attr('value', $(this).attr('name')); - [%IF !m.ajax_load%] $(this).parents('form').submit(); - [%ELSE%] - $('#mod_edit').modal('hide'); - processModalFormAjax($(this).parents('form'),function(status,form){ - //alert('in callback: status='+status); - if( status == 'error' ){ - modalFormScript(formitem); - } - if( status != 'error' ){ - //form object is necessary to compose uri for refresh - [%IF m.ajax_list_refresh%] - refreshAjaxList( '[%m.ajax_list_refresh%]', form ); - [%END%] - $('#mod_edit').parent('div').html(''); - } - [%m.ajax_callback%] - }); - [%END%] }); }; - [%IF !m.ajax_load%]$(modalFormScript);[%ELSE%] - //$('#'+$(this).parents('form').id()+' :input:enabled:visible:first').focus(); - [%END%] + $(modalFormScript); [% END -%]