diff options
Diffstat (limited to 'h-source/Application/Models')
-rw-r--r-- | h-source/Application/Models/HardwareModel.php | 15 | ||||
-rwxr-xr-x | h-source/Application/Models/UsersModel.php | 5 |
2 files changed, 15 insertions, 5 deletions
diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php index a3745cf..3badd71 100644 --- a/h-source/Application/Models/HardwareModel.php +++ b/h-source/Application/Models/HardwareModel.php @@ -82,13 +82,19 @@ class HardwareModel extends Model_Map { $this->values['created_by'] = (int)$this->id_user; $this->values['updated_by'] = (int)$this->id_user; $this->values['update_date'] = date('Y-m-d H:i:s'); + + if ($this->values['created_by'] === 0) + { + $this->values['deleted'] = 'yes'; + $this->values['approved'] = 'no'; + } //random ID $randomId = md5(uniqid(mt_rand(),true)); $this->values["type"] = $randomId; parent::insert(); - +// echo $this->getQuery(); //associate the user to the record if ($this->queryResult) { @@ -99,8 +105,11 @@ class HardwareModel extends Model_Map { //update the history table $this->updateHistory('insert'); - - $this->associate($clean['id']); + + if ($this->values['created_by'] !== 0) + { + $this->associate($clean['id']); + } } } diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php index d4ef745..0d84bb4 100755 --- a/h-source/Application/Models/UsersModel.php +++ b/h-source/Application/Models/UsersModel.php @@ -88,7 +88,7 @@ class UsersModel extends Model_Map } else { - return "__"; + return "<i>__anonymous__</i>"; } } } @@ -97,7 +97,8 @@ class UsersModel extends Model_Map { if (strstr($user,'__')) { - return str_replace('__',null,$user); + return $user; +// return str_replace('__',null,$user); } else { |