trait CommonSignedObject (View source)

Trait for common signed business objects

Properties

int $signed_status

Status of the contract (0=NoSignature, 1=SignedBySender, 2=SignedByReceiver, 9=SignedByAll)

static array<string, int> $SIGNED_STATUSES

Signed statuses dictionary. Label used as key for string localizations.

DoliDB $db
static $oldcopy
int $id
string $error
string $table_element
array<string, mixed> $context

Methods

array
getSignedStatusLocalisedArray()

Returns an array of signed statuses with associated localized labels

int
setSignedStatus(User $user, int $status = 0, int $notrigger = 0, string $triggercode = '')

Set signed status & object context. Call sign action trigger.

int
setSignedStatusCommon(User $user, int $status, int $notrigger = 0, string $triggercode = '')

Set signed status & call trigger with context message

string
getLibSignedStatus(int $mode = 0)

Returns the label for signed status

int
call_trigger(string $triggerName, User $user)

No description

Details

array getSignedStatusLocalisedArray()

Returns an array of signed statuses with associated localized labels

Return Value

array

int setSignedStatus(User $user, int $status = 0, int $notrigger = 0, string $triggercode = '')

Set signed status & object context. Call sign action trigger.

Parameters

User $user

Object user that modify

int $status

New signed status to set (often a constant like self::STATUS_XXX)

int $notrigger

1 = Does not execute triggers, 0 = Execute triggers

string $triggercode

Trigger code to use

Return Value

int

0 < if KO, > 0 if OK

int setSignedStatusCommon(User $user, int $status, int $notrigger = 0, string $triggercode = '')

Set signed status & call trigger with context message

Parameters

User $user

Object user that modify

int $status

New signed status to set (often a constant like self::STATUS_XXX)

int $notrigger

1 = Does not execute triggers, 0 = Execute triggers

string $triggercode

Trigger code to use

Return Value

int

0 < if KO, > 0 if OK

string getLibSignedStatus(int $mode = 0)

Returns the label for signed status

Parameters

int $mode

0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto

Return Value

string Label

int call_trigger(string $triggerName, User $user)

No description

Parameters

string $triggerName
User $user

Return Value

int