MT#12643 Prepare forms for multi-bilprof. WIP.

Breaks javascript if datatables field is within a repeatable.

Change-Id: I1378e2ad78d33b5c4dd99cd8faa50838f8d1ad74
changes/95/1995/2
Andreas Granig 11 years ago
parent 813e4712a3
commit 9004510a56

@ -4,7 +4,7 @@ extends 'HTML::FormHandler::Field::Compound';
has_field 'id' => (
type => '+NGCP::Panel::Field::DataTable',
label => 'Billing Profile',
label => 'Profile',
do_label => 0,
do_wrapper => 0,
required => 1,

@ -6,6 +6,8 @@ use Moose::Util::TypeConstraints;
use HTML::FormHandler::Widget::Block::Bootstrap;
with 'NGCP::Panel::Render::RepeatableJs';
has '+widget_wrapper' => ( default => 'Bootstrap' );
has_field 'submitid' => ( type => 'Hidden' );
sub build_render_list {[qw/submitid fields actions/]}
@ -22,6 +24,27 @@ has_field 'contact' => (
);
has_field 'billing_profile' => (
type => 'Repeatable',
label => 'Billing Profile',
setup_for_js => 1,
do_wrapper => 1,
do_label => 1,
required => 1,
tags => {
controls_div => 1,
},
wrapper_class => [qw/hfh-rep-block/],
element_attr => {
rel => ['tooltip'],
title => ['The billing profile id used to charge this contract.']
},
);
has_field 'billing_profile.id' => (
type => 'Hidden',
);
has_field 'billing_profile.profile' => (
type => '+NGCP::Panel::Field::BillingProfile',
validate_when_empty => 1,
element_attr => {
@ -30,6 +53,38 @@ has_field 'billing_profile' => (
},
);
has_field 'billing_profile.start' => (
type => 'Date',
element_attr => {
rel => ['tooltip'],
title => ['The date when the billing profile gets active.']
},
);
has_field 'billing_profile.end' => (
type => 'Date',
element_attr => {
rel => ['tooltip'],
title => ['The date when the billing profile is no longer used.']
},
);
has_field 'billing_profile.rm' => (
type => 'RmElement',
value => 'Remove Profile',
order => 100,
element_class => [qw/btn btn-primary pull-right/],
);
has_field 'profile_add' => (
type => 'AddElement',
repeatable => 'billing_profile',
value => 'Add Profile',
element_class => [qw/btn btn-primary pull-right/],
);
has_field 'status' => (
type => 'Select',
required => 1,
@ -132,7 +187,7 @@ has_field 'save' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/contact billing_profile status external_id subscriber_email_template passreset_email_template invoice_email_template invoice_template vat_rate add_vat/],
render_list => [qw/contact billing_profile profile_add status external_id subscriber_email_template passreset_email_template invoice_email_template invoice_template vat_rate add_vat/],
);
has_block 'actions' => (

@ -18,7 +18,7 @@ has_field 'contact.id' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/contact billing_profile status external_id/],
render_list => [qw/contact billing_profile profile_add status external_id/],
);
1;

@ -22,7 +22,7 @@ has_field 'max_subscribers' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/contact billing_profile product max_subscribers status external_id invoice_template subscriber_email_template passreset_email_template invoice_email_template vat_rate add_vat/],
render_list => [qw/contact billing_profile profile_add product max_subscribers status external_id invoice_template subscriber_email_template passreset_email_template invoice_email_template vat_rate add_vat/],
);
1;

@ -22,7 +22,7 @@ has_field 'max_subscribers' => (
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/contact billing_profile product max_subscribers status external_id subscriber_email_template passreset_email_template invoice_email_template invoice_template vat_rate add_vat/],
render_list => [qw/contact billing_profile profile_add product max_subscribers status external_id subscriber_email_template passreset_email_template invoice_email_template invoice_template vat_rate add_vat/],
);
1;

Loading…
Cancel
Save