diff --git a/modules/export_seda/RequestSeda.php b/modules/export_seda/RequestSeda.php index 6be3ceef6a43844135a90c785214d08e73a5d14f..e265bcadd344f163aabc8afe903256bedfedad1a 100755 --- a/modules/export_seda/RequestSeda.php +++ b/modules/export_seda/RequestSeda.php @@ -33,7 +33,7 @@ class RequestSeda { //create session if NO SESSION - /*if (empty($_SESSION['user'])) { + if (empty($_SESSION['user'])) { require_once('core/class/class_functions.php'); include_once('core/init.php'); require_once('core/class/class_portal.php'); @@ -76,7 +76,7 @@ class RequestSeda $businessAppTools->build_business_app_config(); $coreTools->load_modules_config($_SESSION['modules']); $coreTools->load_menu($_SESSION['modules']); - }*/ + } $this->statement = []; if ($db) { diff --git a/modules/sendmail/Controllers/SendMessageExchangeController.php b/modules/sendmail/Controllers/SendMessageExchangeController.php index 8ac0b3eaa7ee9984e9a5d55f31fc562f6d369cb0..dba29c48a8bfe38e9713b81cca3c64b3c3908a1b 100755 --- a/modules/sendmail/Controllers/SendMessageExchangeController.php +++ b/modules/sendmail/Controllers/SendMessageExchangeController.php @@ -242,9 +242,13 @@ class SendMessageExchangeController $oComment = new stdClass(); $date = new DateTime($value['creation_date']); - $entityRoot = \Entity\models\EntityModel::getEntityRootById(['entityId' => $value['entity_id']]); - $userEntity = \Entity\models\entitymodel::getByEntityId(['entityId' => $value['entity_id']]); - $oComment->value = $value['firstname'].' '.$value['lastname'].' - '.$date->format('d-m-Y H:i:s').' ('.$entityRoot['entity_label'].' - '.$userEntity['entity_label'].') : '.$value['note_text']; + $additionalUserInfos = ''; + if (!empty($value['entity_id'])) { + $entityRoot = \Entity\models\EntityModel::getEntityRootById(['entityId' => $value['entity_id']]); + $userEntity = \Entity\models\entitymodel::getByEntityId(['entityId' => $value['entity_id']]); + $additionalUserInfos = ' ('.$entityRoot['entity_label'].' - '.$userEntity['entity_label'].')'; + } + $oComment->value = $value['firstname'].' '.$value['lastname'].' - '.$date->format('d-m-Y H:i:s'). $additionalUserInfos . ' : '.$value['note_text']; array_push($aReturn, $oComment); } } @@ -451,7 +455,7 @@ class SendMessageExchangeController $aDefaultConfig = \Sendmail\Controllers\ReceiveMessageExchangeController::readXmlConfig(); $traCommunicationObject->Channel = $aArgs['ChannelType']; - $traCommunicationObject->value = $aDefaultConfig['m2m_communication_type'][$aArgs['ChannelType']]; + $traCommunicationObject->value = rtrim($aDefaultConfig['m2m_communication_type'][$aArgs['ChannelType']], "/"); $TransferringAgencyObject->OrganizationDescriptiveMetadata->Communication = [$traCommunicationObject]; diff --git a/modules/sendmail/class/class_modules_tools_Abstract.php b/modules/sendmail/class/class_modules_tools_Abstract.php index 0c4a5ec5e79003b76c703a309fe6ae312a7cb861..1374c99e68bcfa8ad1cb6b4d3cf623e597ba3407 100755 --- a/modules/sendmail/class/class_modules_tools_Abstract.php +++ b/modules/sendmail/class/class_modules_tools_Abstract.php @@ -740,4 +740,17 @@ abstract class SendmailAbstract extends Database return _EMAIL_DRAFT; } } + + public function messageExchangeStatus(array $args) + { + if ($args['status'] == 'S') { + return _EMAIL_SENT; + } elseif ($args['status'] == 'E') { + return _EMAIL_ERROR; + } elseif ($args['status'] == 'W') { + return _EMAIL_WAIT; + } else { + return _EMAIL_DRAFT; + } + } } diff --git a/modules/sendmail/mail_form.php b/modules/sendmail/mail_form.php index f23cb70e58ff8a643249a8da1a5e3f0e2a23d6a0..697660bc30f3652720b4f6dee701e2d4c7cab9c9 100755 --- a/modules/sendmail/mail_form.php +++ b/modules/sendmail/mail_form.php @@ -457,7 +457,7 @@ if ($mode == 'add') { } $content .= '><span style="font-size: 10px;color: rgb(22, 173, 235);">'.$attachment_type.'</span> <span style="font-size: 10px;color: grey;">('.$att_type.' - '.$filesize.')</span><br/><strong>'.$description.'</strong>'; - if ($attachment_files[$i]['pdf_exist'] && $format != 'pdf') { + if ($attachment_files[$i]['pdf_exist'] && $format != 'pdf' && $formContent != 'messageExchange') { $content .= ' (<input style="margin: 0px" title="envoyer la version PDF" type="checkbox" id="join_attachment_'.$i.'" name="'.$inputName.'"' .' class="check" value="' .$id.'#PDF" />version pdf)'; diff --git a/modules/sendmail/messageExchangeList.php b/modules/sendmail/messageExchangeList.php index 9fb3f54de8cf80b6fbc993397ac28e221de8c29a..4f1b23138fd12c7d8cc9e68722b8dea28613a879 100755 --- a/modules/sendmail/messageExchangeList.php +++ b/modules/sendmail/messageExchangeList.php @@ -135,7 +135,7 @@ if (!empty($tab)) { $tab[$i][$j]["order"] = 'account_id'; } if ($tab[$i][$j][$value]=="status_label") { - $tab[$i][$j]['value'] = $sendmail_tools->emailStatus(['status' => $tab[$i][$j]['value']]); + $tab[$i][$j]['value'] = $sendmail_tools->messageExchangeStatus(['status' => $tab[$i][$j]['value']]); $tab[$i][$j]["label"] = _STATUS; $tab[$i][$j]["size"] = "1"; $tab[$i][$j]["label_align"] = "left";