Skip to content

Commit

Permalink
Merge pull request #396 from nicolas-eoxia/add_triggers_certificate
Browse files Browse the repository at this point in the history
#376 [Triggers] add: certificate triggers
  • Loading branch information
nicolas-eoxia authored Jul 21, 2023
2 parents e40a50d + 7139a9a commit c6a7622
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/triggers/interface_99_modDolisirh_DolisirhTriggers.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
return 0; // If module is not enabled, we do nothing.
}

saturne_load_langs();

// Data and type of action are stored into $object and $action.
dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . '. id=' . $object->id);

Expand Down Expand Up @@ -312,34 +314,46 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf

// VALIDATE
case 'TIMESHEET_VALIDATE' :
case 'CERTIFICATE_VALIDATE' :
$actioncomm->code = 'AC_' . strtoupper($object->element) . '_VALIDATE';
$actioncomm->label = $langs->trans('ObjectValidateTrigger', $langs->transnoentities(ucfirst($object->element)), $object->ref);
$actioncomm->create($user);
break;

// UNVALIDATE
case 'TIMESHEET_UNVALIDATE' :
case 'CERTIFICATE_UNVALIDATE' :
$actioncomm->code = 'AC_' . strtoupper($object->element) . '_UNVALIDATE';
$actioncomm->label = $langs->trans('ObjectUnValidateTrigger', $langs->transnoentities(ucfirst($object->element)), $object->ref);
$actioncomm->create($user);
break;

// LOCK
case 'TIMESHEET_LOCK' :
case 'CERTIFICATE_LOCK' :
$actioncomm->code = 'AC_' . strtoupper($object->element) . '_LOCK';
$actioncomm->label = $langs->trans('ObjectLockedTrigger', $langs->transnoentities(ucfirst($object->element)), $object->ref);
$actioncomm->create($user);
break;

// ARCHIVE
case 'TIMESHEET_ARCHIVE' :
case 'CERTIFICATE_ARCHIVE' :
$actioncomm->code = 'AC_' . strtoupper($object->element) . '_ARCHIVE';
$actioncomm->label = $langs->trans('ObjectArchivedTrigger', $langs->transnoentities(ucfirst($object->element)), $object->ref);
$actioncomm->create($user);
break;

// EXPIRE
case 'CERTIFICATE_EXPIRE' :
$actioncomm->code = 'AC_' . strtoupper($object->element) . '_EXPIRE';
$actioncomm->label = $langs->trans('ObjectExpiredTrigger', $langs->transnoentities(ucfirst($object->element)), $object->ref);
$actioncomm->create($user);
break;

// SENTBYMAIL
case 'TIMESHEET_SENTBYMAIL' :
case 'CERTIFICATE_SENTBYMAIL' :
$actioncomm->code = 'AC_' . strtoupper($object->element) . '_SENTBYMAIL';
$actioncomm->label = $langs->trans('ObjectSentByMailTrigger', $langs->transnoentities(ucfirst($object->element)), $object->ref);
$actioncomm->create($user);
Expand Down

0 comments on commit c6a7622

Please sign in to comment.