@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | $this->service = $service; |
47 | 47 | } |
48 | 48 | |
49 | - /** |
|
50 | - * @NoAdminRequired |
|
51 | - * |
|
52 | - * @return Template |
|
53 | - */ |
|
49 | + /** |
|
50 | + * @NoAdminRequired |
|
51 | + * |
|
52 | + * @return Template |
|
53 | + */ |
|
54 | 54 | public function displayPanel() { |
55 | 55 | $tmpl = new Template('ocr', 'settings-personal'); |
56 | 56 | return $tmpl; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getAll() { |
65 | 65 | return $this->handleNotFound(function () { |
66 | - return $this->service->getAllForPersonal($this->userId); |
|
66 | + return $this->service->getAllForPersonal($this->userId); |
|
67 | 67 | }); |
68 | 68 | } |
69 | 69 |
@@ -91,24 +91,24 @@ |
||
91 | 91 | $this->setErrorDisplayed($errorDisplayed); |
92 | 92 | } |
93 | 93 | |
94 | - /** |
|
95 | - * Specify data which should be serialized to JSON |
|
96 | - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
|
97 | - * @return mixed data which can be serialized by <b>json_encode</b>, |
|
98 | - * which is a value of any type other than a resource. |
|
99 | - * @since 5.4.0 |
|
100 | - */ |
|
101 | - function jsonSerialize() |
|
102 | - { |
|
103 | - return [ |
|
104 | - 'id' => $this->id, |
|
105 | - 'status' => $this->status, |
|
106 | - 'fileId' => $this->fileId, |
|
107 | - 'newName' => $this->newName, |
|
108 | - 'tempFile' => $this->tempFile, |
|
109 | - 'type' => $this->type, |
|
110 | - 'userId' => $this->userId, |
|
111 | - 'errorDisplayed' => $this->errorDisplayed |
|
112 | - ]; |
|
113 | - } |
|
94 | + /** |
|
95 | + * Specify data which should be serialized to JSON |
|
96 | + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
|
97 | + * @return mixed data which can be serialized by <b>json_encode</b>, |
|
98 | + * which is a value of any type other than a resource. |
|
99 | + * @since 5.4.0 |
|
100 | + */ |
|
101 | + function jsonSerialize() |
|
102 | + { |
|
103 | + return [ |
|
104 | + 'id' => $this->id, |
|
105 | + 'status' => $this->status, |
|
106 | + 'fileId' => $this->fileId, |
|
107 | + 'newName' => $this->newName, |
|
108 | + 'tempFile' => $this->tempFile, |
|
109 | + 'type' => $this->type, |
|
110 | + 'userId' => $this->userId, |
|
111 | + 'errorDisplayed' => $this->errorDisplayed |
|
112 | + ]; |
|
113 | + } |
|
114 | 114 | } |
115 | 115 | \ No newline at end of file |
@@ -41,16 +41,16 @@ |
||
41 | 41 | return $this->findEntity($sql, [$id]); |
42 | 42 | } |
43 | 43 | |
44 | - /** |
|
45 | - * Finds all user specific status entities |
|
46 | - * |
|
47 | - * @param $userId |
|
48 | - * @return OcrStatus[] |
|
49 | - */ |
|
50 | - public function findAll($userId) { |
|
51 | - $sql = 'SELECT * FROM *PREFIX*ocr_status WHERE user_id = ?'; |
|
52 | - return $this->findEntities($sql, [$userId]); |
|
53 | - } |
|
44 | + /** |
|
45 | + * Finds all user specific status entities |
|
46 | + * |
|
47 | + * @param $userId |
|
48 | + * @return OcrStatus[] |
|
49 | + */ |
|
50 | + public function findAll($userId) { |
|
51 | + $sql = 'SELECT * FROM *PREFIX*ocr_status WHERE user_id = ?'; |
|
52 | + return $this->findEntities($sql, [$userId]); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Finds all status PROCESSED entities for a given userid |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * TODO: in the future this function could be used to give an admin information |
|
75 | + * TODO: in the future this function could be used to give an admin information |
|
76 | 76 | * Counts the messages in the message queue. |
77 | - * |
|
77 | + * |
|
78 | 78 | * @return mixed |
79 | 79 | */ |
80 | 80 | public function countMessages() { |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | - /** |
|
91 | - * TODO: in the future this function could be used to give an admin information |
|
92 | - * Counts the at this point processed files |
|
93 | - * |
|
94 | - * @return mixed |
|
95 | - */ |
|
96 | - public function countActiveProcesses() { |
|
90 | + /** |
|
91 | + * TODO: in the future this function could be used to give an admin information |
|
92 | + * Counts the at this point processed files |
|
93 | + * |
|
94 | + * @return mixed |
|
95 | + */ |
|
96 | + public function countActiveProcesses() { |
|
97 | 97 | try { |
98 | 98 | $stats = msg_stat_queue($this->statusqueue); |
99 | 99 | $this->logger->debug('Current active processing count: ' . json_encode($stats['msg_qnum']), ['app' => 'ocr']); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | try { |
201 | 201 | // TODO: release lock |
202 | 202 | |
203 | - // returns user specific processed files |
|
203 | + // returns user specific processed files |
|
204 | 204 | $processed = $this->handleProcessed(); |
205 | 205 | |
206 | 206 | $pending = $this->statusMapper->findAllPending($this->userId); |
@@ -251,18 +251,18 @@ discard block |
||
251 | 251 | $status = $this->statusMapper->delete($status); |
252 | 252 | } |
253 | 253 | $status->setNewName($this->removeFileExtension($status)); |
254 | - $status->setFileId(null); |
|
255 | - $status->setTempFile(null); |
|
256 | - $status->setType(null); |
|
257 | - $status->setErrorDisplayed(null); |
|
254 | + $status->setFileId(null); |
|
255 | + $status->setTempFile(null); |
|
256 | + $status->setType(null); |
|
257 | + $status->setErrorDisplayed(null); |
|
258 | 258 | return $status; |
259 | 259 | } catch (Exception $e) { |
260 | - if ($e instanceof DoesNotExistException) { |
|
261 | - $ex = new NotFoundException($this->l10n->t('Cannot delete. Wrong id.')); |
|
262 | - $this->handleException($ex); |
|
263 | - } else { |
|
264 | - $this->handleException($e); |
|
265 | - } |
|
260 | + if ($e instanceof DoesNotExistException) { |
|
261 | + $ex = new NotFoundException($this->l10n->t('Cannot delete. Wrong id.')); |
|
262 | + $this->handleException($ex); |
|
263 | + } else { |
|
264 | + $this->handleException($e); |
|
265 | + } |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
@@ -273,9 +273,9 @@ discard block |
||
273 | 273 | * @return array |
274 | 274 | */ |
275 | 275 | public function getAllForPersonal($userId) { |
276 | - try { |
|
277 | - $status = $this->statusMapper->findAll($userId); |
|
278 | - $statusNew = array(); |
|
276 | + try { |
|
277 | + $status = $this->statusMapper->findAll($userId); |
|
278 | + $statusNew = array(); |
|
279 | 279 | for ($x = 0; $x < count($status); $x++) { |
280 | 280 | $newName = $this->removeFileExtension($status[$x]); |
281 | 281 | $status[$x]->setNewName($newName); |
@@ -285,11 +285,11 @@ discard block |
||
285 | 285 | $status[$x]->setErrorDisplayed(null); |
286 | 286 | array_push($statusNew, $status[$x]); |
287 | 287 | } |
288 | - return $statusNew; |
|
289 | - } catch (Exception $e) { |
|
290 | - $this->handleException($e); |
|
291 | - } |
|
292 | - } |
|
288 | + return $statusNew; |
|
289 | + } catch (Exception $e) { |
|
290 | + $this->handleException($e); |
|
291 | + } |
|
292 | + } |
|
293 | 293 | |
294 | 294 | /** |
295 | 295 | * Finishes all Processed files by copying them to the right path and deleteing the temp files. |