Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gredu_labs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
gredu_labs
Commits
05ab74fd
Commit
05ab74fd
authored
Mar 23, 2016
by
Vassilis Kanellopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove checks and allow schools to resubmit the application form
parent
e7795c67
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
58 deletions
+63
-58
config/settings/acl.global.php
config/settings/acl.global.php
+1
-1
module/application_form/src/InputFilter/ApplicationForm.php
module/application_form/src/InputFilter/ApplicationForm.php
+1
-7
module/application_form/src/Service/ApplicationFormService.php
...e/application_form/src/Service/ApplicationFormService.php
+1
-1
module/application_form/templates/application_form/submit_success.twig
...ation_form/templates/application_form/submit_success.twig
+5
-2
module/application_form/templates/schools/index.twig
module/application_form/templates/schools/index.twig
+44
-36
module/debug/bootstrap.php
module/debug/bootstrap.php
+11
-11
No files found.
config/settings/acl.global.php
View file @
05ab74fd
...
...
@@ -29,7 +29,7 @@ return [
[
'/school/assets'
,
[
'school'
],
[
'get'
,
'post'
,
'delete'
]],
[
'/school/labs/attachment'
,
[
'school'
],
[
'get'
,
'delete'
]],
[
'/school/software'
,
[
'school'
],
[
'get'
,
'post'
,
'delete'
]],
[
'/application-form'
,
[
'school'
],
[
'get'
,
'post'
]
,
'GrEduLabs\ApplicationForm\Acl\Assertion\CanSubmit'
],
[
'/application-form'
,
[
'school'
],
[
'get'
,
'post'
]],
[
'/application-form/submit-success'
,
[
'school'
],
[
'get'
]],
[
'/tpe_survey'
,
[
'school'
],
[
'get'
,
'post'
]],
[
'/tpe_survey/total-teachers'
,
[
'school'
],
[
'post'
]],
...
...
module/application_form/src/InputFilter/ApplicationForm.php
View file @
05ab74fd
...
...
@@ -29,13 +29,7 @@ class ApplicationForm extends InputFilter
->
getFilterChain
()
->
attach
(
new
Filter\ToInt
());
$schoolId
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
())
->
attach
(
new
Validator\Callback
([
'callback'
=>
function
(
$value
)
use
(
$appFormService
)
{
return
null
===
$appFormService
->
findSchoolApplicationForm
(
$value
);
},
'message'
=>
'Έχει ήδη γίνει αίτηση'
,
]));
->
attach
(
new
Validator\NotEmpty
());
$comments
=
new
Input
(
'comments'
);
$comments
->
setRequired
(
false
)
...
...
module/application_form/src/Service/ApplicationFormService.php
View file @
05ab74fd
...
...
@@ -42,7 +42,7 @@ class ApplicationFormService implements ApplicationFormServiceInterface
public
function
findSchoolApplicationForm
(
$schoolId
)
{
$appForm
=
R
::
findOne
(
'applicationform'
,
' school_id = ? '
,
[
$schoolId
]);
$appForm
=
R
::
findOne
(
'applicationform'
,
' school_id = ?
ORDER BY id DESC
'
,
[
$schoolId
]);
if
(
null
===
$appForm
)
{
return
;
}
...
...
module/application_form/templates/application_form/submit_success.twig
View file @
05ab74fd
...
...
@@ -11,19 +11,22 @@
<h2>
Στοιχεία αίτησης
</h2>
<div
class=
"row"
>
<dl
class=
"col-
lg-12
"
>
<dl
class=
"col-
sm-12 col-md-6
"
>
<dt>
A/A αίτησης
</dt>
<dd>
{{
appForm.id
}}
</dd>
<dt>
Ημερ. υποβολής
</dt>
<dd>
{{
appForm.submitted
|
date
(
'd/m/Y'
)
}}
<dd>
</dl>
<dl
class=
"col-sm-12 col-md-6"
>
<dt>
Σχολείο
</dt>
<dd>
{{
school.name
}}
</dd>
<dt>
Κωδικός Υπουργείου
</dt>
<dd>
{{
school.registry_no
}}
<dd>
</dl>
<dl
class=
"col-lg-12"
>
<dt>
Σχόλια/Παρατηρήσεις
</dt>
<dd>
{{
appForm.comments
}}
</dd>
</dl>
</div>
<h3>
Αιτούμενος εξοπλισμός
</h3>
<div
class=
"table-responsive"
>
...
...
module/application_form/templates/schools/index.twig
View file @
05ab74fd
...
...
@@ -2,25 +2,25 @@
{%
block
content
%}
<div
id=
"school"
>
<h1>
{%
block
schoolTitle
%}
{{
school.name
}}
{%
endblock
%}
{%
block
schoolTitle
%}
{{
school.name
}}
{%
endblock
%}
</h1>
<ul
class=
"nav nav-tabs"
>
{%
for
page
in
nav
(
'main'
)
.
school.pages
%}
<li
role=
"presentation"
class=
"
{%
if
page.active
%}
active
{%
endif
%}
"
>
<a
href=
"
{{
page.href
}}
"
{%
if
page.id
%}
id=
"
{{
page.id
}}
"
{%
endif
%}
title=
"
{{
page.label
}}
"
>
<i
class=
"visible-xs fa fa-
{{
page.icon
}}
"
></i>
<span
class=
"hidden-xs"
>
{{
page.label
}}
</span>
</a>
</li>
<li
role=
"presentation"
class=
"
{%
if
page.active
%}
active
{%
endif
%}
"
>
<a
href=
"
{{
page.href
}}
"
{%
if
page.id
%}
id=
"
{{
page.id
}}
"
{%
endif
%}
title=
"
{{
page.label
}}
"
>
<i
class=
"visible-xs fa fa-
{{
page.icon
}}
"
></i>
<span
class=
"hidden-xs"
>
{{
page.label
}}
</span>
</a>
</li>
{%
endfor
%}
{%
block
navItems
%}{%
endblock
%}
</ul>
<br>
<div
class=
"row"
>
<div
class=
"col-xs-12 school-container"
>
{%
block
schoolContent
%}
{%
block
navItems
%}{%
endblock
%}
</ul>
<br>
<div
class=
"row"
>
<div
class=
"col-xs-12 school-container"
>
{%
block
schoolContent
%}
<div
id=
"school-info"
>
<p
class=
"col-md-12"
>
Σε αυτή την καρτέλα θα καταχωρήσετε πληροφορίες που
...
...
@@ -64,8 +64,8 @@
<div
class=
"panel-body"
>
<ul>
{%
for
lab
in
labs
%}
<li>
{{
lab.name
}}
</li>
{%
endfor
%}
<li>
{{
lab.name
}}
</li>
{%
endfor
%}
</ul>
</div>
<div
class=
"panel-footer text-center"
>
...
...
@@ -83,7 +83,7 @@
{%
for
asset
in
assets
%}
<dt>
{{
asset.category
}}
</dt>
<dd>
{{
asset.count
}}
<dd>
{%
endfor
%}
{%
endfor
%}
</dl>
</div>
<div
class=
"panel-footer text-center"
>
...
...
@@ -92,28 +92,26 @@
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h4>
Στοιχεία αίτησης
</h4>
</div>
<div
class=
"panel-body"
>
{%
if
appForm
%}
<div
class=
"row"
>
<dl
class=
"col-sm-12 col-md-6
dl-horizontal
"
>
<dl
class=
"col-sm-12 col-md-6"
>
<dt>
A/A αίτησης
</dt>
<dd>
{{
appForm.id
}}
</dd>
<dt>
Ημερ. υποβολής
</dt>
<dd>
{{
appForm.submitted
|
date
(
'd/m/Y'
)
}}
<dd>
</dl>
<dl
class=
"col-sm-12 col-md-6"
>
<dt>
Σχολείο
</dt>
<dd>
{{
school.name
}}
</dd>
<dt>
Κωδικός Υπουργείου
</dt>
<dd>
{{
school.registry_no
}}
<dd>
</dl>
<dl
class=
"col-sm-12 col-md-6 dl-horizontal"
>
<dt>
Αίτημα του σχολείου για
</dt>
<dd>
{{
appForm.apply_for
}}
</dd>
<dt>
Ύπαρξη - προοπτική αίθουσας για δημιουργία νέου εργαστηρίου
</dt>
<dd>
{{
appForm.new_lab_perspective
}}
<dd>
<dl
class=
"col-lg-12"
>
<dt>
Σχόλια/Παρατηρήσεις
</dt>
<dd>
{{
appForm.comments
}}
</dd>
</dl>
...
...
@@ -128,12 +126,12 @@
</tr>
</thead>
<tbody>
{%
for
item
in
appForm.items
%}
<tr>
<th>
{{
item.category
}}
</th>
<td>
{{
item.count
}}
<td>
</tr>
{%
endfor
%}
{%
for
item
in
appForm.items
%}
<tr>
<th>
{{
item.category
}}
</th>
<td>
{{
item.count
}}
<td>
</tr>
{%
endfor
%}
</tbody>
</table>
</div>
...
...
@@ -142,17 +140,27 @@
{%
endif
%}
</div>
<div
class=
"panel-footer text-center"
>
{%
if
not
appForm
%}
<a
class=
"btn btn-sm btn-primary"
href=
"
{{
path_for
(
'application_form'
)
}}
"
>
Υποβολή αίτησης
</a>
{%
endif
%}
<a
class=
"btn btn-sm btn-primary"
href=
"
{{
path_for
(
'application_form'
)
}}
"
>
{%
if
not
appForm
%}
Υποβολή αίτησης
{%
else
%}
Υποβολή νέας αίτησης
<sup>
*
</sup>
{%
endif
%}
</a>
<div
class=
"text-left"
>
{%
if
appForm
%}
<small
class=
"text-muted"
><sup>
*
</sup>
Λαμβάνεται υπόψη μόνο η τελευταία αίτηση.
</small>
{%
endif
%}
</div>
</div>
</div>
</div>
</div>
{%
endblock
%}
</div>
{%
endblock
%}
</div>
</div>
</div>
{%
endblock
%}
{%
block
inlinejs
%}
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"
></script>
...
...
module/debug/bootstrap.php
View file @
05ab74fd
...
...
@@ -37,15 +37,15 @@ return function (Slim\App $app) {
});
},
-
10
);
$events
(
'on'
,
'app.bootstrap'
,
function
(
$app
,
$container
)
{
$container
->
get
(
'router'
)
->
getNamedRoute
(
'application_form'
)
->
add
(
function
(
$req
,
$res
,
$next
)
{
$school_id
=
$req
->
getAttribute
(
'school'
)
->
id
;
$appForm
=
RedBeanPHP\R
::
findOne
(
'applicationform'
,
'school_id = ?'
,
[
$school_id
]);
if
(
$appForm
)
{
RedBeanPHP\R
::
trash
(
$appForm
);
}
return
$next
(
$req
,
$res
);
});
},
-
10
);
//
$events('on', 'app.bootstrap', function ($app, $container) {
//
$container->get('router')->getNamedRoute('application_form')->add(function ($req, $res, $next) {
//
$school_id = $req->getAttribute('school')->id;
//
$appForm = RedBeanPHP\R::findOne('applicationform', 'school_id = ?', [$school_id]);
//
if ($appForm) {
//
RedBeanPHP\R::trash($appForm);
//
}
//
//
return $next($req, $res);
//
});
//
}, -10);
};
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