FIX #11107 TIME 4 various bugs : m2m : status, send pj, send note

parent f4ee8799
......@@ -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) {
......
......@@ -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];
......
......@@ -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;
}
}
}
......@@ -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)';
......
......@@ -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";
......
Markdown is supported
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