+ function notification_list($objectid)
+ {
+
+ // Display a list of all notifications for this object['oid']
+
+ $res = pg_exec($this->database, "SELECT objectname FROM object WHERE objectid=" . $objectid);
+ $obj = pg_fetch_object($res, 0);
+ echo "<h1>Notifications for " . $obj->objectname . "</h1><hr>";
+
+ $res = pg_exec($this->database, "SELECT notificationid, timestamp, type_of_issueid,
+ statuscode, priority
+ FROM notification WHERE objectid= CAST ('"
+ . $objectid ."' AS BIGINT) AND statuscode != 'cls'"
+ . " ORDER BY notificationid");
+
+ echo "<table>";
+ $row = 0;
+ while ($row < pg_numrows($res))
+ {
+ $note = pg_fetch_object($res, $row);
+ $r = pg_exec($this->database, "SELECT name from type_of_issue WHERE type_of_issueid = CAST('"
+ . $note->type_of_issueid . "' AS BIGINT)");
+ $issue = pg_fetch_object($r, 0);
+ echo "<tr><td align='center'>\n";
+ echo $note->timestamp;
+ echo "</td><td>";
+ echo $note->notificationid;
+ echo "</td><td>";
+ echo "<a href='notification.php?notid=";
+ echo $note->notificationid;
+ echo "'>";
+ echo $issue->name;
+ echo "</a>";
+ echo "</td><td>";
+ echo $note->statuscode;
+ echo "</td><td>";
+ echo $note->priority;
+ echo "</td></tr>\n";
+ $row++;
+
+ //Save evidence that this notification was presented to the user.
+ //$note->statuscode = add_action($this->database, $note, 21,
+ // "This notification was displayed with others from the same object");
+ }
+ echo "</table>";
+ }
+