36trait CommonSignedObject
42 public $signed_status = 0;
49 public static $SIGNED_STATUSES = [
50 'STATUS_NO_SIGNATURE' => 0,
51 'STATUS_SIGNED_SENDER' => 1,
52 'STATUS_SIGNED_RECEIVER' => 2,
53 'STATUS_SIGNED_RECEIVER_ONLINE' => 3,
54 'STATUS_SIGNED_ALL' => 9,
65 $langs->load(
"commercial");
67 $l10n_signed_status_labels = [
68 self::$SIGNED_STATUSES[
'STATUS_NO_SIGNATURE'] =>
'NoSignature',
69 self::$SIGNED_STATUSES[
'STATUS_SIGNED_SENDER'] =>
'SignedSender',
70 self::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER'] =>
'SignedReceiver',
71 self::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'] =>
'SignedReceiverOnline',
72 self::$SIGNED_STATUSES[
'STATUS_SIGNED_ALL'] =>
'SignedAll'
75 $l10n_signed_status = [];
76 foreach (self::$SIGNED_STATUSES as $signed_status_code) {
77 $l10n_signed_status[$signed_status_code] = $langs->transnoentitiesnoconv($l10n_signed_status_labels[$signed_status_code]);
79 return $l10n_signed_status;
91 public function setSignedStatus(
User $user,
int $status = 0,
int $notrigger = 0,
string $triggercode =
''): int
95 $langs->loadLangs(array(
'commercial'));
97 $this->signed_status = $status;
98 $this->context[
'signature'] = $status;
102 $this->context[
'actionmsg2'] = $langs->transnoentitiesnoconv(
'UnsignedInDolibarr');
105 $this->context[
'actionmsg2'] = $langs->transnoentitiesnoconv(
'SignedSender');
108 $this->context[
'actionmsg2'] = $langs->transnoentitiesnoconv(
'SignedReceiver');
111 $this->context[
'actionmsg2'] = $langs->transnoentitiesnoconv(
'SignedReceiverOnline');
114 $this->context[
'actionmsg2'] = $langs->transnoentitiesnoconv(
'SignedAll');
132 $langs->loadLangs(array(
'commercial'));
138 $statusfield =
'signed_status';
140 $sql =
"UPDATE ".$this->db->prefix().$this->table_element;
141 $sql .=
" SET ".$this->db->sanitize($statusfield).
" = ".((int) $status);
142 $sql .=
" WHERE rowid = ".((int) $this->
id);
144 if ($this->db->query($sql)) {
145 $this->oldcopy = clone $this;
149 $result = $this->call_trigger($triggercode, $user);
156 $this->signed_status = $status;
159 setEventMessages($langs->transnoentitiesnoconv($status == 0 ?
'DocumentUnsigned' :
'DocumentSigned'),
null,
'warnings');
162 $this->db->rollback();
166 $this->error = $this->db->error();
167 $this->db->rollback();
184 $langs->load(
"commercial");
186 $signed_status_label = $this->signed_status !=
'' ? $list_signed_status[$this->signed_status] :
'';
187 $signed_status_label_short = $this->signed_status !=
'' ? $list_signed_status[$this->signed_status] :
'';
188 $signed_status_code =
'status'.$this->signed_status;
189 return dolGetStatus($signed_status_label, $signed_status_label_short,
'', $signed_status_code, $mode);
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Class to manage Dolibarr users.
setSignedStatusCommon(User $user, int $status, int $notrigger=0, string $triggercode='')
Set signed status & call trigger with context message.
setSignedStatus(User $user, int $status=0, int $notrigger=0, string $triggercode='')
Set signed status & object context.
getSignedStatusLocalisedArray()
Returns an array of signed statuses with associated localized labels.
getLibSignedStatus(int $mode=0)
Returns the label for signed status.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php