Infolog - add ability to clear description history

This commit is contained in:
nathangray
2019-03-11 14:15:28 -06:00
parent 1206bc1987
commit e43c8f8f19
5 changed files with 36 additions and 1 deletions

View File

@ -85,6 +85,27 @@ class History
return $this->db->affected_rows();
}
/**
* Delete history log of a certain field
* @param string $record_id ID of the record
* @param string $status Field name / ID
*/
function delete_field($record_id, $status)
{
$where = array(
'history_appname' => $this->appname,
'history_status' => $status
);
if (is_array($record_id) || is_numeric($record_id))
{
$where['history_record_id'] = $record_id;
}
$this->db->delete(self::TABLE,$where,__LINE__,__FILE__);
return $this->db->affected_rows();
}
/**
* Add a history record, if $new_value != $old_value
*