]> mj.ucw.cz Git - pciids.git/commitdiff
Notification texts consider soft deletes
authorMichal Vaner <vorner@ucw.cz>
Mon, 1 Sep 2008 23:32:54 +0000 (01:32 +0200)
committerMichal Vaner <vorner@ucw.cz>
Mon, 1 Sep 2008 23:32:54 +0000 (01:32 +0200)
PciIds/Notifications.pm

index a0e52b5008d2b23160b15bf5416790c30cb3b44a..37880c520f3422b30a6bd19ed97b91677d974aa9 100644 (file)
@@ -52,16 +52,22 @@ sub sendOut( $$ ) {
                        $note .= "    Address: http://".$config{'hostname'}."/read/".$addr->get()."\n";
                        $note .= "  Comment:\n";
                        $note .= "    Proposed name: $newname\n" if( defined $newname && ( $newname ne '' ) );
+                       $note .= "    Deletion request\n" if defined $newname && $newname eq '';
                        $note .= "    Proposed description: $newdesc\n" if( defined $newdesc && ( $newdesc ne '' ) );
                        $note .= "    Text: $text\n" if( defined $text && ( $text ne '' ) );
                        $note .= "    Author: $author\n" if( defined $author && ( $author ne '' ) );
                        $note .= "    Time: $time\n";
                } elsif( $reason == 2 ) {
-                       $note = "Item name validated.\n  Id:".$addr->pretty()."\n";
-                       $note .= "  Name: $newname\n";
-                       $note .= "  Description: $newdesc\n" if( defined $newdesc && ( $newdesc ne '' ) );
-                       $note .= "  Comment text: $text\n" if( defined $text && ( $text ne '' ) );
-                       $note .= "  Address: http://".$config{'hostname'}."/read/".$addr->get()."\n";
+                       if( $name ne '' ) {
+                               $note = "Item name validated.\n  Id:".$addr->pretty()."\n";
+                               $note .= "  Name: $newname\n";
+                               $note .= "  Description: $newdesc\n" if( defined $newdesc && ( $newdesc ne '' ) );
+                               $note .= "  Comment text: $text\n" if( defined $text && ( $text ne '' ) );
+                               $note .= "  Address: http://".$config{'hostname'}."/read/".$addr->get()."\n";
+                       } else {
+                               $note = "Item deletion validated.\n  Id:".$addr->pretty()."\n";
+                               $note .= "  Address: http://".$config{'hostname'}."/read/".$addr->get()."\n";
+                       }
                }
                $message .= "\n" unless $message eq '';
                $message .= $note;