combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / checkboxes-table.html
index b6b04d1..671cd1f 100644 (file)
@@ -46,7 +46,7 @@
 %
 %  my $hashref = $opt{'hashref'} || {};
 %
-%  my $extra_sql = '';
+%  my $extra_sql = $opt{'extra_sql'} || '';
 %
 %  if ( $opt{'agent_virt'} ) {
 %    $extra_sql .= ' AND' . $FS::CurrentUser::CurrentUser->agentnums_sql(
 %                    ? 'CHECKED'
 %                    : '';
 %
+%     } elsif ( !$sourcenum ) { # newly created object, has no links yet
+%
+%       $checked = $opt{'default'} ? 'CHECKED' : ''
+%
 %     } else {
 %
 %       $checked = qsearchs( $opt{'link_table'}, {