Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
42d1af6c
Commit
42d1af6c
authored
10 months ago
by
Rasmus Fuhse
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Einrichtungsfilter zeigt falschen Wert bei "Einrichtung + Institute""
Closes #4051 Merge request
studip/studip!2947
parent
c4625179
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/admin/courses.php
+20
-1
20 additions, 1 deletion
app/controllers/admin/courses.php
with
20 additions
and
1 deletion
app/controllers/admin/courses.php
+
20
−
1
View file @
42d1af6c
...
...
@@ -322,6 +322,9 @@ class Admin_CoursesController extends AuthenticatedController
$institut_id
=
$configuration
->
MY_INSTITUTES_DEFAULT
&&
$configuration
->
MY_INSTITUTES_DEFAULT
!==
'all'
?
$configuration
->
MY_INSTITUTES_DEFAULT
:
null
;
if
(
$configuration
->
MY_INSTITUTES_INCLUDE_CHILDREN
)
{
$institut_id
.
=
'_withinst'
;
}
$filters
=
array_merge
(
array_merge
(
...
PluginEngine
::
sendMessage
(
AdminCourseWidgetPlugin
::
class
,
'getFilters'
)),
...
...
@@ -531,6 +534,14 @@ class Admin_CoursesController extends AuthenticatedController
'institut_id'
=>
'MY_INSTITUTES_DEFAULT'
,
];
$config
->
store
(
'MY_INSTITUTES_INCLUDE_CHILDREN'
,
str_contains
(
$filters
[
'institut_id'
],
'_'
)
?
1
:
0
);
if
(
$config
->
MY_INSTITUTES_INCLUDE_CHILDREN
)
{
$filters
[
'institut_id'
]
=
substr
(
$filters
[
'institut_id'
],
0
,
strpos
(
$filters
[
'institut_id'
],
'_'
));
}
foreach
(
$mapping
as
$key
=>
$field
)
{
if
(
isset
(
$filters
[
$key
]))
{
$config
->
store
(
$field
,
$filters
[
$key
]);
...
...
@@ -1522,6 +1533,7 @@ class Admin_CoursesController extends AuthenticatedController
$institut
[
'Institut_id'
],
(
!
$institut
[
'is_fak'
]
?
' '
:
''
)
.
$institut
[
'Name'
],
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
===
$institut
[
'Institut_id'
]
&&
!
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_INCLUDE_CHILDREN
);
//check if the institute is a faculty.
...
...
@@ -1534,7 +1546,8 @@ class Admin_CoursesController extends AuthenticatedController
new
SelectElement
(
$institut
[
'Institut_id'
]
.
'_withinst'
,
//_withinst = with institutes
' '
.
$institut
[
'Name'
]
.
' +'
.
_
(
'Institute'
),
(
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
===
$institut
[
'Institut_id'
]
&&
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_INCLUDE_CHILDREN
)
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
===
$institut
[
'Institut_id'
]
&&
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_INCLUDE_CHILDREN
);
}
}
...
...
@@ -1567,6 +1580,9 @@ class Admin_CoursesController extends AuthenticatedController
private
function
getStgteilSelector
(
$institut_id
=
null
)
{
$institut_id
=
$institut_id
?:
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
;
if
(
str_contains
(
$institut_id
,
'_'
))
{
$institut_id
=
substr
(
$institut_id
,
0
,
strpos
(
$institut_id
,
'_'
));
}
$stgteile
=
StudiengangTeil
::
getAllEnriched
(
'fach_name'
,
'ASC'
,
[
'mvv_fach_inst.institut_id'
=>
$institut_id
]);
$list
=
[];
if
(
!
$institut_id
||
$institut_id
===
'all'
)
{
...
...
@@ -1655,6 +1671,9 @@ class Admin_CoursesController extends AuthenticatedController
private
function
getTeacherWidget
(
$institut_id
=
null
)
{
$institut_id
=
$institut_id
?:
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
;
if
(
str_contains
(
$institut_id
,
'_'
))
{
$institut_id
=
substr
(
$institut_id
,
0
,
strpos
(
$institut_id
,
'_'
));
}
$teachers
=
DBManager
::
get
()
->
fetchAll
(
"
SELECT auth_user_md5.*, user_info.*
FROM auth_user_md5
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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