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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
51f44ced
Commit
51f44ced
authored
11 months ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fixes #4026
Closes #4026 Merge request
studip/studip!2881
parent
40d435ff
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/views/course/wizard/steps/studyareas/_assigned_node.php
+4
-4
4 additions, 4 deletions
app/views/course/wizard/steps/studyareas/_assigned_node.php
lib/models/Lvgruppe.php
+8
-4
8 additions, 4 deletions
lib/models/Lvgruppe.php
with
12 additions
and
8 deletions
app/views/course/wizard/steps/studyareas/_assigned_node.php
+
4
−
4
View file @
51f44ced
<li
class=
"sem-tree-assigned-
<?=
$element
[
'id'
]
?>
"
>
<?=
htmlReady
(
$element
[
'name'
])
?>
<?php
if
(
!
$values
[
'locked'
]
&&
$element
[
'assignable'
]
&&
in_array
(
$element
[
'id'
],
$studyareas
?:
[]))
:
?>
<?=
Icon
::
create
(
'trash'
,
'clickable'
)
->
asInput
([
"name"
=>
'unassign['
.
$element
[
'id'
]
.
']'
,
"onclick"
=>
"return STUDIP.CourseWizard.unassignNode('"
.
$element
[
'id'
]
.
"')"
])
?>
<input
type=
"hidden"
name=
"studyareas[]"
value=
"
<?=
$element
[
'id'
]
?>
"
/>
<?php
if
(
empty
(
$values
[
'locked'
]
)
&&
$element
[
'assignable'
]
&&
in_array
(
$element
[
'id'
],
$studyareas
?:
[]))
:
?>
<?=
Icon
::
create
(
'trash'
)
->
asInput
([
"name"
=>
'unassign['
.
$element
[
'id'
]
.
']'
,
"onclick"
=>
"return STUDIP.CourseWizard.unassignNode('"
.
$element
[
'id'
]
.
"')"
])
?>
<input
type=
"hidden"
name=
"studyareas[]"
value=
"
<?=
htmlReady
(
$element
[
'id'
]
)
?>
"
/>
<?php
endif
?>
<ul>
<?php
foreach
(
$element
[
'children'
]
as
$c
)
:
?>
<?=
$this
->
render_partial
(
'studyareas/_assigned_node'
,
[
'element'
=>
$c
])
?>
<?php
endforeach
?>
</ul>
</li>
\ No newline at end of file
</li>
This diff is collapsed.
Click to expand it.
lib/models/Lvgruppe.php
+
8
−
4
View file @
51f44ced
...
...
@@ -232,7 +232,7 @@ class Lvgruppe extends ModuleManagementModelTreeItem
*
* @param string $term The search term.
* @param array|string $filter An array with filter options or a where part.
* @return
object
A SimpleORMapCollection of LV-Gruppen.
* @return
SimpleORMapCollection
A SimpleORMapCollection of LV-Gruppen.
*/
public
static
function
findBySearchTerm
(
$term
,
$filter
=
null
)
{
...
...
@@ -271,7 +271,7 @@ class Lvgruppe extends ModuleManagementModelTreeItem
* Retrieves all LV-Gruppen related to the Modulteil with given id.
*
* @param string $modulteil_id The id of a Modulteil.
* @return
object
A SimpleORMapCollection of LV-Gruppen.
* @return
SimpleORMapCollection
A SimpleORMapCollection of LV-Gruppen.
*/
public
static
function
findByModulteil
(
$modulteil_id
)
{
...
...
@@ -286,7 +286,7 @@ class Lvgruppe extends ModuleManagementModelTreeItem
* Retrieves all LV-Gruppen related to the course with given id.
*
* @param string $seminar_id The id of a course.
* @return
object
A SimpleORMapCollection of LV-Gruppen.
* @return
SimpleORMapCollection
A SimpleORMapCollection of LV-Gruppen.
*/
public
static
function
findBySeminar
(
$seminar_id
)
{
...
...
@@ -339,7 +339,7 @@ class Lvgruppe extends ModuleManagementModelTreeItem
/**
* Assigns the given course to the given LvGruppen.
*
* @param
array
Array of ids
* @param
string $seminar_id
Array of ids
* @return int The number of assigned LvGruppen.
*/
public
static
function
setLvgruppen
(
$seminar_id
,
$lvgruppen_ids
)
...
...
@@ -347,9 +347,13 @@ class Lvgruppe extends ModuleManagementModelTreeItem
$old
=
Lvgruppe
::
findBySeminar
(
$seminar_id
);
$removed
=
array_diff
(
$old
->
pluck
(
'id'
),
$lvgruppen_ids
);
$added
=
array_diff
(
$lvgruppen_ids
,
$old
->
pluck
(
'id'
));
$count_removed
=
0
;
foreach
(
$removed
as
$one
)
{
$count_removed
+=
$old
->
findOneBy
(
'id'
,
$one
)
->
removeSeminar
(
$seminar_id
);
}
$count_added
=
0
;
foreach
(
$added
as
$one
)
{
$count_added
+=
Lvgruppe
::
get
(
$one
)
->
addSeminar
(
$seminar_id
);
}
...
...
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