Commit c0f39a4d authored by tbrehm's avatar tbrehm

Added option to force updates in datalogUpdate function.

parent 62b385fc
......@@ -297,10 +297,14 @@ public function toLower($record) {
}
//** Updates a record and saves the changes into the datalog
public function datalogUpdate($tablename, $update_data, $index_field, $index_value) {
public function datalogUpdate($tablename, $update_data, $index_field, $index_value, $force_update = false) {
global $app;
$old_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
if($force_update == true) {
$old_rec = array();
} else {
$old_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
}
$this->query("UPDATE $tablename SET $update_data WHERE $index_field = '$index_value'");
$new_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
$this->datalogSave($tablename, 'UPDATE', $index_field, $index_value, $old_rec, $new_rec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment