</TD><TD VALIGN="top">
-%if ( $cgi->param('clone') ) {
+%if ( $cgi->param('clone') || $conf->exists('agent_defaultpkg') ) {
<INPUT TYPE="hidden" NAME="agent_type" VALUE="">
%}else{
Reseller information
'table' => 'agent_type',
'name_col' => 'atype',
'value' => \@agent_type,
- 'empty_label' => '(none)',
+ 'empty_label' => 'select agent types',
'element_etc' => 'multiple size="10"',
)
%>
%
%
%my $dbh = dbh;
+%my $conf = new FS::Conf;
%
%my $pkgpart = $cgi->param('pkgpart');
%
% } fields('part_pkg')
%} );
%
+%my $oldAutoCommit = $FS::UID::AutoCommit;
+%local $FS::UID::AutoCommit = 0;
+%
%my %pkg_svc = map { $_ => scalar($cgi->param("pkg_svc$_")) }
% map { $_->svcpart }
% qsearch('part_svc', {} );
% $pkgpart = $new->pkgpart;
%}
%
-%unless ($error) {
+%unless ( $error || $conf->exists('agent_defaultpkg') ) {
% my $error = $new->process_m2m(
% 'link_table' => 'type_pkgs',
% 'target_table' => 'agent_type',
% );
%}
%if ( $error ) {
+% $dbh->rollback if $oldAutoCommit;
% $cgi->param('error', $error );
% print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
%} elsif ( $custnum ) {
+% $dbh->commit or die $dbh->errstr if $oldAutoCommit;
% print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
%} else {
+% $dbh->commit or die $dbh->errstr if $oldAutoCommit;
% print $cgi->redirect(popurl(3). "browse/part_pkg.cgi");
%}
%