Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
maarchRM
Commits
ff4fb143
Commit
ff4fb143
authored
May 31, 2022
by
Charlotte Bataille
Browse files
feat/18593 : fix jsonSerialize bug
parent
c82e7a28
Pipeline
#18541
failed with stages
in 39 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/bundle/organization/Controller/organization.php
View file @
ff4fb143
...
...
@@ -1624,11 +1624,15 @@ 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
s
as
$originator
)
{
foreach
(
$org
->
originator
as
$originator
)
{
$originator
->
ownerOrgName
=
$org
->
displayName
;
$originators
[]
=
$originator
;
}
...
...
@@ -1672,8 +1676,10 @@ class organization
$archiver
=
true
;
$myOriginatorOrgs
=
[];
foreach
(
$allArchivalAgreements
as
$archivalAgreement
)
{
if
(
$archivalAgreement
->
archiverOrgRegNumber
==
$userOrgUnitOrgRegNumber
)
{
$myOriginatorOrgs
=
array_merge
(
$myOriginatorOrgs
,
$archivalAgreement
->
originatorOrgIds
->
jsonSerialize
());
if
(
$archivalAgreement
->
archiverOrgRegNumber
==
$userOrgUnitOrgRegNumber
)
{
if
(
$archivalAgreement
->
originatorOrgIds
)
{
$myOriginatorOrgs
=
array_merge
(
$myOriginatorOrgs
,
$archivalAgreement
->
originatorOrgIds
->
jsonSerialize
());
}
}
}
}
...
...
@@ -1691,16 +1697,14 @@ 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
]
->
originators
=
[];
$userOrgs
[(
string
)
$orgObject
->
orgId
]
->
{
$role
}
=
[];
}
$userOrgs
[(
string
)
$orgObject
->
orgId
]
->
originators
[]
=
$orgUnit
;
$userOrgs
[(
string
)
$orgObject
->
orgId
]
->
{
$role
}
[]
=
$orgUnit
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment