Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fsfahrttool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
fsini-informatik
fsfahrttool
Commits
d4af88cf
Verified
Commit
d4af88cf
authored
5 years ago
by
Manuel Herrmann
Browse files
Options
Downloads
Patches
Plain Diff
transferring to/from waitlists works
parent
c7d62b44
No related branches found
No related tags found
1 merge request
!20
refactor warteliste: allows modification of list items like on meldeliste
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
registration-system/admin/pages_list.php
+25
-2
25 additions, 2 deletions
registration-system/admin/pages_list.php
registration-system/frameworks/Bachelor.php
+2
-3
2 additions, 3 deletions
registration-system/frameworks/Bachelor.php
with
27 additions
and
5 deletions
registration-system/admin/pages_list.php
+
25
−
2
View file @
d4af88cf
...
...
@@ -7,6 +7,27 @@ class AdminListPage extends AdminPage {
$this
->
isWaitlist
=
isset
(
$_GET
[
'waitlist'
])
&&
$_GET
[
'waitlist'
]
==
'true'
;
$this
->
isAlumniPage
=
isset
(
$_GET
[
'alumni'
])
&&
$_GET
[
'alumni'
]
==
'true'
;
// moves entry to final list
if
(
isset
(
$_REQUEST
[
'move'
])){
try
{
$bachelor
=
Bachelor
::
makeFromDB
(
$this
->
fahrt
,
$_REQUEST
[
'move'
]);
if
(
empty
(
$bachelor
))
throw
new
Exception
(
'Person nicht vorhanden.'
);
if
(
$this
->
isWaitlist
)
{
$transferResult
=
$bachelor
->
waitlistToRegistration
();
}
else
{
$transferResult
=
$bachelor
->
registrationToWaitlist
();
}
if
(
$transferResult
==
Bachelor
::
SAVE_SUCCESS
)
{
$this
->
message_succ
=
'Person erfolgreich von '
.
(
$this
->
isWaitlist
?
"Warteliste"
:
"Anmeldeliste"
)
.
' auf '
.
(
$this
->
isWaitlist
?
"Anmeldeliste"
:
"Warteliste"
)
.
' übertragen.'
;
}
else
{
throw
new
Exception
(
'Hat nicht geklappt. Fehlercode '
.
$transferResult
);
}
}
catch
(
Exception
$e
)
{
$this
->
message_err
=
$e
->
getMessage
();
}
}
if
(
isset
(
$_REQUEST
[
'change'
]))
{
try
{
$bNew
=
Bachelor
::
makeFromForm
(
false
,
$this
->
fahrt
,
true
,
true
);
...
...
@@ -138,7 +159,7 @@ class AdminListPage extends AdminPage {
$thead
.
=
'<th>toWaitlist</th>'
;
$toggle
.
=
'<a class="toggle-vis" data-column=\'15\'>toWaitlist</a> - '
;
}
print_r
(
$extra_filters
);
$tbody
=
''
;
$people
=
$this
->
environment
->
database
->
select
(
'bachelor'
,
Bachelor
::
$ALLOWED_FIELDS
,
[
'AND'
=>
$extra_filters
],
[
'anm_time'
=>
'ASC'
]);
...
...
@@ -153,6 +174,8 @@ print_r($extra_filters);
$bezahltJaNein
=
$b
[
'paid'
]
?
1
:
0
;
$zurueckgezahltJaNein
=
$b
[
'repaid'
]
?
1
:
0
;
$kommentar
=
htmlspecialchars
(
$b
[
'comment'
],
ENT_QUOTES
);
$waitlist_tf
=
$this
->
isWaitlist
?
"true"
:
"false"
;
$alumni_tf
=
$this
->
isAlumniPage
?
"true"
:
"false"
;
$tbody
.
=
<<<EOF
<tr>
<td><a href="#" class="edit_bachelor">${b['bachelor_id']}</a></td>
...
...
@@ -172,7 +195,7 @@ print_r($extra_filters);
<td>$bezahltJaNein,$zurueckgezahltJaNein,$zurueckgetreten</td>
EOF
.
(
$this
->
isWaitlist
?
<<<EOF
<td><a href="?page=
w
l&move=${b['bachelor_id']}">↦ übertragen</a></td>
<td><a href="?page=l
ist&waitlist=${waitlist_tf}&alumni=${alumni_tf}
&move=${b['bachelor_id']}">↦ übertragen</a></td>
EOF
:
<<<
EOF
<
td
><
a
href
=
"#"
class
=
"moveToWaitlist"
>&
#8614; Warteliste</a></td>
...
...
This diff is collapsed.
Click to expand it.
registration-system/frameworks/Bachelor.php
+
2
−
3
View file @
d4af88cf
...
...
@@ -161,9 +161,8 @@ class Bachelor {
* @return int see SAVE_* constants
*/
public
function
waitlistToRegistration
()
{
if
(
$this
->
data
[
'on_waitlist'
]
==
1
and
(
!
isset
(
$this
->
data
[
'transferred'
])
or
is_null
(
$this
->
data
[
'transferred'
]))
)
{
if
(
$this
->
data
[
'on_waitlist'
]
==
1
)
{
$this
->
data
[
'on_waitlist'
]
=
0
;
$this
->
data
[
'transferred'
]
=
time
();
$code
=
$this
->
save
();
...
...
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