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
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Model registry
Analyze
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
Uni Osnabrück
Stud.IP
Commits
83f7b36c
Commit
83f7b36c
authored
2 years ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
prevent php8 warnings (seventh batch of changes), re #2193
Merge request
studip/studip!1431
parent
057418dd
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/basicdata/index.php
+9
-9
9 additions, 9 deletions
app/views/course/wizard/steps/basicdata/index.php
lib/classes/coursewizardsteps/BasicDataWizardStep.php
+23
-10
23 additions, 10 deletions
lib/classes/coursewizardsteps/BasicDataWizardStep.php
with
32 additions
and
19 deletions
app/views/course/wizard/steps/basicdata/index.php
+
9
−
9
View file @
83f7b36c
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<?=
$course_number_format_config
[
'comment'
]
?
tooltipIcon
(
$course_number_format_config
[
'comment'
])
:
''
?>
<?=
$course_number_format_config
[
'comment'
]
?
tooltipIcon
(
$course_number_format_config
[
'comment'
])
:
''
?>
</label>
</label>
<?
$course_number_format
=
Config
::
get
()
->
COURSE_NUMBER_FORMAT
;
?>
<?
$course_number_format
=
Config
::
get
()
->
COURSE_NUMBER_FORMAT
;
?>
<input
type=
"text"
name=
"number"
id=
"wizard-number"
size=
"20"
maxlength=
"99"
value=
"
<?=
htmlReady
(
$values
[
'number'
])
?>
"
<input
type=
"text"
name=
"number"
id=
"wizard-number"
size=
"20"
maxlength=
"99"
value=
"
<?=
htmlReady
(
$values
[
'number'
]
??
''
)
?>
"
<?
if
(
$course_number_format
)
:
?>
pattern=
"
<?=
htmlReady
(
$course_number_format
)
?>
"
<?
endif
?>
/>
<?
if
(
$course_number_format
)
:
?>
pattern=
"
<?=
htmlReady
(
$course_number_format
)
?>
"
<?
endif
?>
/>
</section>
</section>
<section>
<section>
...
@@ -80,8 +80,8 @@
...
@@ -80,8 +80,8 @@
<div
id=
"wizard-instsearch"
>
<div
id=
"wizard-instsearch"
>
<?=
$instsearch
?>
<?=
$instsearch
?>
</div>
</div>
<?php
if
(
$values
[
'part_inst_id_parameter'
])
:
?>
<?php
if
(
!
empty
(
$values
[
'part_inst_id_parameter'
])
)
:
?>
<?=
Icon
::
create
(
'arr_2down'
,
'sort'
)
->
asInput
([
"name"
=>
'add_part_inst'
,
"value"
=>
'1'
])
?>
<?=
Icon
::
create
(
'arr_2down'
,
Icon
::
ROLE_SORT
)
->
asInput
([
"name"
=>
'add_part_inst'
,
"value"
=>
'1'
])
?>
<?php
endif
?>
<?php
endif
?>
</section>
</section>
<section>
<section>
...
@@ -105,8 +105,8 @@
...
@@ -105,8 +105,8 @@
<div
id=
"wizard-lecturersearch"
>
<div
id=
"wizard-lecturersearch"
>
<?=
$lsearch
?>
<?=
$lsearch
?>
</div>
</div>
<?php
if
(
$values
[
'lecturer_id_parameter'
])
:
?>
<?php
if
(
!
empty
(
$values
[
'lecturer_id_parameter'
])
)
:
?>
<?=
Icon
::
create
(
'arr_2down'
,
'sort'
)
->
asInput
([
"name"
=>
'add_lecturer'
,
"value"
=>
'1'
])
?>
<?=
Icon
::
create
(
'arr_2down'
,
Icon
::
ROLE_SORT
)
->
asInput
([
"name"
=>
'add_lecturer'
,
"value"
=>
'1'
])
?>
<?php
endif
?>
<?php
endif
?>
</section>
</section>
<section>
<section>
...
@@ -131,8 +131,8 @@
...
@@ -131,8 +131,8 @@
<div
id=
"wizard-deputysearch"
>
<div
id=
"wizard-deputysearch"
>
<?=
$dsearch
?>
<?=
$dsearch
?>
</div>
</div>
<?php
if
(
$values
[
'deputy_id_parameter'
])
:
?>
<?php
if
(
!
empty
(
$values
[
'deputy_id_parameter'
])
)
:
?>
<?=
Icon
::
create
(
'arr_2down'
,
'sort'
)
->
asInput
([
"name"
=>
'add_deputy'
,
"value"
=>
'1'
])
?>
<?=
Icon
::
create
(
'arr_2down'
,
Icon
::
ROLE_SORT
)
->
asInput
([
"name"
=>
'add_deputy'
,
"value"
=>
'1'
])
?>
<?php
endif
?>
<?php
endif
?>
</section>
</section>
<section>
<section>
...
@@ -159,8 +159,8 @@
...
@@ -159,8 +159,8 @@
<div
id=
"wizard-tutorsearch"
>
<div
id=
"wizard-tutorsearch"
>
<?=
$tsearch
?>
<?=
$tsearch
?>
</div>
</div>
<?php
if
(
$values
[
'tutor_id_parameter'
])
:
?>
<?php
if
(
!
empty
(
$values
[
'tutor_id_parameter'
])
)
:
?>
<?=
Icon
::
create
(
'arr_2down'
,
'sort'
)
->
asInput
([
"name"
=>
'add_tutor'
,
"value"
=>
'1'
])
?>
<?=
Icon
::
create
(
'arr_2down'
,
Icon
::
ROLE_SORT
)
->
asInput
([
"name"
=>
'add_tutor'
,
"value"
=>
'1'
])
?>
<?php
endif
?>
<?php
endif
?>
</section>
</section>
...
...
This diff is collapsed.
Click to expand it.
lib/classes/coursewizardsteps/BasicDataWizardStep.php
+
23
−
10
View file @
83f7b36c
...
@@ -82,8 +82,11 @@ class BasicDataWizardStep implements CourseWizardStep
...
@@ -82,8 +82,11 @@ class BasicDataWizardStep implements CourseWizardStep
foreach
(
Semester
::
getAll
()
as
$s
)
{
foreach
(
Semester
::
getAll
()
as
$s
)
{
if
(
$s
->
ende
>=
$now
)
{
if
(
$s
->
ende
>=
$now
)
{
if
(
$GLOBALS
[
'perm'
]
->
have_perm
(
"admin"
))
{
if
(
$GLOBALS
[
'perm'
]
->
have_perm
(
"admin"
))
{
if
(
$s
->
id
==
$GLOBALS
[
'user'
]
->
cfg
->
MY_COURSES_SELECTED_CYCLE
&&
if
(
!
$values
[
'start_time'
]
&&
Request
::
isXhr
())
{
$s
->
id
==
$GLOBALS
[
'user'
]
->
cfg
->
MY_COURSES_SELECTED_CYCLE
&&
empty
(
$values
[
'start_time'
])
&&
Request
::
isXhr
()
)
{
$values
[
'start_time'
]
=
$s
->
beginn
;
$values
[
'start_time'
]
=
$s
->
beginn
;
}
}
}
}
...
@@ -93,7 +96,7 @@ class BasicDataWizardStep implements CourseWizardStep
...
@@ -93,7 +96,7 @@ class BasicDataWizardStep implements CourseWizardStep
if
(
empty
(
$values
[
'start_time'
]))
{
if
(
empty
(
$values
[
'start_time'
]))
{
$values
[
'start_time'
]
=
Semester
::
findDefault
()
->
beginn
;
$values
[
'start_time'
]
=
Semester
::
findDefault
()
->
beginn
;
}
}
if
(
$values
[
'studygroup'
]
&&
(
!
count
(
$typestruct
)
||
!
$values
[
'institute'
])
)
{
if
(
!
empty
(
$values
[
'studygroup'
]
)
&&
(
!
count
(
$typestruct
)
||
empty
(
$values
[
'institute'
])
)
)
{
$message
=
sprintf
(
_
(
'Die Konfiguration der Studiengruppen ist unvollständig. '
.
$message
=
sprintf
(
_
(
'Die Konfiguration der Studiengruppen ist unvollständig. '
.
'Bitte wenden Sie sich an [die Stud.IP-Administration]%s .'
),
'Bitte wenden Sie sich an [die Stud.IP-Administration]%s .'
),
URLHelper
::
getLink
(
'dispatch.php/siteinfo/show'
)
URLHelper
::
getLink
(
'dispatch.php/siteinfo/show'
)
...
@@ -104,7 +107,7 @@ class BasicDataWizardStep implements CourseWizardStep
...
@@ -104,7 +107,7 @@ class BasicDataWizardStep implements CourseWizardStep
if
(
count
(
$semesters
)
>
0
)
{
if
(
count
(
$semesters
)
>
0
)
{
$tpl
->
set_attribute
(
'semesters'
,
array_reverse
(
$semesters
));
$tpl
->
set_attribute
(
'semesters'
,
array_reverse
(
$semesters
));
// If no semester is set, use current as selected default.
// If no semester is set, use current as selected default.
if
(
!
$values
[
'start_time'
])
{
if
(
empty
(
$values
[
'start_time'
])
)
{
$values
[
'start_time'
]
=
Semester
::
findCurrent
()
->
beginn
;
$values
[
'start_time'
]
=
Semester
::
findCurrent
()
->
beginn
;
}
}
}
else
{
}
else
{
...
@@ -125,7 +128,7 @@ class BasicDataWizardStep implements CourseWizardStep
...
@@ -125,7 +128,7 @@ class BasicDataWizardStep implements CourseWizardStep
$institutes
=
Institute
::
getMyInstitutes
();
$institutes
=
Institute
::
getMyInstitutes
();
if
(
!
empty
(
$values
[
'studygroup'
])
||
count
(
$institutes
)
>
0
)
{
if
(
!
empty
(
$values
[
'studygroup'
])
||
count
(
$institutes
)
>
0
)
{
$tpl
->
set_attribute
(
'institutes'
,
$institutes
);
$tpl
->
set_attribute
(
'institutes'
,
$institutes
);
if
(
!
$values
[
'institute'
])
{
if
(
empty
(
$values
[
'institute'
])
)
{
if
(
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
&&
Request
::
isXhr
())
{
if
(
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
&&
Request
::
isXhr
())
{
$values
[
'institute'
]
=
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
;
$values
[
'institute'
]
=
$GLOBALS
[
'user'
]
->
cfg
->
MY_INSTITUTES_DEFAULT
;
}
else
{
}
else
{
...
@@ -185,7 +188,11 @@ class BasicDataWizardStep implements CourseWizardStep
...
@@ -185,7 +188,11 @@ class BasicDataWizardStep implements CourseWizardStep
* present. But this can only be done if your own permission level
* present. But this can only be done if your own permission level
* is 'dozent'.
* is 'dozent'.
*/
*/
if
(
!
$values
[
'lecturers'
]
&&
$GLOBALS
[
'perm'
]
->
have_perm
(
'dozent'
)
&&
!
$GLOBALS
[
'perm'
]
->
have_perm
(
'admin'
))
{
if
(
empty
(
$values
[
'lecturers'
])
&&
$GLOBALS
[
'perm'
]
->
have_perm
(
'dozent'
)
&&
!
$GLOBALS
[
'perm'
]
->
have_perm
(
'admin'
)
)
{
$values
[
'lecturers'
][
$GLOBALS
[
'user'
]
->
id
]
=
true
;
$values
[
'lecturers'
][
$GLOBALS
[
'user'
]
->
id
]
=
true
;
// Remove from deputies if set.
// Remove from deputies if set.
if
(
$deputies
&&
$values
[
'deputies'
][
$GLOBALS
[
'user'
]
->
id
])
{
if
(
$deputies
&&
$values
[
'deputies'
][
$GLOBALS
[
'user'
]
->
id
])
{
...
@@ -556,16 +563,22 @@ class BasicDataWizardStep implements CourseWizardStep
...
@@ -556,16 +563,22 @@ class BasicDataWizardStep implements CourseWizardStep
public
static
function
tsearchHelper
(
$psearch
,
$context
)
public
static
function
tsearchHelper
(
$psearch
,
$context
)
{
{
$ret
[
'permission'
]
=
[
'tutor'
,
'dozent'
];
$ret
[
'permission'
]
=
[
'tutor'
,
'dozent'
];
$ret
[
'exclude_user'
]
=
array_keys
((
array
)
$context
[
'tutors'
]);
$ret
[
'exclude_user'
]
=
array_keys
((
array
)
(
$context
[
'tutors'
]
??
[]));
$ret
[
'institute'
]
=
array_merge
([
$context
[
'institute'
]],
array_keys
((
array
)
$context
[
'participating'
]));
$ret
[
'institute'
]
=
array_merge
(
[
$context
[
'institute'
]],
array_keys
((
array
)
(
$context
[
'participating'
]
??
[]))
);
return
$ret
;
return
$ret
;
}
}
public
static
function
lsearchHelper
(
$psearch
,
$context
)
public
static
function
lsearchHelper
(
$psearch
,
$context
)
{
{
$ret
[
'permission'
]
=
'dozent'
;
$ret
[
'permission'
]
=
'dozent'
;
$ret
[
'exclude_user'
]
=
array_keys
((
array
)
$context
[
'lecturers'
]);
$ret
[
'exclude_user'
]
=
array_keys
((
array
)
(
$context
[
'lecturers'
]
??
[]));
$ret
[
'institute'
]
=
array_merge
([
$context
[
'institute'
]],
array_keys
((
array
)
$context
[
'participating'
]));
$ret
[
'institute'
]
=
array_merge
(
[
$context
[
'institute'
]],
array_keys
((
array
)
(
$context
[
'participating'
]
??
[]))
);
return
$ret
;
return
$ret
;
}
}
...
...
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