From: Michal Vaner Date: Mon, 1 Sep 2008 23:32:54 +0000 (+0200) Subject: Notification texts consider soft deletes X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b262bde7716597addd9f4c3f01d729018cb82fb8;p=pciids.git Notification texts consider soft deletes --- diff --git a/PciIds/Notifications.pm b/PciIds/Notifications.pm index a0e52b5..37880c5 100644 --- a/PciIds/Notifications.pm +++ b/PciIds/Notifications.pm @@ -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;