Commit 070e7632 authored by ludo's avatar ludo
Browse files

Merge branch '20.03_TMA2' of https://labs.maarch.org/maarch/MaarchCourrier into 20.03_TMA2

parents a9087b4d 3c43ea7f
......@@ -256,8 +256,8 @@ class MergeController
$visibleNotes = array_reverse($visibleNotes);
$avisCount = 1;
foreach ($opinionWorkflow as $value) {
$user = UserModel::getById(['id' => $value['item_id'], 'select' => ['firstname', 'lastname']]);
$primaryEntity = UserModel::getPrimaryEntityById(['id' => $value['item_id'], 'select' => ['entities.entity_label', 'users_entities.user_role as role']]);
$user = UserModel::getByLogin(['login' => $value['item_id'], 'select' => ['id','firstname', 'lastname']]);
$primaryEntity = UserModel::getPrimaryEntityById(['id' => $user['id'], 'select' => ['entities.entity_label', 'users_entities.user_role as role']]);
$processDate = null;
if (!empty($value['process_date'])) {
$processDate = ' - ' . TextFormatModel::formatDate($value['process_date']);
......@@ -269,7 +269,7 @@ class MergeController
$avis['entity'.$avisCount] = $primaryEntity['entity_label'];
$avis['note'.$avisCount] = [];
foreach ($visibleNotes as $visibleNote) {
if ($visibleNote['user_id'] === $value['item_id'] && strpos($visibleNote['note_text'], _AVIS_NOTE_PREFIX) === 0) {
if ($visibleNote['user_id'] === $user['id'] && strpos($visibleNote['note_text'], _AVIS_NOTE_PREFIX) === 0) {
$avis['note'.$avisCount][] = trim(str_replace(_AVIS_NOTE_PREFIX, '', $visibleNote['note_text']));
}
}
......
......@@ -398,8 +398,8 @@ class EmailController
$attachmentTypes = AttachmentModel::getAttachmentsTypesByXML();
$rawAttachments = AttachmentModel::get([
'select' => ['res_id', 'title', 'identifier', 'attachment_type', 'typist', 'format', 'filesize', 'status', 'recipient_id', 'recipient_type'],
'where' => ['res_id_master = ?', 'attachment_type not in (?)', 'status not in (?)'],
'data' => [$args['resId'], ['signed_response'], ['DEL', 'OBS']]
'where' => ['res_id_master = ?', 'status not in (?)'],
'data' => [$args['resId'], ['DEL', 'OBS']]
]);
foreach ($rawAttachments as $attachment) {
$attachmentId = $attachment['res_id'];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment