Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
maarchRM
Commits
c0e2d7f5
Commit
c0e2d7f5
authored
Dec 12, 2019
by
Alexandre Goldstein
Browse files
Merge branch 'release/2.5.2' of labs.maarch.org:maarch/maarchRM into release/2.5.2
parents
f6eef681
4f5962bf
Pipeline
#5648
passed with stage
in 8 minutes and 11 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dependency/html/Document.php
View file @
c0e2d7f5
...
...
@@ -37,12 +37,13 @@ class Document extends \dependency\xml\Document
------------------------------------------------------------------------- */
protected
$layout
;
protected
$classes
;
p
rotected
$plugins
;
p
ublic
$plugins
;
protected
$headers
;
protected
$layoutData
;
public
$XPath
;
public
$translator
;
public
$dateTimeFormatter
;
public
$pluginsParameters
=
[];
/**
* -- document --
* <html>
...
...
@@ -402,15 +403,9 @@ class Document extends \dependency\xml\Document
*/
public
function
addPlugins
(
$node
=
null
)
{
//var_dump("addPlugins($node->nodeType)");
$elements
=
$this
->
XPath
->
query
(
"descendant-or-self::*[@class]"
,
$node
);
foreach
(
$elements
as
$element
)
{
foreach
(
explode
(
' '
,
$element
->
getAttribute
(
'class'
))
as
$htmlClass
)
{
if
(
isset
(
$this
->
plugins
[
$htmlClass
]))
{
$pluginClass
=
$this
->
plugins
[
$htmlClass
];
$element
->
plugin
[
$htmlClass
]
=
new
$pluginClass
(
$element
);
}
}
$element
->
addPlugins
();
}
}
...
...
@@ -420,19 +415,9 @@ class Document extends \dependency\xml\Document
*/
public
function
savePlugins
(
$node
=
null
)
{
$parameters
=
[];
$elements
=
$this
->
XPath
->
query
(
"descendant-or-self::*[@class]"
,
$node
);
foreach
(
$elements
as
$element
)
{
foreach
(
$element
->
plugin
as
$name
=>
$plugin
)
{
if
(
method_exists
(
$plugin
,
'saveHtml'
))
{
$plugin
->
saveHtml
();
}
if
(
!
isset
(
$parameters
[
$name
])
&&
method_exists
(
$plugin
,
'saveParameters'
))
{
$parameters
[
$name
]
=
$plugin
;
$plugin
->
saveParameters
();
}
}
$element
->
savePlugins
();
}
}
...
...
dependency/html/Element.php
View file @
c0e2d7f5
...
...
@@ -24,7 +24,7 @@ class Element
/* -------------------------------------------------------------------------
- Properties
------------------------------------------------------------------------- */
p
ublic
$plugin
=
array
()
;
p
rotected
$plugin
;
/* -------------------------------------------------------------------------
- Methods
------------------------------------------------------------------------- */
...
...
@@ -99,4 +99,71 @@ class Element
{
return
implode
(
" "
,
$array
);
}
}
\ No newline at end of file
/**
* Returns the requested property
*
* @param string $name
*
* @return mixed
*/
public
function
__get
(
$name
)
{
if
(
$name
==
'plugin'
&&
empty
(
$this
->
plugin
))
{
$this
->
plugin
=
new
PluginContainer
(
$this
);
}
return
$this
->
{
$name
};
}
/**
* Add plugins
*/
public
function
addPlugins
()
{
foreach
(
explode
(
' '
,
$this
->
getAttribute
(
'class'
))
as
$htmlClass
)
{
if
(
isset
(
$this
->
ownerDocument
->
plugins
[
$htmlClass
]))
{
if
(
!
isset
(
$this
->
plugin
))
{
$this
->
plugin
=
new
PluginContainer
(
$this
);
}
$this
->
plugin
->
add
(
$htmlClass
);
}
}
}
/**
* Translate plugins
*/
public
function
translatePlugins
()
{
if
(
!
isset
(
$this
->
plugin
))
{
return
;
}
foreach
(
$this
->
plugin
as
$name
=>
$plugin
)
{
if
(
method_exists
(
$plugin
,
'translate'
))
{
$plugin
->
translate
();
}
}
}
/**
* Save plugins
*/
public
function
savePlugins
()
{
if
(
!
isset
(
$this
->
plugin
))
{
return
;
}
foreach
(
$this
->
plugin
as
$name
=>
$plugin
)
{
if
(
method_exists
(
$plugin
,
'saveHtml'
))
{
$plugin
->
saveHtml
();
}
if
(
method_exists
(
$plugin
,
'saveParameters'
))
{
$plugin
->
saveParameters
();
}
}
}
}
dependency/html/LocalisationTrait.php
View file @
c0e2d7f5
...
...
@@ -253,11 +253,7 @@ trait LocalisationTrait
{
$elements
=
$this
->
XPath
->
query
(
"descendant-or-self::*[@class]"
,
$node
);
foreach
(
$elements
as
$element
)
{
foreach
(
$element
->
plugin
as
$name
=>
$plugin
)
{
if
(
method_exists
(
$plugin
,
'translate'
))
{
$plugin
->
translate
();
}
}
$element
->
translatePlugins
();
}
}
...
...
dependency/html/PluginContainer.php
0 → 100644
View file @
c0e2d7f5
<?php
/*
* Copyright (C) 2019 Maarch
*
* This file is part of dependency html.
*
* Dependency html is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dependency html is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with dependency html. If not, see <http://www.gnu.org/licenses/>.
*/
namespace
dependency\html
;
/**
* Element plugins container
*
* @package Dependency\Html
* @author Cyril VAZQUEZ <cyril.vazquez@maarch.org>
**/
class
PluginContainer
extends
\
ArrayObject
{
/**
* The owner element of the container
*
* @var DOMElement
*/
protected
$element
;
/**
* Constructs a new container
* @param DOMElement $element
*/
public
function
__construct
(
$element
)
{
$this
->
element
=
$element
;
}
/**
* Returns the requested plugin or instancites a new one
*
* @param string $name
*
* @return object
*/
public
function
offsetGet
(
$name
)
{
if
(
!
isset
(
$this
[
$name
])
&&
isset
(
$this
->
element
->
ownerDocument
->
plugins
[
$name
]))
{
$this
->
add
(
$name
);
}
return
parent
::
offsetGet
(
$name
);
}
/**
* Adds a plugin from a class
*
* @param string $name
*/
public
function
add
(
$name
)
{
$pluginClass
=
$this
->
element
->
ownerDocument
->
plugins
[
$name
];
$plugin
=
new
$pluginClass
(
$this
->
element
);
$this
[
$name
]
=
$plugin
;
}
}
src/presentation/maarchRM/Resources/view/dashboard/mainScreen/archiveForm.html
View file @
c0e2d7f5
...
...
@@ -122,7 +122,7 @@
};
$
(
'
#app_maarchRM_main
'
).
ready
(
function
()
{
$
(
"
#managementMetadataForm
"
).
find
(
"
[name=retentionStartDate]
"
).
data
(
"
datepicker
"
).
setDate
(
new
Date
());
//
$("#managementMetadataForm").find("[name=retentionStartDate]").data("datepicker").setDate(new Date());
});
$
(
"
#archiveForm
"
).
keypress
(
function
(
e
)
{
...
...
@@ -339,7 +339,12 @@
retentionRuleText
=
retentionRuleText
.
replace
(
/%2
\$
s/g
,
numeric
+
'
'
+
unit
);
$
(
'
#retentionRuleText
'
).
text
(
retentionRuleText
);
},
syncSerialize
:
function
(
action
=
"
add
"
)
{
syncSerialize
:
function
(
action
)
{
// to inititate default value and avoid bug on IE 11
if
(
action
===
undefined
)
{
action
=
"
add
"
;
}
var
form
=
$
(
'
#archiveForm, #managementMetadataForm
'
);
var
inputs
=
form
.
find
(
'
.archiveInput
'
);
var
archive
=
{
...
...
src/presentation/maarchRM/Resources/view/dashboard/mainScreen/archiveInformation.html
View file @
c0e2d7f5
...
...
@@ -321,7 +321,7 @@
},
editMetadata
:
function
()
{
var
archiveInformation
=
$
(
'
#archiveInformation
'
);
var
archiveInformation
=
$
(
'
#archiveInformation
'
);
$
(
'
#editMetadata
'
).
prop
(
'
disabled
'
,
true
);
$
(
'
#saveMetadata
'
).
show
();
$
(
'
#cancelMetadataEdition
'
).
show
();
...
...
src/presentation/maarchRM/Resources/view/dashboard/mainScreen/archiveListHandeler.html
View file @
c0e2d7f5
...
...
@@ -277,7 +277,7 @@
})
},
checkRights
:
function
(
archivalProfiles
,
withoutProfile
,
fileplanLevel
){
checkRights
:
function
(
archivalProfiles
,
withoutProfile
,
fileplanLevel
)
{
var
button
=
this
.
selected
.
closest
(
'
.archive
'
).
find
(
'
.addChildrenArchive
'
);
var
archiveStatus
=
button
.
closest
(
'
.archive
'
).
find
(
'
.status
'
).
text
();
if
(
archiveStatus
==
'
disposed
'
||
fileplanLevel
==
'
item
'
||
(
!
archivalProfiles
.
length
&&
withoutProfile
!==
1
))
{
...
...
src/presentation/maarchRM/Resources/view/dashboard/mainScreen/descriptionForm.html
View file @
c0e2d7f5
...
...
@@ -781,7 +781,14 @@ input:invalid {
itemList
.
append
(
previous
);
},
addCustomField
:
function
(
source
=
""
,
target
=
$
(
"
#customFields
"
))
{
addCustomField
:
function
(
source
,
target
)
{
// to inititate default value and avoid bug on IE 11
if
(
source
===
undefined
)
{
source
=
""
;
}
if
(
target
===
undefined
)
{
target
=
$
(
"
#customFields
"
);
}
var
formGroup
=
$
(
'
<div class="form-group" />
'
);
var
label
=
$
(
'
<div class="col-md-3"/>
'
);
var
name
=
$
(
'
<input type="text" class="form-control input-sm name" />
'
);
...
...
src/presentation/maarchRM/Resources/view/dashboard/mainScreen/folder.html
View file @
c0e2d7f5
...
...
@@ -255,7 +255,15 @@
$
(
"
#folderToolbarSearch
"
).
data
(
"
orgregnumber
"
,
orgRegNumber
).
data
(
"
folderid
"
,
folderId
);
},
buildResultList
:
function
(
archives
,
options
=
null
,
showArchivePath
=
false
)
{
buildResultList
:
function
(
archives
,
options
,
showArchivePath
)
{
// to inititate default value and avoid bug on IE 11
if
(
options
===
undefined
)
{
options
=
null
;
}
if
(
showArchivePath
===
undefined
)
{
showArchivePath
=
false
;
}
trigger
(
"
clearDetail.recordsManagement
"
);
this
.
showArchivePath
=
showArchivePath
;
...
...
src/presentation/maarchRM/Resources/view/dashboard/mainScreen/search.html
View file @
c0e2d7f5
...
...
@@ -55,7 +55,21 @@
var
SearchTab
=
{
run
:
function
(
orgRegNumber
=
null
,
folderId
=
null
,
title
=
null
,
profiles
=
null
)
{
run
:
function
(
orgRegNumber
,
folderId
,
titre
,
profiles
)
{
// to inititate default value and avoid bug on IE 11
if
(
orgRegNumber
===
undefined
)
{
orgRegNumber
=
null
;
}
if
(
folderId
=
undefined
)
{
folderId
=
null
;
}
if
(
title
=
undefined
)
{
title
=
null
;
}
if
(
profiles
=
undefined
)
{
profiles
=
null
;
}
var
uniqId
=
new
Date
().
getUTCMilliseconds
();
this
.
tabCreation
(
uniqId
,
title
);
...
...
src/presentation/maarchRM/Resources/view/organization/archivalProfileAccess.html
View file @
c0e2d7f5
...
...
@@ -208,7 +208,11 @@
return
userAccesses
},
removeFromList
:
function
(
li
,
removeFromSelect
=
true
)
{
removeFromList
:
function
(
li
,
removeFromSelect
)
{
// to inititate default value and avoid bug on IE 11
if
(
removeFromSelect
===
undefined
)
{
removeFromSelect
=
true
;
}
if
(
removeFromSelect
)
{
$
(
'
#profileReference
'
).
val
(
''
).
find
(
'
option[value="
'
+
li
.
data
(
'
json
'
).
archivalProfileReference
+
'
"]
'
).
removeClass
(
'
hide
'
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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