-
sections.html
387 388 306 306 if ( exists $ARGS{tree} && $ARGS{tree} && $ARGS{tree} != $owner->id ) { 307 307 my %updated; 308 308 while ( my ($field, $value) = each %ARGS ) { 309 if ( $field =~ /^update_(\d+)_(\w+)$/ ) { 309 if ( $field =~ /^delete_(\d+)_(\w+)$/ ) { 310 310 my $oid = $1; 311 311 my $attr = $2; 312 312 $updated{$oid}{$attr} = $value; 313 313 } 314 314 } 315 warn Dumper \%updated; 315 316 my %classes = map { $_->{class} => 1 } values %updated; 316 317 my $parent_new = $keeper->get_section_by_id( $ARGS{tree} ); 317 318 my $document_access = $user->section_accesses($user, $parent_new->id); … … 319 320 foreach my $update_class ( keys %classes ) { 320 321 my @ids; 321 322 while ( my ($oid, $attr) = each %updated) { 322 push @ids, $oid if $attr->{class} eq $update_class; 323 push @ids, $oid if exists $attr->{id} && $attr->{id} && ($attr->{class} eq $update_class); 323 324 } 324 325 my @objects = $keeper->get_documents ( 325 326 id => \@ids,