From 086b034d3ba202e81e656ce99bb8933089263edf Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 13 Oct 2011 07:50:44 +0000 Subject: improved history --- h-source/Application/Controllers/IssuesController.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'h-source/Application/Controllers/IssuesController.php') diff --git a/h-source/Application/Controllers/IssuesController.php b/h-source/Application/Controllers/IssuesController.php index e69c598..d34e0f8 100644 --- a/h-source/Application/Controllers/IssuesController.php +++ b/h-source/Application/Controllers/IssuesController.php @@ -64,11 +64,14 @@ class IssuesController extends BaseController //set the page to 1 in the viewStatus $this->viewArgs['page'] = 1; $this->buildStatus(); + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; - $this->m['IssuesModel']->values['created_by'] = (int)$this->s['registered']->status['id_user']; + $this->m['IssuesModel']->values['created_by'] = $clean['id_user']; $this->m['IssuesModel']->values['status'] = 'opened'; $this->m['IssuesModel']->values['update_date'] = date('Y-m-d H:i:s'); $this->m['IssuesModel']->updateTable('insert'); + } } @@ -131,15 +134,18 @@ class IssuesController extends BaseController if (!$this->s['registered']->checkCsrf($this->viewArgs['token'])) $this->redirect('home/index/'.$this->lang,2,'wrong token..'); if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..'); + + $clean['id_user'] = (int)$this->s['registered']->status['id_user']; - $this->m['MessagesModel']->values['created_by'] = (int)$this->s['registered']->status['id_user']; + $this->m['MessagesModel']->values['created_by'] = $clean['id_user']; $this->m['MessagesModel']->values['id_issue'] = $clean['id_issue']; $this->m['MessagesModel']->updateTable('insert'); - + if ($this->m['MessagesModel']->queryResult) { $this->m['IssuesModel']->values = array('update_date' => date('Y-m-d H:i:s')); $this->m['IssuesModel']->update($clean['id_issue']); + header('Refresh: 0;url=http://'.DOMAIN_NAME.$_SERVER['REQUEST_URI']); exit; } -- cgit v1.2.3