Commit d7293fed authored by Charlotte Bataille's avatar Charlotte Bataille
Browse files

fix/19929 : search form debug

parent 5600195f
......@@ -1624,15 +1624,11 @@ class organization
public function getOriginator()
{
$currentService = \laabs::getToken("ORGANIZATION");
if (!$currentService) {
$this->view->addContentFile("recordsManagement/welcome/noWorkingOrg.html");
return $this->view->saveHtml();
}
$ownerOriginatorOrgs = $this->getOwnerOrgsByRole($currentService, 'originator');
$originators = [];
foreach ($ownerOriginatorOrgs as $org) {
foreach ($org->originator as $originator) {
foreach ($org->originators as $originator) {
$originator->ownerOrgName = $org->displayName;
$originators[] = $originator;
}
......@@ -1650,7 +1646,18 @@ class organization
*/
protected function getOwnerOrgsByRole($currentService, $role)
{
$orgUnits = $this->getOrgsByRole($role);
$transaction = false;
if (isset(\laabs::getConfiguration("medona")['transaction'])) {
$transaction = (bool) \laabs::getConfiguration("medona")['transaction'];
}
if (!$transaction) {
$orgUnits = $this->getOwnerOriginatorsOrgs($currentService);
// return $orgUnits;
} else {
$orgUnits = $this->getOrgsByRole($role);
}
$userPositionController = \laabs::newController('organization/userPosition');
$archivalAgreementController = \laabs::newController('medona/archivalAgreement');
......@@ -1695,14 +1702,16 @@ class organization
|| ($role == 'originator' && $orgUnit->registrationNumber == $userOrgUnit->registrationNumber)
// Depositor = all
|| $role == 'depositor') {
// $originators = $orgUnit->originators;
if (!isset($userOrgs[(string)$orgUnit->ownerOrgId])) {
$orgObject = $this->read((string)$orgUnit->ownerOrgId);
$userOrgs[(string)$orgObject->orgId] = new \stdClass();
$userOrgs[(string)$orgObject->orgId]->displayName = $orgObject->displayName;
$userOrgs[(string)$orgObject->orgId]->{$role} = [];
$userOrgs[(string)$orgObject->orgId]->originators = [];
}
$userOrgs[(string)$orgObject->orgId]->{$role}[] = $orgUnit;
$userOrgs[(string)$orgObject->orgId]->originators[] = $orgUnit;
}
}
}
......
......@@ -79,7 +79,7 @@ class archive
$emptyRole = false;
// $ownerOriginatorOrgs = $this->getOwnerOriginatorsOrgs($currentService);
$orgController = \laabs::newController('organization/organization');
/* $orgController = \laabs::newController('organization/organization');
$originators = $orgController->getOriginator();
foreach ($originators as $originator) {
if (!isset($ownerOriginatorOrgs[(string) $originator->ownerOrgId])) {
......@@ -90,7 +90,7 @@ class archive
if (!in_array($originator, $ownerOriginatorOrgs[(string) $originator->ownerOrgId]->originators)) {
$ownerOriginatorOrgs[(string)$originator->ownerOrgId]->originators[] = $originator;
}
}
} */
}
$descriptionSchemeNames = \laabs::callService('recordsManagement/descriptionScheme/read_name_Descriptionfields');
......@@ -125,7 +125,7 @@ class archive
$this->view->setSource("retentionRules", $retentionRules);
$this->view->setSource("emptyRole", $emptyRole);
$this->view->setSource("profiles", $profiles);
$this->view->setSource("organizationsOriginator", $ownerOriginatorOrgs);
// $this->view->setSource("organizationsOriginator", $ownerOriginatorOrgs);
$this->view->setSource("deleteDescription", $deleteDescription);
$this->view->setSource("descriptionScheme", $descriptionSchemeNames);
......@@ -242,6 +242,7 @@ class archive
$archive->hasRights = false;
} else {
$archive->hasRights = $archiveController->checkRights($archive);
// $archive->hasRights = true;
}
} catch (\Exception $e) {
$archive->hasRights = false;
......
......@@ -905,7 +905,7 @@
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('orgName'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
//url: '/organizations/todisplay?orgUnit=true',
// url: '/organizations/todisplay?orgUnit=true',
url: '/originator',
ttl: '0'
},
......
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