aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--h-source/Application/Controllers/BaseController.php2
-rw-r--r--h-source/Application/Controllers/SpecialController.php1
-rw-r--r--h-source/Application/Models/HardwareModel.php7
-rw-r--r--h-source/Application/Models/HistoryModel.php1
4 files changed, 9 insertions, 2 deletions
diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php
index f40d45f..c636f8d 100644
--- a/h-source/Application/Controllers/BaseController.php
+++ b/h-source/Application/Controllers/BaseController.php
@@ -138,7 +138,7 @@ class BaseController extends Controller
->clear()->select()
->inner('hardware')
->on('hardware.id_hard=history.id')
- ->where(array('type'=>'hardware','gr'=>'registered','deleted'=>'no'))
+ ->where(array('type'=>'hardware','gr'=>'registered','deleted'=>'no','cleared'=>'no',))
->orderBy('id_history desc')
->limit(5)
->send();
diff --git a/h-source/Application/Controllers/SpecialController.php b/h-source/Application/Controllers/SpecialController.php
index db3975b..3776a18 100644
--- a/h-source/Application/Controllers/SpecialController.php
+++ b/h-source/Application/Controllers/SpecialController.php
@@ -105,6 +105,7 @@ class SpecialController extends BaseController
'gr' => 'registered',
'type' => 'hardware',
'deleted' => 'no',
+ 'cleared' => 'no',
);
$this->helper('Pages','special/'.$this->action.'/'.$this->lang,'page');
diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php
index 1c552c0..7d5060c 100644
--- a/h-source/Application/Models/HardwareModel.php
+++ b/h-source/Application/Models/HardwareModel.php
@@ -74,11 +74,16 @@ class HardwareModel extends Model_Map {
public function permanentlyDelete($id)
{
+ $clean['id'] = (int)$id;
+
+ $record = $this->selectId($clean['id']);
+
$this->values['deleted'] = 'no';
$this->values['approved'] = 'yes';
$this->values['pci_id'] = '';
+ $this->values['model'] = '[permanently deleted] '.$record['model'];
- return parent::update($id);
+ return parent::update($clean['id']);
}
public function pUpdate($id)
diff --git a/h-source/Application/Models/HistoryModel.php b/h-source/Application/Models/HistoryModel.php
index 4e345ed..cf63dbe 100644
--- a/h-source/Application/Models/HistoryModel.php
+++ b/h-source/Application/Models/HistoryModel.php
@@ -29,6 +29,7 @@ class HistoryModel extends Model_Tree {
$this->_where=array(
'approved' => 'hardware',
'deleted' => 'hardware',
+ 'cleared' => 'hardware',
);
$this->orderBy = 'history.id_history';