@@ -41,8 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | if ($showAll) { |
| 43 | 43 | $statement = $database->prepare('SELECT * FROM comment WHERE request = :target;'); |
| 44 | - } |
|
| 45 | - else { |
|
| 44 | + } else { |
|
| 46 | 45 | $statement = $database->prepare(<<<SQL |
| 47 | 46 | SELECT * FROM comment |
| 48 | 47 | WHERE request = :target AND (visibility = 'user' OR visibility = 'requester' OR user = :userid); |
@@ -84,12 +83,10 @@ discard block |
||
| 84 | 83 | |
| 85 | 84 | if ($statement->execute()) { |
| 86 | 85 | $this->id = (int)$this->dbObject->lastInsertId(); |
| 87 | - } |
|
| 88 | - else { |
|
| 86 | + } else { |
|
| 89 | 87 | throw new Exception($statement->errorInfo()); |
| 90 | 88 | } |
| 91 | - } |
|
| 92 | - else { |
|
| 89 | + } else { |
|
| 93 | 90 | // update |
| 94 | 91 | $statement = $this->dbObject->prepare(<<<SQL |
| 95 | 92 | UPDATE comment |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $this->validateCSRFToken(); |
| 58 | 58 | $newComment = WebRequest::postString('newcomment'); |
| 59 | 59 | |
| 60 | - if($comment ->getVisibility() !== 'requester') { |
|
| 60 | + if ($comment ->getVisibility() !== 'requester') { |
|
| 61 | 61 | $visibility = WebRequest::postString('visibility'); |
| 62 | 62 | |
| 63 | 63 | if ($visibility !== 'user' && $visibility !== 'admin') { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $requestLogs[] = array( |
| 178 | 178 | 'type' => 'comment', |
| 179 | 179 | 'security' => $entry->getVisibility(), |
| 180 | - 'user' => $entry->getVisibility() == 'requester' ? $request->getName() :$nameCache[$entry->getUser()]->getUsername(), |
|
| 180 | + 'user' => $entry->getVisibility() == 'requester' ? $request->getName() : $nameCache[$entry->getUser()]->getUsername(), |
|
| 181 | 181 | 'userid' => $entry->getUser() == -1 ? null : $entry->getUser(), |
| 182 | 182 | 'entry' => null, |
| 183 | 183 | 'time' => $entry->getTime(), |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $entryComment = $entry->getComment(); |
| 195 | 195 | |
| 196 | - if($entry->getAction() === 'JobIssueRequest' || $entry->getAction() === 'JobCompletedRequest'){ |
|
| 196 | + if ($entry->getAction() === 'JobIssueRequest' || $entry->getAction() === 'JobCompletedRequest') { |
|
| 197 | 197 | $data = unserialize($entry->getComment()); |
| 198 | 198 | /** @var JobQueue $job */ |
| 199 | 199 | $job = JobQueue::getById($data['job'], $database); |
@@ -59,12 +59,10 @@ |
||
| 59 | 59 | // actually save the request to the database |
| 60 | 60 | if ($this->getSiteConfiguration()->getEmailConfirmationEnabled()) { |
| 61 | 61 | $this->saveAsEmailConfirmation($request, $comment); |
| 62 | - } |
|
| 63 | - else { |
|
| 62 | + } else { |
|
| 64 | 63 | $this->saveWithoutEmailConfirmation($request, $comment); |
| 65 | 64 | } |
| 66 | - } |
|
| 67 | - else { |
|
| 65 | + } else { |
|
| 68 | 66 | // set the form values from the session context |
| 69 | 67 | $context = WebRequest::getSessionContext('accountReq'); |
| 70 | 68 | if ($context !== null && is_array($context)) { |