Another one before I goto sleep.. I'm working on the support module as well, trying to make it a little better.. How do I access the form data record when I'm doing a delete?
I'm trying something to this affect but its not working..
Code:
class support_delete extends tform_actions {
function onDelete() {
error_log("datarecord -> " . print_r($this->dataRecord,1));
$user_id = $_SESSION['s']['user']['userid'];
if($this->dataRecord['recipient_id'] != $user_id) {
// In this case just delete in the view table for this guy..
$sql = "INSERT INTO support_views (support_message_id, sys_userid, deleted) VALUES ( $this->id, $user_id, '1')";
$app->db->query($sql);
error_log("Executed: ".$sql);
} else {
parent::onDelete();
}
}
}
$deletion = new support_delete;
$deletion->onDelete();