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
3b0bedf4
Commit
3b0bedf4
authored
Nov 05, 2021
by
Charlotte Bataille
Browse files
feat/18079 : compare ownerOrgIds and update originator
parent
39a5466f
Pipeline
#14339
failed with stages
in 57 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bundle/recordsManagement/Controller/archiveModificationTrait.php
View file @
3b0bedf4
...
...
@@ -979,13 +979,24 @@ trait archiveModificationTrait
/**
* Update originator service of an array of archives
*
* @param
array
$archiveIds
Array
of archive identifiers
* @param
string
$archiveIds
List
of archive identifiers
* @param string $orgId Organization identified destined to be new originator of archive
*
*/
public
function
updateOriginator
(
$archiveIds
,
$orgId
)
{
var_dump
(
'dans le controleur'
);
exit
;
$archive
=
$this
->
sdoFactory
->
read
(
'recordsManagement/archive'
,
$archiveIds
);
$currentOwnerOrgId
=
$archive
->
originatorOwnerOrgId
;
$newOriginatorOrg
=
$this
->
sdoFactory
->
read
(
'organization/organization'
,
$orgId
);
if
(
$currentOwnerOrgId
==
$newOriginatorOrg
->
ownerOrgId
)
{
$archive
->
originatorOrgRegNumber
=
$newOriginatorOrg
->
registrationNumber
;
$archive
->
lastModificationDate
=
\
laabs
::
newTimestamp
();
$this
->
sdoFactory
->
update
(
$archive
,
'recordsManagement/archive'
);
}
else
{
throw
new
\
bundle\recordsManagement\Exception\organizationException
(
"The new originator organization of the archive must have the same owner organization as the current one."
);
}
}
}
src/bundle/recordsManagement/Model/archiveOriginator.php
View file @
3b0bedf4
...
...
@@ -22,13 +22,13 @@ namespace bundle\recordsManagement\Model;
* Class model that represents an archive
*
* @package RecordsManagement
* @author C
yril VAZQUEZ (Maarch) <cyril.vazquez
@maarch.org>
* @author C
harlotte Bataille (Maarch) <charlotte.bataille
@maarch.org>
*
* @substitution recordsManagement/archive
*
* @pkey [archiveId]
*/
class
archive
Status
class
archive
Originator
{
/**
* The archive identifier
...
...
@@ -39,12 +39,12 @@ class archiveStatus
public
$archiveId
;
/**
* The stat
us
* The
regi
st
r
at
ion number of the originator organization
*
* @var string
* @
enumeration [pending, preserved, frozen, disposable, disposed]
* @
notempty
*/
public
$
status
;
public
$
originatorOrgRegNumber
;
/**
* @var timestamp
...
...
src/presentation/maarchRM/Resources/locale/fr/exceptions/messages.po
View file @
3b0bedf4
...
...
@@ -263,6 +263,9 @@ msgstr "Une archive gelée ne peut pas être modifiée."
msgid "An archive that does not have the status 'preserved' can't be modified."
msgstr "Une archive n'ayant pas le statut 'Conservée' ne peut pas être modifiée"
msgid "The new originator organization of the archive must have the same owner organization as the current one."
msgstr "Le nouveau service producteur de l'archive doit avoir la même organisation racine que le service producteur actuel."
msgid "An action is already in progress on this archive."
msgstr "Une action est déjà en cours sur cette archive."
...
...
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