Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
4cd91bdc
Commit
4cd91bdc
authored
Jun 21, 2017
by
Χάρης Παπαδόπουλος
Browse files
Merge branch 'component_updates' into 'develop'
updated Distribution Controller See merge request !201
parents
f6170ef9
0aee6aed
Changes
1
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/src/Controller/Distribution.php
View file @
4cd91bdc
...
...
@@ -76,7 +76,7 @@ class Distribution extends ControllerBase {
public
function
createDistribution
(
Request
$request
)
{
$numDistributions
=
3
;
$sizeOfBlock
=
100000
;
$sizeOfBlock
=
100000
0
;
//POST method is checked
if
(
!
$request
->
isMethod
(
'POST'
))
{
...
...
@@ -545,6 +545,26 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup,
// (1) έχουν απόλυτη προτεραιότητα όσοι ήδη φοιτούσαν στο σχολείο (σε περίπτωση που φοιτούσαν περισσότεροι από την χωρητικότητα, τους δεχόμαστε όλους)
// (2) αν απομένουν κενές θέσεις,...τοποθέτησε και όλους τους άλλους!!.
//αν capacity = 0, ..διέγραψέ τους από εκεί που τοποθετήθηκαν προσωρινά
if
(
$limit
===
0
)
{
foreach
(
$students
as
$student
)
{
array_push
(
$this
->
pendingStudents
,
$student
->
student_id
);
try
{
$this
->
connection
->
delete
(
'epal_student_class'
)
->
condition
(
'student_id'
,
$student
->
student_id
)
->
execute
();
}
catch
(
\
Exception
$e
)
{
$this
->
logger
->
warning
(
$e
->
getMessage
());
$transaction
->
rollback
();
return
ERROR_DB
;
}
}
return
SUCCESS
;
}
//εύρεση αριθμού μαθητών που ήδη φοιτούσαν στο σχολείο
$cnt
=
0
;
foreach
(
$students
as
$student
)
{
...
...
@@ -909,7 +929,7 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup,
}
private
function
setFinalize
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment