Commit 243b4a2e authored by Alexis Ragot's avatar Alexis Ragot
Browse files

fix bug - no current organization with superadmin

parent b98dbb56
......@@ -83,22 +83,28 @@ class welcome
// archival profiles for search form
$archivalProfileController = \laabs::newController("recordsManagement/archivalProfile");
$archivalProfiles = \laabs::callService('recordsManagement/archivalProfile/readOrgunitprofiles', $currentOrganization->registrationNumber);
foreach ($archivalProfiles as $archivalProfile) {
$archivalProfileController->readDetail($archivalProfile);
$archivalProfile->searchFields = [];
foreach ($archivalProfile->archiveDescription as $archiveDescription) {
switch ($archiveDescription->descriptionField->type) {
case 'text':
case 'name':
case 'date':
case 'number':
case 'boolean':
$archivalProfile->searchFields[] = $archiveDescription->descriptionField;
if (!empty($currentOrganization->registrationNumber)) {
$archivalProfiles = \laabs::callService('recordsManagement/archivalProfile/readOrgunitprofiles', $currentOrganization->registrationNumber);
foreach ($archivalProfiles as $archivalProfile) {
$archivalProfileController->readDetail($archivalProfile);
$archivalProfile->searchFields = [];
foreach ($archivalProfile->archiveDescription as $archiveDescription) {
switch ($archiveDescription->descriptionField->type) {
case 'text':
case 'name':
case 'date':
case 'number':
case 'boolean':
$archivalProfile->searchFields[] = $archiveDescription->descriptionField;
}
}
}
$this->view->setSource("userArchivalProfiles", $archivalProfiles);
}
$depositPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "archiveDeposit/deposit");
......@@ -106,7 +112,7 @@ class welcome
$this->view->setSource("depositPrivilege", $depositPrivilege);
$this->view->setSource("filePlanPrivileges", $filePlanPrivileges);
$this->view->setSource("userArchivalProfiles", $archivalProfiles);
foreach ($this->view->getElementsByClass('dateRangePicker') as $dateRangePickerInput) {
$this->view->translate($dateRangePickerInput);
......
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