$log->add_data(false, $bugapi->values, $bugfields);
- //$bugapi->update();
+ $bugapi->update();
// -------------------------------------------------------------------
// do diff history
$log->update_history();
- print_r($log); exit;
-
$message->redirect($lang->string('Your changes to the bug have been saved.'), "showreport.php?bugid=$bug[bugid]");
}
*/
var $bugid = 0;
+ /**
+ * Attachment ID
+ * @var integer
+ * @access private
+ */
+ var $attachmentid = 0;
+
+ /**
+ * Comment ID
+ * @var integer
+ * @access private
+ */
+ var $commentid = 0;
+
/**
* The original data to compare against
* @var array
$this->bugid = $newbugid;
}
+ // ###################################################################
+ /**
+ * Sets the attachment ID for the current logging instance
+ *
+ * @access public
+ *
+ * @param integer New attachment ID
+ */
+ function set_attachmentid($id)
+ {
+ $this->attachmentid = $id;
+ }
+
+ // ###################################################################
+ /**
+ * Sets the current comment ID to be logged
+ *
+ * @access public
+ *
+ * @param integer New comment ID
+ */
+ function set_commentid($id)
+ {
+ $this->commentid = $id;
+ }
+
// ###################################################################
/**
* Assigns data into the $this->original or $this->modified array based
*/
function update_history()
{
+ global $bugsys;
+
$this->compare_arrays();
+
+ foreach ($this->compared AS $field => $values)
+ {
+ $bugsys->db->query("
+ INSERT INTO " . TABLE_PREFIX . "history
+ (bugid, attachmentid, commentid, dateline, userid, field, original, changed)
+ VALUES
+ (" . $bugsys->clean($this->bugid, TYPE_UINT) . ", " . $bugsys->clean($this->attachmentid, TYPE_UINT) . ",
+ " . $bugsys->clean($this->commentid, TYPE_UINT) . ", " . TIMENOW . ", " . $bugsys->userinfo['userid'] . ",
+ '" . $bugsys->db->escape_string($field) . "', '" . $bugsys->db->escape_string($values['old']) . "',
+ '" . $bugsys->db->escape_string($values['new']) . "'
+ )
+ ");
+ }
}
}