Commit aa69a42d authored by Prosper De Laure's avatar Prosper De Laure
Browse files

#5747 Adding of user field as an archive metadata in scren is managed by the...

#5747 Adding of user field as an archive metadata in scren is managed by the archival profile of the archive.
parent f565f578
......@@ -155,6 +155,8 @@ class welcome
{
$this->view->addContentFile('dashboard/mainScreen/archiveInformation.html');
$acceptUserIndex = true;
// Archive
$originatorOrg = \laabs::callService('organization/organization/readByregnumber_registrationNumber_', $archive->originatorOrgRegNumber);
$archive->originatorOrgName = $originatorOrg->displayName;
......@@ -170,6 +172,8 @@ class welcome
// Add a sub archive
$depositPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "archiveDeposit/deposit");
if ($depositPrivilege) {
$acceptArchiveWithoutProfile = true;
$archivalProfileList = [];
if (!empty($archive->archivalProfileReference)) {
......@@ -199,6 +203,9 @@ class welcome
if (!count($archivalProfileList) && !$archivalProfile->acceptArchiveWithoutProfile ) {
$depositPrivilege = false;
}
$acceptArchiveWithoutProfile = $archivalProfile->acceptArchiveWithoutProfile;
$acceptUserIndex = $archivalProfile->acceptUserIndex;
}
}
......@@ -209,13 +216,13 @@ class welcome
$archive->status = $this->view->translator->getText($archive->status, false, "recordsManagement/messages");
$archive->finalDisposition = $this->view->translator->getText($archive->finalDisposition, false, "recordsManagement/messages");
$this->getDescription($archive);
$this->view->setSource('retentionRules', $retentionRules);
$this->view->setSource("archive", $archive);
$this->view->setSource("depositPrivilege", $depositPrivilege);
$this->view->setSource("archivalProfileList", $archivalProfileList);
$this->view->setSource("acceptArchiveWithoutProfile", $archivalProfile->acceptArchiveWithoutProfile);
$this->view->setSource("acceptArchiveWithoutProfile", $acceptArchiveWithoutProfile);
$this->view->setSource("acceptUserIndex", $acceptUserIndex);
$this->view->merge();
return $this->view->saveHtml();
......
......@@ -45,7 +45,8 @@
</table>
<div id="metadata">
</div>
<div class="dropup col-xs-12 hide" id="archiveCustomFieldAddBtn">
<?merge acceptUserIndex ?>
<div class="dropup col-xs-12" id="archiveCustomFieldAddBtn">
<button type="button" class="btn btn-sm btn-link pull-right" title="Add field" data-toggle="dropdown">
&nbsp;<i class="fa fa-plus">&nbsp;</i>Add field
</button>
......@@ -304,7 +305,6 @@
$('#editMetadata').prop('disabled',true);
$('#saveMetadata').show();
$('#cancelMetadataEdition').show();
$('#archiveCustomFieldAddBtn').removeClass('hide');
//$('#archiveInformation').find('.originatorArchiveId').hide();
//$('#archiveInformation').find('.archiveName').hide();
......
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