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
thirdPartyArchiving
Commits
82bb7959
Commit
82bb7959
authored
Apr 08, 2019
by
Arnaud Pauget
Browse files
Merge branch 'fix/ArchiveRestitution' into 'release/2.4'
Fix/archive restitution See merge request maarch/thirdPartyArchiving!67
parents
3c6a3953
0164085f
Changes
2
Hide whitespace changes
Inline
Side-by-side
bundle/recordsManagement/Controller/archive.php
View file @
82bb7959
...
...
@@ -77,4 +77,28 @@ class archive extends \bundle\recordsManagement\Controller\archive
return
$res
;
}
/**
* Check if the new status of an archive is possible depending on current status
* @param string $archiveId Identifier of the archives to check
* @param string $status New status to check
*
* @return boolean if the new status is possible on this archive (depends on the current status of the archive)
*/
public
function
checkStatus
(
$archiveId
,
$status
)
{
$statusList
=
[];
$statusList
[
'restituable'
]
=
array
(
'preserved'
,
'restituted'
,
'disposed'
);
if
(
!
isset
(
$statusList
[
$status
]))
{
return
false
;
}
$archive
=
$this
->
sdoFactory
->
read
(
'recordsManagement/archiveStatus'
,
$archiveId
);
if
(
!
in_array
(
$archive
->
status
,
$statusList
[
$status
]))
{
return
false
;
}
return
true
;
}
}
presentation/maarchRM/Presenter/medona/archiveModification.php
View file @
82bb7959
...
...
@@ -71,17 +71,23 @@ class archiveModification
}
else
{
$success
=
count
(
$result
[
'success'
]);
$echec
=
count
(
$result
[
'error'
]);
$this
->
json
->
message
=
''
;
$this
->
json
->
message
=
'%1$s archive(s) flagged for restitution.'
;
$this
->
json
->
message
=
$this
->
translator
->
getText
(
$this
->
json
->
message
);
$this
->
json
->
message
=
sprintf
(
$this
->
json
->
message
,
$success
);
if
(
$success
>
0
)
{
$this
->
json
->
message
=
'%1$s archive(s) flagged for restitution.'
;
$this
->
json
->
message
=
$this
->
translator
->
getText
(
$this
->
json
->
message
);
$this
->
json
->
message
=
sprintf
(
$this
->
json
->
message
,
$success
);
}
if
(
$echec
>
0
)
{
$message
=
'%1$s archive(s) can not be flagged.'
;
if
(
$success
>
0
)
{
$this
->
json
->
message
.
=
'<br>'
;
}
$message
=
'%1$s archive(s) can not be flagged because an action is already in progress on this(these) archive(s) (or on one of its/their objects).'
;
$message
=
$this
->
translator
->
getText
(
$message
);
$message
=
sprintf
(
$message
,
$echec
);
$this
->
json
->
message
.
=
' '
.
$message
;
$this
->
json
->
message
.
=
$message
;
}
}
...
...
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