mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
feat: add getLabel method to SignRequestStatus enum
Add a getLabel() method to the SignRequestStatus enum to provide localized status labels (Draft, Pending, Signed). This follows the same pattern as DocMdpLevel enum and centralizes the translation logic in the enum itself rather than spreading it across multiple files. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
453b200bcf
commit
e3ad25951a
1 changed files with 13 additions and 0 deletions
|
|
@ -9,8 +9,21 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCA\Libresign\Enum;
|
||||
|
||||
use OCP\IL10N;
|
||||
|
||||
enum SignRequestStatus: int {
|
||||
case DRAFT = 0;
|
||||
case ABLE_TO_SIGN = 1;
|
||||
case SIGNED = 2;
|
||||
|
||||
public function getLabel(IL10N $l10n): string {
|
||||
return match($this) {
|
||||
// TRANSLATORS Name of the status when signer document is in draft state
|
||||
self::DRAFT => $l10n->t('Draft'),
|
||||
// TRANSLATORS Name of the status when signer can sign the document
|
||||
self::ABLE_TO_SIGN => $l10n->t('Pending'),
|
||||
// TRANSLATORS Name of the status when signer has already signed
|
||||
self::SIGNED => $l10n->t('Signed'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue