- $note->statuscode = add_action($this->database, $note, $_POST['actionid'], $_POST['remark']);
+ if (!empty($_POST['act_on_all']))
+ {
+ // Perform the action on all notifications with the same object and issue.
+ $res = pg_exec($this->database, "SELECT notificationid, timestamp, type_of_issueid, statuscode
+ FROM notification WHERE objectid= CAST ('"
+ . $note->objectid ."' AS BIGINT) AND statuscode != 'cls'
+ AND type_of_issueid = '" . $note->type_of_issueid
+ . "' ORDER BY notificationid");
+ for ($row = 0; $row < pg_num_rows($res); $row++)
+ {
+ $similar_note = pg_fetch_object($res, $row);
+ $new_statuscode = add_action($this->database, $similar_note,
+ $_POST['actionid'], $_POST['remark']);
+ if ($similar_note->notificationid == $note->notificationid)
+ {
+ $note->statuscode = $new_statuscode;
+ }
+ }
+ }
+ else
+ {
+ $note->statuscode = add_action($this->database, $note, $_POST['actionid'], $_POST['remark']);
+ }