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
itminedu
gredu_labs
Commits
56f5a490
Commit
56f5a490
authored
Mar 21, 2016
by
Vassilis Kanellopoulos
Browse files
mark a lab as new
parent
6d920643
Changes
7
Hide whitespace changes
Inline
Side-by-side
data/db/schema.mysql.sql
View file @
56f5a490
...
...
@@ -185,6 +185,7 @@ CREATE TABLE `lab` (
`school_id`
int
(
11
)
unsigned
NOT
NULL
,
`name`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`labtype_id`
int
(
11
)
unsigned
NOT
NULL
,
`is_new`
tinyint
(
1
)
unsigned
DEFAULT
0
,
`responsible_id`
int
(
11
)
unsigned
DEFAULT
NULL
,
`area`
int
(
11
)
unsigned
DEFAULT
NULL
,
`attachment`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
...
...
module/application/templates/layout.twig
View file @
56f5a490
...
...
@@ -32,7 +32,7 @@
</div>
<footer
class=
"footer"
>
<p>
©
2008-
{{
"now"
|
date
(
"Y"
)
}}
<a
href=
"http
s
://
github.com/eellak/gredu_labs"
target=
"_blank"
>
Greek Free/Open Source Software Society
</a>
Copyright
©
{{
"now"
|
date
(
"Y"
)
}}
<a
href=
"http://
www.minedu.gov.gr/"
target=
"_blank"
>
Υπουργείο Παιδείας, Έρευνας
&
Θρησκευμάτων
</a>
</p>
</footer>
</div>
...
...
module/schools/data/schema.mysql.sql
View file @
56f5a490
...
...
@@ -124,6 +124,7 @@ CREATE TABLE `lab` (
`school_id`
int
(
11
)
unsigned
NOT
NULL
,
`name`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`labtype_id`
int
(
11
)
unsigned
NOT
NULL
,
`is_new`
tinyint
(
1
)
unsigned
DEFAULT
0
,
`responsible_id`
int
(
11
)
unsigned
DEFAULT
NULL
,
`area`
int
(
11
)
unsigned
DEFAULT
NULL
,
`attachment`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
...
...
module/schools/src/Action/Assets/ListAssets.php
View file @
56f5a490
...
...
@@ -73,7 +73,9 @@ class ListAssets
},
$itemCategories
),
'labs'
=>
array_map
(
function
(
$lab
)
{
return
[
'value'
=>
$lab
[
'id'
],
'label'
=>
$lab
[
'name'
]];
},
$labs
),
},
array_filter
(
$labs
,
function
(
$lab
)
{
return
$lab
[
'is_new'
]
!==
"1"
;
})),
]);
}
}
module/schools/src/InputFilter/Lab.php
View file @
56f5a490
...
...
@@ -43,6 +43,11 @@ class Lab
$labTypeId
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
());
$isNew
=
new
Input
(
'is_new'
);
$isNew
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\ToInt
());
$responsibleId
=
new
Input
(
'responsible_id'
);
$responsibleId
->
setRequired
(
false
)
->
getValidatorChain
()
...
...
@@ -115,6 +120,7 @@ class Lab
->
add
(
$id
)
->
add
(
$name
)
->
add
(
$labTypeId
)
->
add
(
$isNew
)
->
add
(
$responsibleId
)
->
add
(
$area
)
->
add
(
$lessons
)
...
...
module/schools/src/Service/LabService.php
View file @
56f5a490
...
...
@@ -47,6 +47,7 @@ class LabService implements LabServiceInterface
$lab
->
school_id
=
$data
[
'school_id'
];
$lab
->
name
=
$data
[
'name'
];
$lab
->
labtype_id
=
$data
[
'labtype_id'
];
$lab
->
is_new
=
isset
(
$data
[
'is_new'
]);
$lab
->
area
=
$data
[
'area'
];
$lab
->
sharedLesson
=
$this
->
getLessonsById
(
$data
[
'lessons'
]);
$lab
->
use_ext_program
=
$data
[
'use_ext_program'
];
...
...
module/schools/templates/schools/labs.twig
View file @
56f5a490
...
...
@@ -40,6 +40,7 @@
<tr>
<th>
Ονομασία
</th>
<th>
Τύπος
</th>
<th>
Δημιουργία νέου χώρου
</th>
<th>
Υπεύθυνος
</th>
<th>
Δίκτυο
</th>
<th>
Server
</th>
...
...
@@ -51,6 +52,7 @@
<tr
data-lab=
"
{{
lab
|
json_encode
}}
"
data-id=
"
{{
lab.id
}}
"
>
<td>
{{
lab.name
}}
</td>
<td>
{{
lab.labtype
}}
</td>
<td>
{{
lab.is_new
?
'ΝΑΙ'
:
'ΟΧΙ'
}}
</td>
<td>
{{
lab.responsible
}}
</td>
<td>
{{
lab.has_network
}}
</td>
<td>
{{
lab.has_server
}}
</td>
...
...
@@ -58,7 +60,7 @@
</tr>
{%
else
%}
<tr>
<td
colspan=
"
6
"
class=
"no-records text-center text-muted"
>
<td
colspan=
"
7
"
class=
"no-records text-center text-muted"
>
Δεν έχουν καταχωρηθεί χώροι.
</td>
</tr>
...
...
@@ -66,7 +68,7 @@
</tbody>
<tfoot>
<tr>
<td
colspan=
"
6
"
></td>
<td
colspan=
"
7
"
></td>
</tr>
</tfoot>
</table>
...
...
@@ -86,6 +88,7 @@
{{
macros.input
(
'name'
,
'Όνομα'
,
''
,
'text'
,
{
'required'
:
''
}
)
}}
{{
macros.select
(
'responsible_id'
,
'Υπεύθυνος'
,
staff
,
''
,
{
'required'
:
''
}
)
}}
{{
macros.select
(
'labtype_id'
,
'Τύπος'
,
lab_types
,
''
,
{
'required'
:
''
}
)
}}
{{
macros.checkbox
(
'is_new'
,
'Δημιουργία νέου χώρου'
)
}}
{{
macros.select
(
'has_network'
,
'Δίκτυο'
,
network_options
,
''
,
{
'required'
:
''
}
)
}}
{{
macros.select
(
'has_server'
,
'Ύπαρξη server'
,
server_options
,
''
,
{
'required'
:
''
}
)
}}
{{
macros.input
(
'area'
,
'Επιφάνεια (m<sup>2</sup>)'
,
''
,
'number'
,
{
'required'
:
''
,
'min'
:
0
,
'max'
:
500
}
)
}}
...
...
@@ -109,6 +112,7 @@
<script
type=
"text/template"
id=
"lab-row-template"
>
<
td
><%=
lab
.
name
%><
/td
>
<
td
><%=
lab
.
labtype
%><
/td
>
<
td
><%=
parseInt
(
lab
.
is_new
,
10
)
?
'
ΝΑΙ
'
:
'
OXI
'
%><
/td
>
<
td
><%=
lab
.
responsible
%><
/td
>
<
td
><%=
lab
.
has_network
%><
/td
>
<
td
><%=
lab
.
has_server
%><
/td
>
...
...
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