@@ -41,12 +41,10 @@ |
||
| 41 | 41 | |
| 42 | 42 | if ($statement->execute()) { |
| 43 | 43 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 44 | - } |
|
| 45 | - else { |
|
| 44 | + } else { |
|
| 46 | 45 | throw new Exception($statement->errorInfo()); |
| 47 | 46 | } |
| 48 | - } |
|
| 49 | - else { |
|
| 47 | + } else { |
|
| 50 | 48 | throw new Exception("You shouldn't be doing this..."); |
| 51 | 49 | } |
| 52 | 50 | } |
@@ -67,12 +67,10 @@ |
||
| 67 | 67 | |
| 68 | 68 | if ($statement->execute()) { |
| 69 | 69 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 70 | - } |
|
| 71 | - else { |
|
| 70 | + } else { |
|
| 72 | 71 | throw new Exception($statement->errorInfo()); |
| 73 | 72 | } |
| 74 | - } |
|
| 75 | - else { |
|
| 73 | + } else { |
|
| 76 | 74 | // update |
| 77 | 75 | $statement = $this->dbObject->prepare(<<<SQL |
| 78 | 76 | UPDATE `request` SET |
@@ -183,12 +183,10 @@ |
||
| 183 | 183 | |
| 184 | 184 | if ($statement->execute()) { |
| 185 | 185 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 186 | - } |
|
| 187 | - else { |
|
| 186 | + } else { |
|
| 188 | 187 | throw new Exception($statement->errorInfo()); |
| 189 | 188 | } |
| 190 | - } |
|
| 191 | - else { |
|
| 189 | + } else { |
|
| 192 | 190 | // update |
| 193 | 191 | $statement = $this->dbObject->prepare(<<<SQL |
| 194 | 192 | UPDATE `emailtemplate` |
@@ -109,8 +109,7 @@ |
||
| 109 | 109 | |
| 110 | 110 | if ($statement->execute()) { |
| 111 | 111 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 112 | - } |
|
| 113 | - else { |
|
| 112 | + } else { |
|
| 114 | 113 | throw new Exception($statement->errorInfo()); |
| 115 | 114 | } |
| 116 | 115 | } |
@@ -65,12 +65,10 @@ |
||
| 65 | 65 | |
| 66 | 66 | if ($statement->execute()) { |
| 67 | 67 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 68 | - } |
|
| 69 | - else { |
|
| 68 | + } else { |
|
| 70 | 69 | throw new Exception($statement->errorInfo()); |
| 71 | 70 | } |
| 72 | - } |
|
| 73 | - else { |
|
| 71 | + } else { |
|
| 74 | 72 | // update |
| 75 | 73 | $statement = $this->dbObject->prepare(<<<SQL |
| 76 | 74 | UPDATE `welcometemplate` |
@@ -49,12 +49,10 @@ |
||
| 49 | 49 | |
| 50 | 50 | if ($statement->execute()) { |
| 51 | 51 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 52 | - } |
|
| 53 | - else { |
|
| 52 | + } else { |
|
| 54 | 53 | throw new Exception($statement->errorInfo()); |
| 55 | 54 | } |
| 56 | - } |
|
| 57 | - else { |
|
| 55 | + } else { |
|
| 58 | 56 | throw new Exception("Updating logs is not available"); |
| 59 | 57 | } |
| 60 | 58 | } |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | SessionAlert::success("Comment has been saved successfully"); |
| 75 | 75 | |
| 76 | 76 | $this->redirect('viewRequest', null, array('id' => $comment->getRequest())); |
| 77 | - } |
|
| 78 | - else { |
|
| 77 | + } else { |
|
| 79 | 78 | $this->assignCSRFToken(); |
| 80 | 79 | $this->assign('comment', $comment); |
| 81 | 80 | $this->assign('request', $request); |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | $this->getNotificationHelper()->siteNoticeEdited(); |
| 41 | 41 | |
| 42 | 42 | $this->redirect(); |
| 43 | - } |
|
| 44 | - else { |
|
| 43 | + } else { |
|
| 45 | 44 | $this->assignCSRFToken(); |
| 46 | 45 | |
| 47 | 46 | $this->setTemplate('site-notice/edit-form.tpl'); |
@@ -135,8 +135,7 @@ discard block |
||
| 135 | 135 | SessionAlert::success("Template successfully created."); |
| 136 | 136 | |
| 137 | 137 | $this->redirect('welcomeTemplates'); |
| 138 | - } |
|
| 139 | - else { |
|
| 138 | + } else { |
|
| 140 | 139 | $this->assignCSRFToken(); |
| 141 | 140 | $this->setTemplate("welcome-template/add.tpl"); |
| 142 | 141 | } |
@@ -182,8 +181,7 @@ discard block |
||
| 182 | 181 | $this->getNotificationHelper()->welcomeTemplateEdited($template); |
| 183 | 182 | |
| 184 | 183 | $this->redirect('welcomeTemplates'); |
| 185 | - } |
|
| 186 | - else { |
|
| 184 | + } else { |
|
| 187 | 185 | $this->assignCSRFToken(); |
| 188 | 186 | $this->assign('template', $template); |
| 189 | 187 | $this->setTemplate('welcome-template/edit.tpl'); |