Skip to content
Snippets Groups Projects
Commit 3e38d834 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #8391 visaworkflow V2 after send to external signatory book

parent 4822939e
No related branches found
No related tags found
No related merge requests found
......@@ -13,11 +13,13 @@
namespace Action\controllers;
use Attachment\models\AttachmentModel;
use Entity\models\ListInstanceModel;
use ExternalSignatoryBook\controllers\MaarchParapheurController;
use ExternalSignatoryBook\controllers\XParaphController;
use Resource\models\ResModel;
use SrcCore\models\CoreConfigModel;
use SrcCore\models\ValidatorModel;
use User\models\UserModel;
trait ExternalSignatoryBookTrait
{
......@@ -106,11 +108,28 @@ trait ExternalSignatoryBookTrait
$document = ResModel::getById(['resId' => $args['resId'], 'select' => ['status']]);
if ($document['status'] == 'EVIS' || $document['status'] == 'ESIG') {
// $sequence = $circuit_visa->getCurrentStep($res_id, $coll_id, 'VISA_CIRCUIT');
$stepDetails = array();
// $stepDetails = $circuit_visa->getStepDetails($res_id, $coll_id, 'VISA_CIRCUIT', $sequence);
$stepDetails = ListInstanceModel::getCurrentStepByResId(['resId' => $args['resId']]);
// $message = $circuit_visa->processVisaWorkflow(['stepDetails' => $stepDetails, 'res_id' => $res_id]);
if (!empty($stepDetails) && $stepDetails['item_id'] != $GLOBALS['userId']) {
ListInstanceModel::update([
'set' => ['process_date' => 'CURRENT_TIMESTAMP'],
'where' => ['listinstance_id = ?', 'item_mode = ?', 'res_id = ?', 'item_id = ?', 'difflist_type = ?'],
'data' => [$stepDetails['listinstance_id'], $stepDetails['item_mode'], $args['resId'], $stepDetails['item_id'], 'VISA_CIRCUIT']
]);
$currentUserInfo = UserModel::getByLogin(['login' => $GLOBALS['userId'], 'select' => ['firstname', 'lastname']]);
$visaUserInfo = UserModel::getByLogin(['login' => $stepDetails['item_id'], 'select' => ['firstname', 'lastname']]);
$historyInfo = ' ' . _VISA_BY . ' ' . $currentUserInfo['firstname'] . ' ' . $currentUserInfo['lastname'] . ' ' . _INSTEAD_OF . ' ' . $visaUserInfo['firstname'] . ' ' . $visaUserInfo['lastname'];
} elseif (!empty($stepDetails)) {
ListInstanceModel::update([
'set' => ['process_date' => 'CURRENT_TIMESTAMP'],
'where' => ['listinstance_id = ?', 'item_mode = ?', 'res_id = ?', 'item_id = ?', 'difflist_type = ?'],
'data' => [$stepDetails['listinstance_id'], $stepDetails['item_mode'], $args['resId'], $GLOBALS['userId'], 'VISA_CIRCUIT']
]);
$historyInfo = '';
}
}
}
......
......@@ -479,3 +479,5 @@ define("_SEND_SHIPPING", "Send a mailpiece");
define("_VIEW_DOCUMENTS_WITH_NOTES", "View mail with notes");
define("_VIEW_DOCUMENTS_WITH_NOTES_DESC", "View attachment of 'document_with_notes' type");
define('_VISA_BY', 'Visa by');
define('_INSTEAD_OF', 'Instead of');
......@@ -479,3 +479,5 @@ define("_SEND_SHIPPING", "Envoyer un pli postal");
define("_VIEW_DOCUMENTS_WITH_NOTES", "Voir les courriers annotés");
define("_VIEW_DOCUMENTS_WITH_NOTES_DESC", "Voir les pièces jointes de type 'Document annoté'");
define('_VISA_BY', 'Visa par');
define('_INSTEAD_OF', 'à la place de');
......@@ -481,3 +481,5 @@ define("_SEND_SHIPPING", "Send a mailpiece_TO_TRANSLATE");
define("_VIEW_DOCUMENTS_WITH_NOTES", "View mail with notes_TO_TRANSLATE");
define("_VIEW_DOCUMENTS_WITH_NOTES_DESC", "View attachment of 'document_with_notes' type_TO_TRANSLATE");
define('_VISA_BY', 'Goedkeuring door');
define('_INSTEAD_OF', 'in plaats van');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment