From 077ee450b741ebad29e46ce06c80fc375c7ead36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Tue, 2 Jan 2007 04:44:27 +0000 Subject: [PATCH] Fix the note deletion mail so it displays the information it is supposed to. --- include/note.php | 16 +++++++++++----- tables/appdb_tables.sql | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/note.php b/include/note.php index 690c45a..29fdfb6 100644 --- a/include/note.php +++ b/include/note.php @@ -22,6 +22,8 @@ class Note { var $iVersionId; var $sTitle; var $sDescription; + var $iSubmitterId; + var $sSubmitTime; /** * Constructor. @@ -44,6 +46,8 @@ class Note { $this->iVersionId = $oRow->versionId; $this->sTitle = $oRow->noteTitle; $this->sDescription = $oRow->noteDesc; + $this->sSubmitTime = $oRow->submitTime; + $this->iSubmitterId = $oRow->submitterId; } } } @@ -56,9 +60,9 @@ class Note { */ function create() { - $hResult = query_parameters("INSERT INTO appNotes (versionId, noteTitle, noteDesc) ". - "VALUES('?', '?', '?')", - $this->iVersionId, $this->sTitle, $this->sDescription); + $hResult = query_parameters("INSERT INTO appNotes (versionId, noteTitle, noteDesc, submitterId) ". + "VALUES('?', '?', '?', '?')", + $this->iVersionId, $this->sTitle, $this->sDescription, $_SESSION['current']->iUserId); if($hResult) { @@ -152,12 +156,14 @@ class Note { addmsg("Note modified.", "green"); break; case "delete": + $oSubmitter = new User($this->iSubmitterId); $sSubject = "Note ".$this->sTitle." for ".$sAppName." has been deleted by ".$_SESSION['current']->sRealname; - $sMsg .= "This note was made on ".substr($this->sDateCreated,0,10)." by ".$this->oOwner->sRealname."\n"; + $sMsg .= "This note was made on ".print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime))." by ".$oSubmitter->sRealname."\n"; $sMsg .= "\n"; $sMsg .= "Subject: ".$this->sTitle."\n"; $sMsg .= "\n"; - $sMsg .= $this->sBody."\n"; + $sMsg .= "Note contents:\n"; + $sMsg .= $this->sDescription."\n"; $sMsg .= "\n"; $sMsg .= "Because:\n"; if($aClean['sReplyText']) diff --git a/tables/appdb_tables.sql b/tables/appdb_tables.sql index b514dc8..fbbeed2 100644 --- a/tables/appdb_tables.sql +++ b/tables/appdb_tables.sql @@ -168,6 +168,8 @@ create table appNotes ( noteTitle varchar(255), noteDesc text, versionId int not null, + submitterId int not null, + submitTime timestamp not null, key(noteId) );