|
8 | 8 |
|
9 | 9 | namespace OCA\Libresign\Db; |
10 | 10 |
|
| 11 | +use OCA\Libresign\Enum\FileStatus; |
11 | 12 | use OCP\AppFramework\Db\DoesNotExistException; |
12 | 13 | use OCP\AppFramework\Db\QBMapper; |
13 | 14 | use OCP\Comments\ICommentsManager; |
@@ -245,21 +246,23 @@ public function getFileType(int $id): string { |
245 | 246 | return 'not_libresign_file'; |
246 | 247 | } |
247 | 248 |
|
248 | | - public function getTextOfStatus(int $status): ?string { |
| 249 | + public function getTextOfStatus(int|FileStatus $status): string { |
| 250 | + if (is_int($status)) { |
| 251 | + $status = FileStatus::from($status); |
| 252 | + } |
249 | 253 | return match ($status) { |
250 | 254 | // TRANSLATORS Name of the status when document is not a LibreSign file |
251 | | - File::STATUS_NOT_LIBRESIGN_FILE => $this->l->t('not LibreSign file'), |
| 255 | + FileStatus::NOT_LIBRESIGN_FILE => $this->l->t('not LibreSign file'), |
252 | 256 | // TRANSLATORS Name of the status that the document is still as a draft |
253 | | - File::STATUS_DRAFT => $this->l->t('draft'), |
| 257 | + FileStatus::DRAFT => $this->l->t('draft'), |
254 | 258 | // TRANSLATORS Name of the status that the document can be signed |
255 | | - File::STATUS_ABLE_TO_SIGN => $this->l->t('available for signature'), |
| 259 | + FileStatus::ABLE_TO_SIGN => $this->l->t('available for signature'), |
256 | 260 | // TRANSLATORS Name of the status when the document has already been partially signed |
257 | | - File::STATUS_PARTIAL_SIGNED => $this->l->t('partially signed'), |
| 261 | + FileStatus::PARTIAL_SIGNED => $this->l->t('partially signed'), |
258 | 262 | // TRANSLATORS Name of the status when the document has been completely signed |
259 | | - File::STATUS_SIGNED => $this->l->t('signed'), |
| 263 | + FileStatus::SIGNED => $this->l->t('signed'), |
260 | 264 | // TRANSLATORS Name of the status when the document was deleted |
261 | | - File::STATUS_DELETED => $this->l->t('deleted'), |
262 | | - default => '', |
| 265 | + FileStatus::DELETED => $this->l->t('deleted'), |
263 | 266 | }; |
264 | 267 | } |
265 | 268 |
|
|
0 commit comments