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