X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=7fe659f945ff65c057a3ef2a16d9f19d37c0e22d;hp=80a61f813654482616e37c12c9a7167f7b4c0db8;hb=5f563d5ac7e6e1e93cca382baa42ee106f3db5a0;hpb=3e377fd17154c616c7f2746bd4babae2e9993ee3 diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 80a61f813..7fe659f94 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -92,7 +92,7 @@ { type => 'columnstart' }, { field => 'pkg', - type => 'text', + type => 'input-locale-text', size => 40, #32 maxlength => 50, }, @@ -495,42 +495,6 @@ my $recur_show_zero_disabled = 1; my $pkgpart = ''; -my $splice_locale_fields = sub { - my( $fields, $pkey_value_callback, $pkg_value_callback ) = @_; - - my $n = 0; - my @locale_fields = ( - map { - my $pkey_value= $pkey_value_callback ? &$pkey_value_callback($_) : ''; - my $pkg_value = $pkg_value_callback - ? $pkg_value_callback eq 'cgiparam' - ? $cgi->param('pkgpartmsgnum'. $n. '_pkg') - : &$pkg_value_callback($_) - : ''; - ( - { field => 'pkgpartmsgnum'. $n, - type => 'hidden', - value => $pkey_value, - }, - { field => 'pkgpartmsgnum'. $n. '_locale', - type => 'hidden', - value => $_, - }, - { field => 'pkgpartmsgnum'. $n++. '_pkg', - type => 'text', - size => 40, - #maxlength => 50, - value => $pkg_value, - }, - ); - - } - @locales - ); - splice(@$fields, 7, 0, @locale_fields); #XXX 7 is arbitrary above - -}; - my $error_callback = sub { my($cgi, $object, $fields, $opt ) = @_; @@ -579,16 +543,6 @@ my $error_callback = sub { $pkgpart = $object->pkgpart; - &$splice_locale_fields( - $fields, - sub { - my $locale = shift; - my $part_pkg_msgcat = $object->part_pkg_msgcat($locale); - $part_pkg_msgcat ? $part_pkg_msgcat->pkgpartmsgnum : ''; - }, - 'cgiparam' - ); - if ( $cgi->param('error') =~ / is suggested with / ) { #yeah, detection is a shitty kludge, but we don't have exception objects $opt->{form_init} = ' Override suggestion

'; @@ -665,20 +619,6 @@ my $edit_callback = sub { $pkgpart = $object->pkgpart; - &$splice_locale_fields( - $fields, - sub { - my $locale = shift; - my $part_pkg_msgcat = $object->part_pkg_msgcat($locale); - $part_pkg_msgcat ? $part_pkg_msgcat->pkgpartmsgnum : ''; - }, - sub { - my $locale = shift; - my $part_pkg_msgcat = $object->part_pkg_msgcat($locale); - $part_pkg_msgcat ? $part_pkg_msgcat->pkg : ''; - } - ); - }; my $new_callback = sub { @@ -692,8 +632,6 @@ my $new_callback = sub { $options{'suspend_bill'}=1 if $conf->exists('part_pkg-default_suspend_bill'); - &$splice_locale_fields($fields, '', ''); - }; my $clone_callback = sub { @@ -732,17 +670,6 @@ my $clone_callback = sub { foreach keys %part_pkg_currency; } - $recur_disabled = $object->freq ? 0 : 1; - - &$splice_locale_fields( - $fields, - '', - sub { - my $locale = shift; - my $part_pkg_msgcat = $object->part_pkg_msgcat($locale); - $part_pkg_msgcat ? $part_pkg_msgcat->pkg : ''; - } - ); }; my $discount_error_callback = sub { @@ -1061,6 +988,16 @@ my $html_bottom = sub { : '' ). '>'; + } elsif ( $href->{$field}{'type'} =~ /^select-rt-/ ) { + + $html .= include('/elements/'.$href->{$field}{'type'}.'.html', + 'name' => $layer.'__'.$field, + 'curr_value' => $options{$field}, + map { $_ => $href->{$field}{$_} } + grep { $_ !~ /^(name|type|parse)$/ } + keys %{ $href->{$field} } + ); + } elsif ( $href->{$field}{'type'} eq 'select-rate' ) { $html .= include('/elements/select-rate.html',