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
04b5e6ec
Commit
04b5e6ec
authored
2 years ago
by
André Noack
Committed by
David Siegfried
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve #962 Checkboxen funktionieren nicht richtig in Profil->Einstellungen->Benachrichtigung
Closes #962 Merge request
studip/studip!585
parent
7db0d91a
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/controllers/settings/notification.php
+3
-18
3 additions, 18 deletions
app/controllers/settings/notification.php
app/views/settings/notification.php
+7
-6
7 additions, 6 deletions
app/views/settings/notification.php
with
10 additions
and
24 deletions
app/controllers/settings/notification.php
+
3
−
18
View file @
04b5e6ec
...
@@ -53,28 +53,17 @@ class Settings_NotificationController extends Settings_SettingsController
...
@@ -53,28 +53,17 @@ class Settings_NotificationController extends Settings_SettingsController
{
{
$group_field
=
'sem_number'
;
$group_field
=
'sem_number'
;
$add_fields
=
$add_query
=
''
;
if
(
$group_field
==
'sem_tree_id'
)
{
$add_fields
=
',sem_tree_id'
;
$add_query
=
"LEFT JOIN seminar_sem_tree sst ON (sst.seminar_id=seminare.Seminar_id)"
;
}
else
if
(
$group_field
==
'dozent_id'
)
{
$add_fields
=
', su1.user_id as dozent_id'
;
$add_query
=
"LEFT JOIN seminar_user as su1 ON (su1.seminar_id=seminare.Seminar_id AND su1.status='dozent')"
;
}
$dbv
=
DbView
::
getView
(
'sem_tree'
);
$dbv
=
DbView
::
getView
(
'sem_tree'
);
$query
=
"SELECT seminare.VeranstaltungsNummer AS sem_nr, seminare.Name, seminare.Seminar_id,
$query
=
"SELECT seminare.VeranstaltungsNummer AS sem_nr, seminare.Name, seminare.Seminar_id,
seminare.status AS sem_status, seminar_user.gruppe, seminare.visible,
seminare.status AS sem_status, seminar_user.gruppe, seminare.visible,
{
$dbv
->
sem_number_sql
}
AS sem_number,
{
$dbv
->
sem_number_end_sql
}
AS sem_number_end
{
$dbv
->
sem_number_sql
}
AS sem_number,
{
$dbv
->
sem_number_end_sql
}
AS sem_number_end
{
$add_fields
}
FROM seminar_user
FROM seminar_user
LEFT JOIN seminare USING (Seminar_id)
LEFT JOIN seminare USING (Seminar_id)
{
$add_query
}
WHERE seminar_user.user_id = ?"
;
WHERE seminar_user.user_id = ?"
;
if
(
Config
::
get
()
->
DEPUTIES_ENABLE
)
{
if
(
Config
::
get
()
->
DEPUTIES_ENABLE
)
{
$query
.
=
" UNION "
.
Deputy
::
getMySeminarsQuery
(
$query
.
=
" UNION "
.
Deputy
::
getMySeminarsQuery
(
'notification'
,
$dbv
->
sem_number_sql
,
$dbv
->
sem_number_end_sql
,
$add_fields
,
$add_query
'notification'
,
$dbv
->
sem_number_sql
,
$dbv
->
sem_number_end_sql
,
''
,
''
);
);
}
}
$query
.
=
" ORDER BY sem_nr ASC"
;
$query
.
=
" ORDER BY sem_nr ASC"
;
...
@@ -116,11 +105,7 @@ class Settings_NotificationController extends Settings_SettingsController
...
@@ -116,11 +105,7 @@ class Settings_NotificationController extends Settings_SettingsController
}
}
}
}
if
(
$group_field
==
'sem_number'
)
{
correct_group_sem_number
(
$groups
,
$my_sem
);
correct_group_sem_number
(
$groups
,
$my_sem
);
}
else
{
add_sem_name
(
$my_sem
);
}
sort_groups
(
$group_field
,
$groups
);
sort_groups
(
$group_field
,
$groups
);
...
@@ -129,7 +114,7 @@ class Settings_NotificationController extends Settings_SettingsController
...
@@ -129,7 +114,7 @@ class Settings_NotificationController extends Settings_SettingsController
$open
=
UserConfig
::
get
(
$this
->
user
->
user_id
)
->
MY_COURSES_OPEN_GROUPS
;
$open
=
UserConfig
::
get
(
$this
->
user
->
user_id
)
->
MY_COURSES_OPEN_GROUPS
;
$checked
=
[];
$checked
=
[];
foreach
(
$groups
as
$group_id
=>
$group_members
)
{
foreach
(
$groups
as
$group_id
=>
$group_members
)
{
if
(
$group_id
!==
'not_grouped'
&&
!
isset
(
$open
[
$group_id
]
))
{
if
(
!
in_array
(
$group_id
,
$open
))
{
continue
;
continue
;
}
}
foreach
(
$group_members
as
$member
)
{
foreach
(
$group_members
as
$member
)
{
...
...
This diff is collapsed.
Click to expand it.
app/views/settings/notification.php
+
7
−
6
View file @
04b5e6ec
...
@@ -26,12 +26,13 @@
...
@@ -26,12 +26,13 @@
<td
colspan=
"2"
>
<td
colspan=
"2"
>
<?=
_
(
'Benachrichtigung für unten aufgeführte Veranstaltungen:'
)
?>
<?=
_
(
'Benachrichtigung für unten aufgeführte Veranstaltungen:'
)
?>
</td>
</td>
<?
for
(
$i
=
0
;
$i
<
count
(
$modules
);
$i
+=
1
)
:
?>
<?
$i
=
0
;
?>
<?
foreach
(
$modules
as
$index
=>
$data
)
:
?>
<td>
<td>
<input
type=
"checkbox"
name=
"all[columns][]"
value=
"
<?=
$i
?>
"
<input
type=
"checkbox"
name=
"all[columns][]"
value=
"
<?=
$i
++
?>
"
<?
if
(
!
empty
(
$checked
)
&&
count
(
array_filter
(
$checked
,
function
(
$item
)
use
(
$i
)
{
return
$item
[
$i
];
}))
==
count
(
$checked
))
echo
'checked'
;
?>
>
<?
if
(
!
empty
(
$checked
)
&&
count
(
array_filter
(
$checked
,
function
(
$item
)
use
(
$i
ndex
)
{
return
$item
[
$i
ndex
];
}))
==
count
(
$checked
))
echo
'checked'
;
?>
>
</td>
</td>
<?
endfor
;
?>
<?
endfor
each
;
?>
<td>
<td>
<input
type=
"checkbox"
name=
"all[all]"
value=
"all"
<input
type=
"checkbox"
name=
"all[all]"
value=
"all"
<?
if
(
!
empty
(
$checked
)
&&
count
(
array_filter
(
$checked
,
function
(
$item
)
{
return
$item
[
'all'
];
}))
==
count
(
$checked
))
echo
'checked'
;
?>
>
<?
if
(
!
empty
(
$checked
)
&&
count
(
array_filter
(
$checked
,
function
(
$item
)
{
return
$item
[
'all'
];
}))
==
count
(
$checked
))
echo
'checked'
;
?>
>
...
@@ -44,7 +45,7 @@
...
@@ -44,7 +45,7 @@
<?
if
(
$group_field
!==
'not_grouped'
)
:
?>
<?
if
(
$group_field
!==
'not_grouped'
)
:
?>
<tr>
<tr>
<th
colspan=
"
<?=
3
+
count
(
$modules
)
?>
"
>
<th
colspan=
"
<?=
3
+
count
(
$modules
)
?>
"
>
<?
if
(
i
sset
(
$open
[
$id
]
))
:
?>
<?
if
(
i
n_array
(
$id
,
$open
))
:
?>
<a
class=
"tree"
style=
"font-weight:bold"
name=
"
<?=
$id
?>
"
<a
class=
"tree"
style=
"font-weight:bold"
name=
"
<?=
$id
?>
"
href=
"
<?=
$controller
->
url_for
(
'settings/notification/close'
,
$id
)
?>
#
<?=
$id
?>
"
href=
"
<?=
$controller
->
url_for
(
'settings/notification/close'
,
$id
)
?>
#
<?=
$id
?>
"
<?=
tooltip
(
_
(
'Gruppierung schließen'
),
true
)
?>
>
<?=
tooltip
(
_
(
'Gruppierung schließen'
),
true
)
?>
>
...
@@ -60,7 +61,7 @@
...
@@ -60,7 +61,7 @@
</th>
</th>
</tr>
</tr>
<?
endif
;
?>
<?
endif
;
?>
<?
if
(
$id
===
'not_grouped'
||
i
sset
(
$open
[
$id
]
))
:
?>
<?
if
(
$id
===
'not_grouped'
||
i
n_array
(
$id
,
$open
))
:
?>
<?
foreach
(
$members
as
$member
)
:
?>
<?
foreach
(
$members
as
$member
)
:
?>
<tr>
<tr>
<td
class=
"gruppe
<?=
$seminars
[
$member
[
'seminar_id'
]][
'gruppe'
]
?>
"
>
</td>
<td
class=
"gruppe
<?=
$seminars
[
$member
[
'seminar_id'
]][
'gruppe'
]
?>
"
>
</td>
...
...
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