projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d129793
)
agent setting during package edit cleanup
author
jeff
<jeff>
Thu, 6 Dec 2007 20:49:52 +0000
(20:49 +0000)
committer
jeff
<jeff>
Thu, 6 Dec 2007 20:49:52 +0000
(20:49 +0000)
httemplate/edit/part_pkg.cgi
patch
|
blob
|
history
diff --git
a/httemplate/edit/part_pkg.cgi
b/httemplate/edit/part_pkg.cgi
index
7647233
..
559ade1
100755
(executable)
--- a/
httemplate/edit/part_pkg.cgi
+++ b/
httemplate/edit/part_pkg.cgi
@@
-66,7
+66,6
@@
Tax information
</TD>
</TR>
</TD>
</TR>
-% my $conf = new FS::Conf;
% if ( $conf->exists('enable_taxclasses') ) {
<TR>
% if ( $conf->exists('enable_taxclasses') ) {
<TR>
@@
-103,10
+102,14
@@
Line-item revenue recognition
</TD><TD VALIGN="top">
</TD><TD VALIGN="top">
-% if ( $cgi->param('clone')
|| $conf->exists('agent_defaultpkg')
) {
+% if ( $cgi->param('clone') ) {
<INPUT TYPE="hidden" NAME="agent_type" VALUE="">
<INPUT TYPE="hidden" NAME="agent_type" VALUE="">
+% } elsif ( scalar(@all_agent_types) == 1) {
+
+ <INPUT TYPE="hidden" NAME="agent_type" VALUE="<% $all_agent_types[0] %>">
+
% } else {
Reseller information
% } else {
Reseller information
@@
-366,8
+369,10
@@
if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
my ($query) = $cgi->keywords;
my ($query) = $cgi->keywords;
+my $conf = new FS::Conf;
my $part_pkg = '';
my @agent_type = ();
my $part_pkg = '';
my @agent_type = ();
+my @all_agent_types = map {$_->typenum} qsearch('agent_type',{});
if ( $cgi->param('error') ) {
$part_pkg = new FS::part_pkg ( {
map { $_, scalar($cgi->param($_)) } fields('part_pkg')
if ( $cgi->param('error') ) {
$part_pkg = new FS::part_pkg ( {
map { $_, scalar($cgi->param($_)) } fields('part_pkg')
@@
-394,6
+399,8
@@
if ( $cgi->param('clone') ) {
unless ( $part_pkg ) {
$part_pkg = new FS::part_pkg {};
$part_pkg->plan('flat');
unless ( $part_pkg ) {
$part_pkg = new FS::part_pkg {};
$part_pkg->plan('flat');
+ @agent_type = @all_agent_types if $conf->exists('agent_defaultpkg');
+
}
}
unless ( $part_pkg->plan ) { #backwards-compat
}
}
unless ( $part_pkg->plan ) { #backwards-compat