Commit 59b39fac authored by Prosper De Laure's avatar Prosper De Laure
Browse files

User name was added on delivery request or restitution request

parent 899d790f
......@@ -174,10 +174,11 @@ class ArchiveDeliveryRequest extends abstractMessage
* @param string $comment The request comment
* @param object $senderOrgRegNumber The requesting org
* @param string $recipientOrgRegNumber The recipient org registration number
* @param string $userName The requester user name
*
* @return The reply message generated
*/
public function send($reference, $archives, $derogation = false, $comment = false, $senderOrgRegNumber = false, $recipientOrgRegNumber = false)
public function send($reference, $archives, $derogation = false, $comment = false, $senderOrgRegNumber = false, $recipientOrgRegNumber = false, $userName)
{
if (!is_array($archives)) {
$archives = array($archives);
......@@ -231,6 +232,9 @@ class ArchiveDeliveryRequest extends abstractMessage
$message->object = $archiveDeliveryRequest;
$archiveDeliveryRequest->requester = $this->sendOrganization($message->senderOrg);
if ($userName) {
$archiveDeliveryRequest->requester->userName = $userName;
}
$archiveDeliveryRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
......
......@@ -230,7 +230,12 @@ class ArchiveRestitution extends abstractMessage
}
$senderOrgRegNumber = $senderOrg->registrationNumber;
$user = \laabs::getToken('AUTH');
$userName = false;
if($user) {
$user = \laabs::callService('auth/userAccount/read_userAccountId_', $user->accountId);
$userName = $user->accountName;
}
$archivesByOriginator = [];
$archivesIdsByOriginator = [];
......@@ -277,7 +282,7 @@ class ArchiveRestitution extends abstractMessage
$recipientOrgRegNumber = $archivesForRestitution[0]->archiverOrgRegNumber;
$archiveRestitutionRequestController->send($messageIdentifier, $archivesForRestitution, $comment, $senderOrgRegNumber, $recipientOrgRegNumber);
$archiveRestitutionRequestController->send($messageIdentifier, $archivesForRestitution, $comment, $senderOrgRegNumber, $recipientOrgRegNumber, $userName);
}
return $result;
......
......@@ -116,10 +116,11 @@ class ArchiveRestitutionRequest extends abstractMessage
* @param string $comment The request comment
* @param string $senderOrg The requesting org
* @param string $recipientOrg The requesting org
* @param string $userName The requester user name
*
* @return The reply message generated
*/
public function send($reference, $archives, $comment = false, $senderOrg = false, $recipientOrg = false)
public function send($reference, $archives, $comment = false, $senderOrg = false, $recipientOrg = false, $userName = false)
{
if (!is_array($archives)) {
$archives = array($archives);
......@@ -164,6 +165,10 @@ class ArchiveRestitutionRequest extends abstractMessage
$message->object = $archiveRestitutionRequest;
$archiveRestitutionRequest->requester = $this->sendOrganization($message->senderOrg);
if ($userName) {
$archiveRestitutionRequest->requester->userName = $userName;
}
$archiveRestitutionRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$this->generate($message);
......
......@@ -786,6 +786,11 @@ class message
if (isset($object->organizationDescriptiveMetadata) && !$object->organizationDescriptiveMetadata->displayName && $organization != null) {
$object->organizationDescriptiveMetadata->displayName = $organization->displayName;
}
if (isset($object->userName)) {
$object->organizationDescriptiveMetadata->userName = $object->userName;
}
}
/**
......
......@@ -266,7 +266,7 @@ var zipContent = "";
};
}
function uploadAttachement(file){
function uploadAttachement(file) {
var oFileReader = new FileReader();
oFileReader.readAsDataURL(file);
oFileReader.onload = function() {
......
......@@ -14,6 +14,12 @@
<dd translate="no">
<?merge $organization.organizationDescriptiveMetadata.displayName ?>
</dd>
<?merge $organization.userName.bool() ?>
<dt>Utilisateur</dt>
<?merge $organization.userName.bool() ?>
<dd translate="no">
<?merge $organization.userName ?>
</dd>
</dl>
<?merge $organization.address.bool() ?>
<div>
......
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