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
Σταύρος Παπαδάκης
gredu_labs
Commits
0e973a68
Commit
0e973a68
authored
Feb 21, 2016
by
Georgios Tsakalos
Browse files
update lab actions
parent
0ff299a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
module/schools/src/Action/Lab/ListAll.php
View file @
0e973a68
...
...
@@ -42,21 +42,24 @@ class ListAll
$staff
=
$this
->
staffservice
->
getTeachersBySchoolId
(
$school
->
id
);
$clean_staff
=
[];
foreach
(
$staff
as
$obj
)
{
if
(
$obj
[
'is_responsible'
])
{
$clean_staff
[]
=
[
'value'
=>
$obj
[
'id'
],
'label'
=>
$obj
[
'name'
]
.
" "
.
$obj
[
'surname'
],
];
}
$clean_staff
[]
=
[
'value'
=>
$obj
[
'id'
],
'label'
=>
$obj
[
'name'
]
.
" "
.
$obj
[
'surname'
],
];
}
$courses
=
$this
->
labservice
->
getCourses
();
$lessons
=
[];
foreach
(
$courses
as
$lesson
)
{
$lessons
[]
=
[
'value'
=>
$lesson
->
id
,
'label'
=>
$lesson
->
name
];
$lessons
=
$this
->
labservice
->
getLessons
();
$lessons_formatted
=
[];
foreach
(
$lessons
as
$lesson
)
{
$lessons_formatted
[]
=
[
'value'
=>
$lesson
->
id
,
'label'
=>
$lesson
->
name
];
}
$labs_formatted
=
[];
foreach
(
$labs
as
$lab
)
{
$lab
[
'responsible'
]
=
$lab
[
'teacher_id'
];
$labs_formatted
[]
=
$lab
;
}
return
$this
->
view
->
render
(
$res
,
'schools/labs.twig'
,
[
'labs'
=>
$labs
,
'labs'
=>
$labs
_formatted
,
'staff'
=>
$clean_staff
,
'lab_types'
=>
[
[
...
...
@@ -72,7 +75,7 @@ class ListAll
'label'
=>
'ΓΡΑΦΕΙΟ'
,
],
],
'lessons'
=>
$lessons
,
'lessons'
=>
$lessons
_formatted
,
]);
}
}
module/schools/src/Action/Lab/PersistLab.php
View file @
0e973a68
...
...
@@ -35,16 +35,13 @@ class PersistLab
$params
[
'school_id'
]
=
$school
->
id
;
$params
[
'lessons'
]
=
[
1
,
2
];
unset
(
$params
[
'id'
]);
try
{
if
(
$id
>
0
)
{
$id
=
$this
->
labservice
->
updateLab
(
$params
,
$id
);
$lab
=
$this
->
labservice
->
getLabById
(
$id
);
}
else
{
error_log
(
print_r
(
'in else'
,
TRUE
));
$id
=
$this
->
labservice
->
createLab
(
$params
);
error_log
(
print_r
(
'created lab'
,
TRUE
));
if
(
$id
>
0
)
{
$lab
=
$this
->
labservice
->
getLabById
(
$id
);
}
...
...
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