Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gredu_labs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Σταύρος Παπαδάκης
gredu_labs
Commits
99b83e2a
Commit
99b83e2a
authored
Dec 09, 2016
by
Aspasia Katsi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rebase
parent
3820b2c3
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
596 additions
and
124 deletions
+596
-124
module/university_form/bootstrap.php
module/university_form/bootstrap.php
+8
-0
module/university_form/data/migration-03-down.mysql.sql
module/university_form/data/migration-03-down.mysql.sql
+5
-0
module/university_form/data/migration-03-up.mysql.sql
module/university_form/data/migration-03-up.mysql.sql
+4
-0
module/university_form/data/migrations.sql
module/university_form/data/migrations.sql
+41
-0
module/university_form/src/Action/UniversityForm.php
module/university_form/src/Action/UniversityForm.php
+14
-3
module/university_form/src/InputFilter/UniversityForm.php
module/university_form/src/InputFilter/UniversityForm.php
+37
-13
module/university_form/src/InputFilter/UniversityForm1.php
module/university_form/src/InputFilter/UniversityForm1.php
+118
-0
module/university_form/src/Service/UniversityFormService.php
module/university_form/src/Service/UniversityFormService.php
+3
-0
module/university_form/templates/university_form/form.twig
module/university_form/templates/university_form/form.twig
+16
-3
public/js/university_form/index.js
public/js/university_form/index.js
+350
-105
No files found.
module/university_form/bootstrap.php
View file @
99b83e2a
...
...
@@ -32,15 +32,23 @@ $events('on', 'app.services', function ($container) {
return
new
GrEduLabs\UniversityForm\InputFilter\UniversityForm
();
};
$container
[
GrEduLabs\UniversityForm\InputFilter\UniversityForm1
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\UniversityForm\InputFilter\UniversityForm1
();
};
$container
[
GrEduLabs\UniversityForm\Action\UniversityForm
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\UniversityForm\Action\UniversityForm
(
$c
->
get
(
'view'
),
$c
->
get
(
GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface
::
class
),
$c
->
get
(
GrEduLabs\UniversityForm\InputFilter\UniversityForm
::
class
),
$c
->
get
(
GrEduLabs\UniversityForm\InputFilter\UniversityForm1
::
class
),
$c
->
get
(
'router'
)
->
pathFor
(
'university_form.submit_success'
),
$c
);
};
$container
[
GrEduLabs\UniversityForm\Action\SubmitSuccess
::
class
]
=
function
(
$c
)
{
return
new
GrEduLabs\UniversityForm\Action\SubmitSuccess
(
$c
->
get
(
'view'
),
...
...
module/university_form/data/migration-03-down.mysql.sql
0 → 100644
View file @
99b83e2a
ALTER
TABLE
`univ`
DROP
COLUMN
`ereunitiko`
,
DROP
COLUMN
`institute`
,
DROP
COLUMN
`other`
;
module/university_form/data/migration-03-up.mysql.sql
0 → 100644
View file @
99b83e2a
ALTER
TABLE
`univ`
ADD
COLUMN
`ereunitiko`
varchar
(
191
),
ADD
COLUMN
`institute`
varchar
(
191
),
ADD
COLUMN
`other`
varchar
(
191
);
module/university_form/data/migrations.sql
0 → 100644
View file @
99b83e2a
-- Table structure for table `univ`
--
DROP
TABLE
IF
EXISTS
`univ`
;
--
-- Table structure for table `univ`
--
CREATE
TABLE
IF
NOT
EXISTS
`univ`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`idrima`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`sxolh`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
,
`tmhma`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
,
`person`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`telef`
varchar
(
20
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`email`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`comments`
text
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`erga`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
,
`projectdescription`
text
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
AUTO_INCREMENT
=
1
;
DROP
TABLE
IF
EXISTS
`volunteerteachers`
;
CREATE
TABLE
IF
NOT
EXISTS
`volunteerteachers`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
191
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`surname`
varchar
(
191
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`eidikothta`
int
(
11
)
NOT
NULL
,
`arithmitroou`
int
(
11
)
NOT
NULL
,
`telef`
varchar
(
20
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`email`
varchar
(
191
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`school`
varchar
(
191
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`schooltelef`
varchar
(
20
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`comments`
text
NOT
NULL
,
`projectdescription`
text
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
module/university_form/src/Action/UniversityForm.php
View file @
99b83e2a
...
...
@@ -49,12 +49,14 @@ class UniversityForm
protected
$successUrl
;
public
function
__construct
(
Twig
$view
,
UniversityFormServiceInterface
$UniversityFormService
,
InputFilterInterface
$UniversityFormInputFilter
,
$successUrl
,
$container
Twig
$view
,
UniversityFormServiceInterface
$UniversityFormService
,
InputFilterInterface
$UniversityFormInputFilter
2
,
InputFilterInterface
$UniversityFormInputFilter1
,
$successUrl
,
$container
)
{
$this
->
view
=
$view
;
$this
->
UniversityFormService
=
$UniversityFormService
;
$this
->
UniversityFormInputFilter
=
$UniversityFormInputFilter
;
$this
->
UniversityFormInputFilter
=
$UniversityFormInputFilter1
;
$this
->
UniversityFormInputFilter2
=
$UniversityFormInputFilter2
;
$this
->
UniversityFormInputFilter1
=
$UniversityFormInputFilter1
;
$this
->
successUrl
=
$successUrl
;
$this
->
container
=
$container
;
}
...
...
@@ -66,9 +68,18 @@ class UniversityForm
if
(
$req
->
isPost
())
{
$reqParams
=
$req
->
getParams
();
if
(
isset
(
$reqParams
[
'newselect'
])
&&
$reqParams
[
'newselect'
]
==
'ereunitika'
)
{
$this
->
UniversityFormInputFilter
=
$this
->
UniversityFormInputFilter2
;
}
else
{
$this
->
UniversityFormInputFilter
=
$this
->
UniversityFormInputFilter1
;
}
$this
->
UniversityFormInputFilter
->
setData
(
$reqParams
);
$isValid
=
$this
->
UniversityFormInputFilter
->
isValid
();
if
(
$isValid
)
{
$data
=
$this
->
UniversityFormInputFilter
->
getValues
();
...
...
module/university_form/src/InputFilter/UniversityForm.php
View file @
99b83e2a
...
...
@@ -20,23 +20,43 @@ class UniversityForm extends InputFilter
public
function
__construct
()
{
$newselect
=
new
Input
(
'newselect'
);
$newselect
->
setRequired
(
false
)
->
getFilterChain
();
$ereunitiko
=
new
Input
(
'ereunitiko'
);
$ereunitiko
->
setRequired
(
true
)
->
getFilterChain
();
$idrima
=
new
Input
(
'idrima'
);
$idrima
->
setRequired
(
true
)
->
getFilterChain
();
$institute
=
new
Input
(
'institute'
);
$institute
->
setRequired
(
false
)
->
getFilterChain
();
$sxolh
=
new
Input
(
'sxolh'
);
$sxolh
->
setRequired
(
false
)
->
getFilterChain
();
$other
=
new
Input
(
'other'
);
$other
->
setRequired
(
false
)
->
getFilterChain
();
$tmhma
=
new
Input
(
'tmhma'
);
$tmhma
->
setRequired
(
false
)
->
getFilterChain
();
$idrima
=
new
Input
(
'idrima'
);
$idrima
->
setRequired
(
false
)
->
getFilterChain
();
$sxolh
=
new
Input
(
'sxolh'
);
$sxolh
->
setRequired
(
false
)
->
getFilterChain
();
$tmhma
=
new
Input
(
'tmhma'
);
$tmhma
->
setRequired
(
false
)
->
getFilterChain
();
$erga
=
new
Input
(
'erga'
);
$erga
->
setRequired
(
false
)
->
getFilterChain
()
...
...
@@ -82,7 +102,11 @@ class UniversityForm extends InputFilter
->
attach
(
new
Filter\StringTrim
());
$this
->
add
(
$idrima
)
$this
->
add
(
$newselect
)
->
add
(
$ereunitiko
)
->
add
(
$institute
)
->
add
(
$other
)
->
add
(
$idrima
)
->
add
(
$sxolh
)
->
add
(
$tmhma
)
->
add
(
$erga
)
...
...
module/university_form/src/InputFilter/UniversityForm1.php
0 → 100644
View file @
99b83e2a
<?php
/**
* gredu_labs
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace
GrEduLabs\UniversityForm\InputFilter
;
use
GrEduLabs\UniversityForm\Service
;
use
Zend\Filter
;
use
Zend\InputFilter\Input
;
use
Zend\InputFilter\InputFilter
;
use
Zend\Validator
;
class
UniversityForm1
extends
InputFilter
{
public
function
__construct
()
{
$newselect
=
new
Input
(
'newselect'
);
$newselect
->
setRequired
(
false
)
->
getFilterChain
();
$ereunitiko
=
new
Input
(
'ereunitiko'
);
$ereunitiko
->
setRequired
(
false
)
->
getFilterChain
();
$institute
=
new
Input
(
'institute'
);
$institute
->
setRequired
(
false
)
->
getFilterChain
();
$other
=
new
Input
(
'other'
);
$other
->
setRequired
(
false
)
->
getFilterChain
();
$idrima
=
new
Input
(
'idrima'
);
$idrima
->
setRequired
(
true
)
->
getFilterChain
();
$sxolh
=
new
Input
(
'sxolh'
);
$sxolh
->
setRequired
(
false
)
->
getFilterChain
();
$tmhma
=
new
Input
(
'tmhma'
);
$tmhma
->
setRequired
(
false
)
->
getFilterChain
();
$erga
=
new
Input
(
'erga'
);
$erga
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StringTrim
());
$person
=
new
Input
(
'person'
);
$person
->
setRequired
(
true
)
->
getFilterChain
()
->
attach
(
new
Filter\StringTrim
());
$person
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
())
->
attach
(
new
Validator\StringLength
([
'min'
=>
3
]));
$email
=
new
Input
(
'email'
);
$email
->
setRequired
(
true
)
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
())
->
attach
(
new
Validator\EmailAddress
([
'useDomainCheck'
=>
false
,
]));
$telef
=
new
Input
(
'telef'
);
$telef
->
setRequired
(
true
)
->
getFilterChain
()
->
attach
(
new
Filter\Digits
());
$telef
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
())
->
attach
(
new
Validator\StringLength
([
'min'
=>
10
]))
->
attach
(
new
Validator\StringLength
([
'max'
=>
13
]));
$projectdescription
=
new
Input
(
'projectdescription'
);
$projectdescription
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StringTrim
());
$comments
=
new
Input
(
'comments'
);
$comments
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StringTrim
());
$this
->
add
(
$newselect
)
->
add
(
$ereunitiko
)
->
add
(
$institute
)
->
add
(
$other
)
->
add
(
$idrima
)
->
add
(
$sxolh
)
->
add
(
$tmhma
)
->
add
(
$erga
)
->
add
(
$person
)
->
add
(
$telef
)
->
add
(
$email
)
->
add
(
$projectdescription
)
->
add
(
$comments
);
}
}
module/university_form/src/Service/UniversityFormService.php
View file @
99b83e2a
...
...
@@ -23,6 +23,9 @@ class UniversityFormService implements UniversityFormServiceInterface
$appForm
->
idrima
=
$data
[
'idrima'
];
$appForm
->
sxolh
=
$data
[
'sxolh'
];
$appForm
->
tmhma
=
$data
[
'tmhma'
];
$appForm
->
ereunitiko
=
$data
[
'ereunitiko'
];
$appForm
->
institute
=
$data
[
'istitute'
];
$appForm
->
other
=
$data
[
'other'
];
$appForm
->
erga
=
$data
[
'erga'
];
$appForm
->
person
=
$data
[
'person'
];
$appForm
->
telef
=
trim
(
$data
[
'telef'
]);
...
...
module/university_form/templates/university_form/form.twig
View file @
99b83e2a
...
...
@@ -29,16 +29,24 @@ input[type=text] {
<div
class=
"table-responsive"
>
<fieldset>
<div
id=
"items-list"
>
{{
macros.select
(
'idrima'
,
'Ίδρυμα'
,
''
,
form.values.idrima
,
{
'id'
:
'idrima'
}
)
}}
<div
id=
"items-list"
>
<strong>
Επιλέξτε την ιδιότητά σας:
</strong>
<select
name=
'newselect'
id=
"newselect"
>
<option
value=
"space"
id =
"space"
selected
></option>
<option
value=
"idrimata"
id =
"idrimata"
>
ΑΕΙ/ΑΤΕΙ
</option>
<option
value=
"ereunitika"
id=
"ereunitika"
>
Ερευνητικά Κέντρα
</option>
</select>
{{
macros.select
(
'idrima'
,
'Ίδρυμα'
,
''
,
form.values.idrima
,
{
'id'
:
'idrima'
}
)
}}
{{
macros.select
(
'sxolh'
,
'Σχολή'
,
''
,
form.values.sxolh
,
{
'id'
:
'sxolh'
}
)
}}
{{
macros.select
(
'tmhma'
,
'Τμήμα'
,
''
,
form.values.tmhma
,
{
'id'
:
'tmhma'
}
)
}}
{{
macros.select
(
'ereunitiko'
,
'Ερευνητικό Κέντρο'
,
''
,
form.values.ereunitiko
,
{
'id'
:
'ereunitiko'
}
)
}}
{{
macros.select
(
'institute'
,
'Ινστιτούτο'
,
''
,
form.values.institute
,
{
'id'
:
'institute'
}
)
}}
{{
macros.input
(
'other'
,
'Αλλο'
,
form.values.other
,
{
'id'
:
'other'
}
)
}}
{{
macros.input
(
'erga'
,
'Εργαστήριο'
,
form.values.erga
)
}}
{{
macros.input
(
'person'
,
'Υπεύθυνος Επικοινωνίας'
,
form.values.person
)
}}
{{
macros.input
(
'telef'
,
'Τηλέφωνο'
,
form.values.telef
)
}}
{{
macros.input
(
'email'
,
'Email'
,
form.values.email
)
}}
<br>
<br>
<br>
...
...
@@ -68,6 +76,11 @@ input[type=text] {
<input
type=
"hidden"
name=
"hididrima"
id=
"hididrima"
value=
"
{{
form.values.idrima
}}
"
>
<input
type=
"hidden"
name=
"hidsxolh"
id=
"hidsxolh"
value=
"
{{
form.values.sxolh
}}
"
>
<input
type=
"hidden"
name=
"hidtmhma"
id=
"hidtmhma"
value=
"
{{
form.values.tmhma
}}
"
>
<input
type=
"hidden"
name=
"hidereunitiko"
id=
"hidereunitiko"
value=
"
{{
form.values.ereunitiko
}}
"
>
<input
type=
"hidden"
name=
"hidinstitute"
id=
"hidinstitute"
value=
"
{{
form.values.institute
}}
"
>
<input
type=
"hidden"
name=
"hidnewselect"
id=
"hidnewselect"
>
</div>
<input
type=
"hidden"
name=
"
{{
csrf.name_key
}}
"
value=
"
{{
csrf.name
}}
"
>
<input
type=
"hidden"
name=
"
{{
csrf.value_key
}}
"
value=
"
{{
csrf.value
}}
"
>
...
...
public/js/university_form/index.js
View file @
99b83e2a
This diff is collapsed.
Click to expand it.
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