- next if( $action eq 'ignore' );
- if( $action eq 'keep' ) {
- markAllChecked( $tables, $i, \%deleted, $authid );
- } elsif( $action eq 'delete' ) {
- eval {
- $tables->deleteItem( $loc );
- tulog( $authid, "Item deleted (recursive) $loc" );
- } #Ignore if it was already deleted by superitem
- } elsif( my( $setId ) = ( $action =~ /set-(.*)/ ) ) {
- next if( $deleted{$setId} );
- $tables->setMainHistory( $loc, $setId );
- notify( $tables, $loc, $setId, 2, 2 );
- tulog( $authid, "Item main history changed $loc $setId" );
- markAllChecked( $tables, $i, \%deleted, $authid );
+ if( defined $select && select ne '' ) {
+ $tables->setMainHistory( $addr->get(), $select );
+ tulog( $authid, "Item main history changed ".$addr->get()." $select" );
+ $action = 1;
+ notify( $tables, $addr->get(), $select, 2, 2 );
+ }
+ if( $action && $defaultSeen ) {#Approve anything in this item
+ my $subcnt = getFormValue( "loc-$i-subcnt", 0 );
+ for( my $j = 1; $j <= $subcnt; $j ++ ) {
+ my( $id ) = getFormValue( "his-$i-$j", '' ) =~ /^(\d+)$/;
+ next unless defined $id;
+ next if $approved{$id} || $deleted{$id};
+ $tables->markChecked( $id );
+ tulog( $authid, "Discussion checked $id" );
+ }