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
17b24ac5
Commit
17b24ac5
authored
8 months ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
split display and booking action into two separate actions, fixes #3771
Closes #3771 Merge request
studip/studip!3180
parent
a93297b7
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
+16
-13
16 additions, 13 deletions
app/controllers/consultation/admin.php
app/views/consultation/admin/book.php
+1
-1
1 addition, 1 deletion
app/views/consultation/admin/book.php
with
17 additions
and
14 deletions
app/controllers/consultation/admin.php
+
16
−
13
View file @
17b24ac5
...
@@ -394,24 +394,27 @@ class Consultation_AdminController extends ConsultationController
...
@@ -394,24 +394,27 @@ class Consultation_AdminController extends ConsultationController
'sem_perm'
=>
$permissions
,
'sem_perm'
=>
$permissions
,
]);
]);
}
}
}
if
(
Request
::
isPost
())
{
public
function
store_booking_action
(
$block_id
,
$slot_id
,
$page
=
0
):
void
CSRFProtection
::
verifyUnsafeRequest
();
{
CSRFProtection
::
verifyUnsafeRequest
();
if
(
$this
->
slot
->
isOccupied
())
{
$slot
=
$this
->
loadSlot
(
$block_id
,
$slot_id
);
PageLayout
::
postError
(
_
(
'Dieser Termin ist bereits belegt.'
));
}
else
{
$booking
=
new
ConsultationBooking
();
$booking
->
slot_id
=
$this
->
slot
->
id
;
$booking
->
user_id
=
Request
::
option
(
'user_id'
);
$booking
->
reason
=
trim
(
Request
::
get
(
'reason'
));
$booking
->
store
();
PageLayout
::
postSuccess
(
_
(
'Der Termin wurde reserviert.'
));
if
(
$slot
->
isOccupied
())
{
}
PageLayout
::
postError
(
_
(
'Dieser Termin ist bereits belegt.'
));
}
else
{
$booking
=
new
ConsultationBooking
();
$booking
->
slot_id
=
$slot
->
id
;
$booking
->
user_id
=
Request
::
option
(
'user_id'
);
$booking
->
reason
=
trim
(
Request
::
get
(
'reason'
));
$booking
->
store
();
$this
->
redirect
(
"consultation/admin/index/
{
$page
}
#slot-
{
$this
->
slot
->
id
}
"
);
PageLayout
::
postSuccess
(
_
(
'Der Termin wurde reserviert.'
)
);
}
}
$this
->
redirect
(
"consultation/admin/index/
{
$page
}
#slot-
{
$slot
->
id
}
"
);
}
}
public
function
edit_action
(
$block_id
,
$page
=
0
)
public
function
edit_action
(
$block_id
,
$page
=
0
)
...
...
This diff is collapsed.
Click to expand it.
app/views/consultation/admin/book.php
+
1
−
1
View file @
17b24ac5
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* @var int $page
* @var int $page
*/
*/
?>
?>
<form
action=
"
<?=
$controller
->
book
(
$slot
->
block
,
$slot
,
$page
)
?>
"
method=
"post"
class=
"default"
>
<form
action=
"
<?=
$controller
->
store_
book
ing
(
$slot
->
block
,
$slot
,
$page
)
?>
"
method=
"post"
class=
"default"
>
<?=
CSRFProtection
::
tokenTag
()
?>
<?=
CSRFProtection
::
tokenTag
()
?>
<fieldset>
<fieldset>
...
...
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