Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory
Commits
4c29fac7
Verified
Commit
4c29fac7
authored
1 year ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
Feat(CORE) - code style fixes
General code style fixes
parent
caf23e0c
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/configuration/tasks/class_tasksLifeCycle.inc
+15
-15
plugins/configuration/tasks/class_tasksLifeCycle.inc
with
15 additions
and
15 deletions
+15
-15
plugins/configuration/tasks/class_tasksLifeCycle.inc
+
15
−
15
View file @
4c29fac7
...
@@ -46,7 +46,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -46,7 +46,7 @@ class tasksLifeCycle extends simplePlugin
static
function
getAttributesInfo
():
array
static
function
getAttributesInfo
():
array
{
{
return
[
return
[
'section1'
=>
[
'section1'
=>
[
'class'
=>
[
'fullwidth'
,
'information'
],
'class'
=>
[
'fullwidth'
,
'information'
],
'name'
=>
_
(
'We recommend the task redundancy to be set to daily, and the case “new members only” to be unpicked'
),
'name'
=>
_
(
'We recommend the task redundancy to be set to daily, and the case “new members only” to be unpicked'
),
'attrs'
=>
[
'attrs'
=>
[
...
@@ -58,7 +58,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -58,7 +58,7 @@ class tasksLifeCycle extends simplePlugin
new
HiddenArrayAttribute
(
'fdTasksLifeCycleListOfDN'
,
FALSE
,
''
),
new
HiddenArrayAttribute
(
'fdTasksLifeCycleListOfDN'
,
FALSE
,
''
),
]
]
],
],
'section3'
=>
[
'section3'
=>
[
'name'
=>
_
(
'Post resources details'
),
'name'
=>
_
(
'Post resources details'
),
'attrs'
=>
[
'attrs'
=>
[
new
SelectAttribute
(
new
SelectAttribute
(
...
@@ -80,7 +80,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -80,7 +80,7 @@ class tasksLifeCycle extends simplePlugin
]
]
],
],
// Attributes are grouped by section
// Attributes are grouped by section
'section2'
=>
[
'section2'
=>
[
'name'
=>
_
(
'Pre / existing resources details'
),
'name'
=>
_
(
'Pre / existing resources details'
),
'attrs'
=>
[
'attrs'
=>
[
new
SelectAttribute
(
new
SelectAttribute
(
...
@@ -98,7 +98,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -98,7 +98,7 @@ class tasksLifeCycle extends simplePlugin
]
]
],
],
'UserGroupSelection'
=>
[
'UserGroupSelection'
=>
[
'name'
=>
_
(
'Recipients Users and/or Groups'
),
'name'
=>
_
(
'Recipients Users and/or Groups'
),
'class'
=>
[
'fullwidth'
],
'class'
=>
[
'fullwidth'
],
'attrs'
=>
[
'attrs'
=>
[
new
UsersGroupsRolesAttribute
(
new
UsersGroupsRolesAttribute
(
...
@@ -123,15 +123,15 @@ class tasksLifeCycle extends simplePlugin
...
@@ -123,15 +123,15 @@ class tasksLifeCycle extends simplePlugin
/*
/*
* Set attributes values with defined supann states from configuration
* Set attributes values with defined supann states from configuration
*/
*/
protected
function
setSupannStates
()
:
void
protected
function
setSupannStates
():
void
{
{
global
$config
;
global
$config
;
// Define the mandatory ones and get the remaining from configuration.
// Define the mandatory ones and get the remaining from configuration.
$resources
=
[
'COMPTE'
=>
_
(
'Account'
),
'MAIL'
=>
_
(
'Mail'
)];
$resources
=
[
'COMPTE'
=>
_
(
'Account'
),
'MAIL'
=>
_
(
'Mail'
)];
foreach
(
$config
->
get_cfg_value
(
'SupannRessourceLabels'
,
[])
as
$line
)
{
foreach
(
$config
->
get_cfg_value
(
'SupannRessourceLabels'
,
[])
as
$line
)
{
list
(
$resource
,
$label
)
=
explode
(
':'
,
$line
,
2
);
list
(
$resource
,
$label
)
=
explode
(
':'
,
$line
,
2
);
$resources
[
$resource
]
=
$label
;
$resources
[
$resource
]
=
$label
;
}
}
...
@@ -164,7 +164,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -164,7 +164,7 @@ class tasksLifeCycle extends simplePlugin
/*
/*
* Retrieve all the DNs from groups or members
* Retrieve all the DNs from groups or members
*/
*/
public
function
getListOfDN
()
:
void
public
function
getListOfDN
():
void
{
{
global
$config
;
global
$config
;
$ldap
=
$config
->
get_ldap_link
();
$ldap
=
$config
->
get_ldap_link
();
...
@@ -181,7 +181,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -181,7 +181,7 @@ class tasksLifeCycle extends simplePlugin
// Position ldap to the dn required (limit search).
// Position ldap to the dn required (limit search).
$ldap
->
cd
(
$group
);
$ldap
->
cd
(
$group
);
$filter
=
'(|(objectClass=groupOfUrls)(objectClass=groupOfNames))'
;
$filter
=
'(|(objectClass=groupOfUrls)(objectClass=groupOfNames))'
;
$attrs
=
[
'member'
];
$attrs
=
[
'member'
];
$ldap
->
search
(
$filter
,
$attrs
);
$ldap
->
search
(
$filter
,
$attrs
);
$info
=
$ldap
->
fetch
();
$info
=
$ldap
->
fetch
();
...
@@ -225,7 +225,7 @@ class tasksLifeCycle extends simplePlugin
...
@@ -225,7 +225,7 @@ class tasksLifeCycle extends simplePlugin
// Condition allowing the creation of subtasks for existing members
// Condition allowing the creation of subtasks for existing members
if
(
$newMemberOnly
===
TRUE
)
{
if
(
$newMemberOnly
===
TRUE
)
{
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$filter
=
'(&(objectClass=fdTasksGranular)(fdTasksGranularMaster='
.
$this
->
dn
.
'))'
;
$filter
=
'(&(objectClass=fdTasksGranular)(fdTasksGranularMaster='
.
$this
->
dn
.
'))'
;
$attrs
=
[
'fdTasksLifeCycle'
];
$attrs
=
[
'fdTasksLifeCycle'
];
$ldap
->
search
(
$filter
,
$attrs
);
$ldap
->
search
(
$filter
,
$attrs
);
...
@@ -256,16 +256,16 @@ class tasksLifeCycle extends simplePlugin
...
@@ -256,16 +256,16 @@ class tasksLifeCycle extends simplePlugin
// Create a unique ID based on timestamp (Allowing duplicate subtasks for same members in case of repeat).
// Create a unique ID based on timestamp (Allowing duplicate subtasks for same members in case of repeat).
$timestamp
=
microtime
(
TRUE
);
// Get the current timestamp with microseconds
$timestamp
=
microtime
(
TRUE
);
// Get the current timestamp with microseconds
$timestamp
=
(
string
)
$timestamp
;
// Convert the float to a string, str_replace expect array or string.
$timestamp
=
(
string
)
$timestamp
;
// Convert the float to a string, str_replace expect array or string.
$uniqueID
=
str_replace
(
"."
,
"_"
,
$timestamp
);
// Remove . with _ for correct CN
$uniqueID
=
str_replace
(
"."
,
"_"
,
$timestamp
);
// Remove . with _ for correct CN
// Array matches come from preg_match function above with rmDn
// Array matches come from preg_match function above with rmDn
$subTaskName
=
$matches
[
1
]
.
'-SubTask-'
.
$uniqueID
;
$subTaskName
=
$matches
[
1
]
.
'-SubTask-'
.
$uniqueID
;
$values
[
'tasksGranular'
]
=
[
$values
[
'tasksGranular'
]
=
[
"cn"
=>
$subTaskName
,
"cn"
=>
$subTaskName
,
"fdTasksGranularType"
=>
'Life Cycle'
,
"fdTasksGranularType"
=>
'Life Cycle'
,
"fdTasksGranularMaster"
=>
$this
->
dn
,
"fdTasksGranularMaster"
=>
$this
->
dn
,
"fdTasksGranularDN"
=>
$dn
,
"fdTasksGranularDN"
=>
$dn
,
"fdTasksGranularSchedule"
=>
$schedule
,
"fdTasksGranularSchedule"
=>
$schedule
,
];
];
...
...
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets