'error_callback' => $error_callback,
'field_callback' => $field_callback,
+ 'onsubmit' => 'confirm_submit',
+
'labels' => {
'pkgpart' => 'Package Definition',
'pkg' => 'Package (customer-visible)',
'svc_dst_pkgpart' => 'Include services of package',
'report_option' => 'Report classes',
'fcc_ds0s' => 'Voice-grade equivalents',
+ 'fcc_voip_class' => 'Category',
},
'fields' => [
},
{ field=>'custom', type=>'hidden' },
+ { field=>'family_pkgpart', type=>'hidden' },
+ { field=>'successor', type=>'hidden' },
{ type => 'columnstart' },
{ type => 'tablebreak-tr-title',
value => 'FCC Form 477 information',
},
+ { field=>'fcc_voip_class',
+ type=>'select-voip_class',
+ },
{ field=>'fcc_ds0s', type=>'text', size=>6 },
)
: ()
}
- function aux_planchanged(what) {
+ function aux_planchanged(what) { //?
alert('called!');
var plan = what.options[what.selectedIndex].value;
}
- </SCRIPT>
END
+my $warning =
+ 'Changing the setup or recurring fee will create a new package definition. '.
+ 'Continue?';
+
+if ( $conf->exists('part_pkg-lineage') ) {
+ $javascript .= "
+ function confirm_submit(f) {
+
+ var fields = Array('setup_fee','recur_fee');
+ for(var i=0; i < fields.length; i++) {
+ if ( f[fields[i]].value != f[fields[i]].defaultValue ) {
+ return confirm('$warning');
+ }
+ }
+ return true;
+ }
+";
+}
+
+$javascript .= '</SCRIPT>';
+
tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() };
tie my %plan_labels, 'Tie::IxHash',