Verified Commit 4c29fac7 authored by dockx thibault's avatar dockx thibault
Browse files

:ambulance: Feat(CORE) - code style fixes

General code style fixes
Showing with 15 additions and 15 deletions
+15 -15
...@@ -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,
]; ];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment