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
1e9698eb
Commit
1e9698eb
authored
Jun 22, 2017
by
Prosper De Laure
Browse files
Bug : The profile are loaded on children archives
parent
adb350ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bundle/recordsManagement/Controller/archiveEntryTrait.php
View file @
1e9698eb
...
...
@@ -185,7 +185,7 @@ trait archiveEntryTrait
private
function
extractArchiveUnit
(
$filename
)
{
$archivalProfileReference
=
strtok
(
$filename
,
" "
);
$archiveName
=
substr
(
$
archivalProfileReferenc
e
,
strlen
(
$archivalProfileReference
)
+
1
);
$archiveName
=
substr
(
$
filenam
e
,
strlen
(
$archivalProfileReference
)
+
1
);
$archive
=
\
laabs
::
newInstance
(
"recordsManagement/archive"
);
$archive
->
archiveName
=
$archiveName
;
...
...
@@ -357,7 +357,12 @@ trait archiveEntryTrait
*/
public
function
completeArchivalProfileCodes
(
$archive
)
{
$archive
->
archivalProfileReference
=
$this
->
currentArchivalProfile
->
reference
;
if
(
$archive
->
archivalProfileReference
==
""
)
{
$archive
->
archivalProfileReference
=
$this
->
currentArchivalProfile
->
reference
;
}
else
{
$this
->
useArchivalProfile
(
$archive
->
archivalProfileReference
);
}
if
(
!
empty
(
$this
->
currentArchivalProfile
->
retentionRuleCode
))
{
$archive
->
retentionRuleCode
=
$this
->
currentArchivalProfile
->
retentionRuleCode
;
...
...
@@ -497,7 +502,6 @@ trait archiveEntryTrait
}
$nbArchiveObjects
=
count
(
$archive
->
contents
);
try
{
$archive
->
status
=
'preserved'
;
...
...
@@ -510,13 +514,14 @@ trait archiveEntryTrait
if
(
!
empty
(
$archive
->
digitalResources
))
{
$this
->
storeResources
(
$archive
);
}
$this
->
storeDescriptiveMetadata
(
$archive
);
for
(
$i
=
0
;
$i
<
$nbArchiveObjects
;
$i
++
)
{
$archive
->
contents
[
$i
]
->
parentArchiveId
=
$archive
->
archiveId
;
$archive
->
contents
[
$i
]
->
originatorOwnerOrgId
=
$archive
->
originatorOwnerOrgId
;
/*
$archive->contents[$i]->archivalProfileReference = $archive->archivalProfileReference;
*/
if
(
$archive
->
contents
[
$i
]
->
originatorOrgRegNumber
!=
$archive
->
originatorOrgRegNumber
)
{
$archive
->
contents
[
$i
]
->
parentOriginatorOrgRegNumber
=
$archive
->
originatorOrgRegNumber
;
}
...
...
src/presentation/maarchRM/Presenter/recordsManagement/welcome.php
View file @
1e9698eb
...
...
@@ -270,14 +270,10 @@ class welcome
*/
protected
function
getDescription
(
$archive
)
{
if
(
!
isset
(
$archive
->
descriptionObject
))
{
return
;
}
$archivalProfile
=
null
;
if
(
!
empty
(
$archive
->
archivalProfileReference
))
{
$archivalProfile
=
\
laabs
::
callService
(
'recordsManagement/archivalProfile/readByreference_reference_'
,
$archive
->
archivalProfileReference
);
$archive
->
archivalProfileName
=
$archivalProfile
->
name
;
}
...
...
@@ -293,54 +289,57 @@ class welcome
}
}
foreach
(
$archive
->
descriptionObject
as
$name
=>
$value
)
{
$label
=
$type
=
$archivalProfileField
=
null
;
if
(
$archivalProfile
)
{
foreach
(
$archivalProfile
->
archiveDescription
as
$archiveDescription
)
{
if
(
$archiveDescription
->
fieldName
==
$name
)
{
$label
=
$archiveDescription
->
descriptionField
->
label
;
$archivalProfileField
=
true
;
$type
=
$archiveDescription
->
descriptionField
->
type
;
if
(
isset
(
$archive
->
descriptionObject
))
{
foreach
(
$archive
->
descriptionObject
as
$name
=>
$value
)
{
$label
=
$type
=
$archivalProfileField
=
null
;
if
(
$archivalProfile
)
{
foreach
(
$archivalProfile
->
archiveDescription
as
$archiveDescription
)
{
if
(
$archiveDescription
->
fieldName
==
$name
)
{
$label
=
$archiveDescription
->
descriptionField
->
label
;
$archivalProfileField
=
true
;
$type
=
$archiveDescription
->
descriptionField
->
type
;
}
}
}
}
if
(
empty
(
$label
))
{
$label
=
$this
->
view
->
translator
->
getText
(
$name
,
false
,
"recordsManagement/archive"
);
}
if
(
empty
(
$label
))
{
$label
=
$this
->
view
->
translator
->
getText
(
$name
,
false
,
"recordsManagement/archive"
);
}
if
(
empty
(
$type
)
&&
$value
!=
""
)
{
$type
=
'text'
;
switch
(
gettype
(
$value
))
{
case
'boolean'
:
$type
=
'boolean'
;
break
;
case
'integer'
:
case
'double'
:
$type
=
'number'
;
break
;
case
'string'
:
if
(
preg_match
(
"#\d
{
4}\-\d{2}\-\d{2
}
#"
,
$value
))
{
$type
=
'date'
;
}
break
;
if
(
empty
(
$type
)
&&
$value
!=
""
)
{
$type
=
'text'
;
switch
(
gettype
(
$value
))
{
case
'boolean'
:
$type
=
'boolean'
;
break
;
case
'integer'
:
case
'double'
:
$type
=
'number'
;
break
;
case
'string'
:
if
(
preg_match
(
"#\d
{
4}\-\d{2}\-\d{2
}
#"
,
$value
))
{
$type
=
'date'
;
}
break
;
}
}
}
if
(
$archivalProfileField
)
{
$descriptionHtml
.
=
'<tr class="archivalProfileField">'
;
}
else
{
$descriptionHtml
.
=
'<tr>'
;
if
(
$archivalProfileField
)
{
$descriptionHtml
.
=
'<tr class="archivalProfileField">'
;
}
else
{
$descriptionHtml
.
=
'<tr>'
;
}
$descriptionHtml
.
=
'<th title="'
.
$label
.
'" name="'
.
$name
.
'" data-type="'
.
$type
.
'">'
.
$label
.
'</th>'
;
$descriptionHtml
.
=
'<td title="'
.
$value
.
'">'
.
$value
.
'</td>'
;
$descriptionHtml
.
=
'</tr>'
;
}
$descriptionHtml
.
=
'<th title="'
.
$label
.
'" name="'
.
$name
.
'" data-type="'
.
$type
.
'">'
.
$label
.
'</th>'
;
$descriptionHtml
.
=
'<td title="'
.
$value
.
'">'
.
$value
.
'</td>'
;
$descriptionHtml
.
=
'</tr>'
;
$descriptionHtml
.
=
'</table>'
;
}
$descriptionHtml
.
=
'</table>'
;
}
if
(
$descriptionHtml
)
{
...
...
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