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
bf6e51ea
Commit
bf6e51ea
authored
8 months ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
convert consultation creator to new data-vue-app mechanism, fixes #4367
Closes #4367 Merge request
studip/studip!3167
parent
ac2367fc
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/consultation/admin.php
+36
-8
36 additions, 8 deletions
app/controllers/consultation/admin.php
app/views/consultation/admin/create.php
+0
-36
0 additions, 36 deletions
app/views/consultation/admin/create.php
with
36 additions
and
44 deletions
app/controllers/consultation/admin.php
+
36
−
8
View file @
bf6e51ea
...
...
@@ -136,28 +136,56 @@ class Consultation_AdminController extends ConsultationController
{
PageLayout
::
setTitle
(
_
(
'Neue Terminblöcke anlegen'
));
$this
->
room
=
''
;
$this
->
responsible
=
false
;
$this
->
slot_count_threshold
=
self
::
SLOT_COUNT_THRESHOLD
;
$room
=
''
;
$responsible
=
false
;
// TODO: inst_default?
if
(
$this
->
range
instanceof
User
)
{
$rooms
=
$this
->
range
->
institute_memberships
->
pluck
(
'Raum'
);
$rooms
=
array_filter
(
$rooms
);
$
this
->
room
=
$rooms
?
reset
(
$rooms
)
:
''
;
$room
=
$rooms
?
reset
(
$rooms
)
:
''
;
}
elseif
(
$this
->
range
instanceof
Course
)
{
$
this
->
room
=
$this
->
range
->
ort
;
$room
=
$this
->
range
->
ort
;
$block
=
new
ConsultationBlock
();
$block
->
range
=
$this
->
range
;
$
this
->
responsible
=
$block
->
getPossibleResponsibilites
();
$responsible
=
$block
->
getPossibleResponsibilites
();
}
elseif
(
$this
->
range
instanceof
Institute
)
{
$block
=
new
ConsultationBlock
();
$block
->
range
=
$this
->
range
;
$
this
->
responsible
=
$block
->
getPossibleResponsibilites
();
$responsible
=
$block
->
getPossibleResponsibilites
();
}
$this
->
response
->
add_header
(
'X-No-Buttons'
,
''
);
$convertResponsibilities
=
function
(
$input
)
{
if
(
$input
===
false
)
{
return
false
;
}
foreach
(
$input
as
$key
=>
$values
)
{
$input
[
$key
]
=
array_map
(
fn
(
$item
)
=>
[
'id'
=>
$item
->
id
,
'label'
=>
$item
instanceof
Statusgruppen
?
$item
->
getName
()
:
$item
->
getFullName
(),
],
$values
);
}
return
$input
;
};
$this
->
render_vue_app
(
Studip\VueApp
::
create
(
'ConsultationCreator'
)
->
withProps
([
'as-dialog'
=>
Request
::
isXhr
(),
'cancel-url'
=>
$this
->
indexURL
(),
'default-room'
=>
$room
,
'range-type'
=>
get_class
(
$this
->
range
),
'slot-count_threshold'
=>
self
::
SLOT_COUNT_THRESHOLD
,
'store-url'
=>
$this
->
storeURL
(),
'with-responsible'
=>
$convertResponsibilities
(
$responsible
),
])
);
}
public
function
store_action
()
...
...
This diff is collapsed.
Click to expand it.
app/views/consultation/admin/create.php
deleted
100644 → 0
+
0
−
36
View file @
ac2367fc
<?php
/**
* @var Consultation_AdminController $controller
* @var Trails\Flash $flash
* @var string|null $room
* @var array $responsible
* @var Range $range
* @var int $slot_count_threshold
*/
$convertResponsibilities
=
function
(
$input
)
{
if
(
$input
===
false
)
{
return
json_encode
(
false
);
}
foreach
(
$input
as
$key
=>
$values
)
{
$input
[
$key
]
=
array_map
(
fn
(
$item
)
=>
[
'id'
=>
$item
->
id
,
'label'
=>
$item
instanceof
Statusgruppen
?
$item
->
getName
()
:
$item
->
getFullName
()],
$values
);
}
return
json_encode
(
$input
);
}
?>
<div
data-vue-app=
"
<?=
htmlReady
(
json_encode
([
'components'
=>
[
'ConsultationCreator'
]]))
?>
"
is=
"ConsultationCreator"
cancel-url=
"
<?=
$controller
->
indexURL
()
?>
"
store-url=
"
<?=
$controller
->
storeURL
()
?>
"
:with-responsible=
"
<?=
htmlReady
(
$convertResponsibilities
(
$responsible
))
?>
"
range-type=
"
<?=
get_class
(
$range
)
?>
"
default-room=
"
<?=
htmlReady
(
$room
)
?>
"
:slot-count-threshold=
"
<?=
htmlReady
(
$slot_count_threshold
)
?>
"
:as-dialog=
"
<?=
json_encode
(
Request
::
isXhr
())
?>
"
></div>
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