appdb/ include/note.php tables/appdb_tables.sql

WineHQ wineowner at wine.codeweavers.com
Mon Jan 1 22:44:27 CST 2007


ChangeSet ID:	30846
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/01/01 22:44:27

Modified files:
	include        : note.php 
	tables         : appdb_tables.sql 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Fix the note deletion mail so it displays the information it is supposed to.

Patch: http://cvs.winehq.org/patch.py?id=30846

Old revision  New revision  Changes     Path
 1.19          1.20          +11 -5      appdb/include/note.php
 1.26          1.27          +2 -0       appdb/tables/appdb_tables.sql

Index: appdb/include/note.php
diff -u -p appdb/include/note.php:1.19 appdb/include/note.php:1.20
--- appdb/include/note.php:1.19	2 Jan 2007  4:44:27 -0000
+++ appdb/include/note.php	2 Jan 2007  4:44:27 -0000
@@ -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'])
Index: appdb/tables/appdb_tables.sql
diff -u -p appdb/tables/appdb_tables.sql:1.26 appdb/tables/appdb_tables.sql:1.27
--- appdb/tables/appdb_tables.sql:1.26	2 Jan 2007  4:44:27 -0000
+++ appdb/tables/appdb_tables.sql	2 Jan 2007  4:44:27 -0000
@@ -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)
 );
 



More information about the wine-cvs mailing list