Skip to content

Commit 3a2bd1a

Browse files
committed
Merge branch 'develop'
2 parents 409dbd5 + dec6da5 commit 3a2bd1a

File tree

17 files changed

+374
-96
lines changed

17 files changed

+374
-96
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# ITStyr CHANGELOG
22

3-
## in develop
3+
## 1.4.0
4+
5+
* Added sub owner filter.
6+
* Added extraction of sub owner for sysOwner field.
47

58
## 1.3.2
69

config/packages/easy_admin.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,23 @@ easy_admin:
140140
fields:
141141
- { property: 'id', label: 'entity.report.id' }
142142
- { property: 'showable_name', label: 'entity.report.sys_title' }
143-
- { property: 'responsible', label: 'entity.report.responsible' }
144-
- { property: 'sys_owner', label: 'entity.report.sys_owner' }
145143
- { property: 'group', label: 'entity.report.group', type: 'text' }
144+
- { property: 'sys_owner_sub', label: 'entity.report.sys_owner_sub' }
145+
- { property: 'responsible', label: 'entity.report.responsible' }
146146
- { property: 'sys_id_as_link', label: 'entity.report.sys_id_as_link', type: 'file' }
147147
- { property: 'theme', label: 'entity.report.theme', type: 'text' }
148148
- { property: 'text_set', label: 'entity.report.text', type: 'boolean' }
149149
sort: ['id', 'ASC']
150150
dql_filter: entity.sysStatus = 'Aktiv'
151151
filters:
152152
-
153-
property: group
154-
type: entity
153+
property: group
154+
type: entity
155+
-
156+
property: sysOwnerSub
157+
type: choice
158+
extract_from_property: sysOwnerSub
159+
parent_filter: group
155160
show:
156161
fields:
157162
- { property: 'name', label: 'entity.report.name' }
@@ -245,17 +250,22 @@ easy_admin:
245250
fields:
246251
- { property: 'id', label: 'entity.system.id' }
247252
- { property: 'showable_name', label: 'entity.system.sys_title' }
248-
- { property: 'responsible', label: 'entity.system.responsible' }
249-
- { property: 'sys_owner', label: 'entity.system.sys_owner' }
250253
- { property: 'group', label: 'entity.system.group', type: 'text' }
254+
- { property: 'sys_owner_sub', label: 'entity.system.sys_owner_sub' }
255+
- { property: 'responsible', label: 'entity.system.responsible' }
251256
- { property: 'sys_id_as_link', label: 'entity.system.sys_id_as_link', type: 'file' }
252257
- { property: 'theme', label: 'entity.system.theme', type: 'text' }
253258
- { property: 'text_set', label: 'entity.system.text', type: 'boolean' }
254259
sort: ['id', 'ASC']
255260
filters:
256261
-
257-
property: group
258-
type: entity
262+
property: group
263+
type: entity
264+
-
265+
property: sysOwnerSub
266+
type: choice
267+
extract_from_property: sysOwnerSub
268+
parent_filter: group
259269
show:
260270
fields:
261271
- { property: 'name', label: 'entity.system.name' }

public/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
overflow: auto;
33
}
44

5+
.header-icon {
6+
font-size: 2.5em;
7+
}
8+
59
.field-smiley--title-hover {
610
cursor: default;
711
}

src/Command/AssignGroupsCommand.php

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,32 @@ protected function configure()
4141

4242
protected function execute(InputInterface $input, OutputInterface $output)
4343
{
44-
$reports = $this->reportRepository->findBy(['group' => null]);
45-
$systems = $this->systemRepository->findBy(['group' => null]);
44+
$reports = $this->reportRepository->findAll();
45+
$systems = $this->systemRepository->findAll();
4646

4747
foreach ($reports as $report) {
4848
if (!is_null($report->getSysOwner())) {
49-
$e = str_replace(' ', '', $report->getSysOwner());
49+
$e = $report->getSysOwner();
5050
$e = str_replace('', '-', $e);
51-
$extract = explode('-', $e);
52-
$groupName = $extract[0];
51+
$extract = explode('-', $e, 2);
52+
$groupName = trim($extract[0]);
53+
54+
$subGroupName = trim($extract[1]);
5355

5456
$findGroup = $this->groupRepository->findOneBy(
5557
['name' => $groupName]
5658
);
5759

5860
if ($findGroup) {
59-
$report->setGroup($findGroup);
60-
$output->writeln($report->getName()." set group ".$groupName);
61+
if (is_null($report->getGroup())) {
62+
$report->setGroup($findGroup);
63+
}
64+
65+
if (is_null($report->getSysOwnerSub())) {
66+
$report->setSysOwnerSub($subGroupName);
67+
}
68+
69+
$output->writeln('"'.$report->getName().'" set group "'.$groupName.'" and subGroup: "'.$subGroupName.'"');
6170
}
6271
else {
6372
$output->writeln($groupName . " not found, ignored.");
@@ -71,18 +80,27 @@ protected function execute(InputInterface $input, OutputInterface $output)
7180

7281
foreach ($systems as $system) {
7382
if (!is_null($system->getSysOwner())) {
74-
$e = str_replace(' ', '', $system->getSysOwner());
83+
$e = $system->getSysOwner();
7584
$e = str_replace('', '-', $e);
76-
$extract = explode('-', $e);
77-
$groupName = $extract[0];
85+
$extract = explode('-', $e, 2);
86+
$groupName = trim($extract[0]);
87+
88+
$subGroupName = trim($extract[1]);
7889

7990
$findGroup = $this->groupRepository->findOneBy(
8091
['name' => $groupName]
8192
);
8293

8394
if ($findGroup) {
84-
$system->setGroup($findGroup);
85-
$output->writeln($system->getName()." set group ".$groupName);
95+
if (is_null($system->getGroup())) {
96+
$system->setGroup($findGroup);
97+
}
98+
99+
if (is_null($system->getSysOwnerSub())) {
100+
$system->setSysOwnerSub($subGroupName);
101+
}
102+
103+
$output->writeln('"'.$system->getName().'" set group "'.$groupName.'" and subGroup: "'.$subGroupName.'"');
86104
}
87105
else {
88106
$output->writeln($groupName . " not found, ignored.");

0 commit comments

Comments
 (0)