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
c93d51dc
Commit
c93d51dc
authored
May 11, 2017
by
Open Source Developer
Browse files
trans
parent
1f38530f
Changes
7
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/epal.routing.yml
View file @
c93d51dc
...
...
@@ -188,3 +188,11 @@ coursesperschools:
_controller
:
'
\Drupal\epal\Controller\DirectorView::getCoursesPerSchool'
requirements
:
_user_is_logged_in
:
'
TRUE'
critirioschosen
:
path
:
'
/epal/critiriachosen/{studentId}/{type}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
_controller
:
'
\Drupal\epal\Controller\SubmitedApplications::getCritiria'
requirements
:
_user_is_logged_in
:
'
TRUE'
drupal/modules/epal/src/Controller/DirectorView.php
View file @
c93d51dc
...
...
@@ -221,6 +221,14 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
'fathersurname'
=>
$epalStudent
->
fathersurname
->
value
,
'motherfirstname'
=>
$epalStudent
->
motherfirstname
->
value
,
'mothersurname'
=>
$epalStudent
->
mothersurname
->
value
,
'guardianfirstname'
=>
$epalUser
->
name
->
value
,
'guardiansurname'
=>
$epalUser
->
surname
->
value
,
'regionaddress'
=>
$epalStudent
->
regionaddress
->
value
,
'regiontk'
=>
$epalStudent
->
regiontk
->
value
,
'regionarea'
=>
$epalStudent
->
regionarea
->
value
,
'certificatetype'
=>
$epalStudent
->
certificatetype
->
value
,
'telnum'
=>
$epalStudent
->
telnum
->
value
,
'relationtostudent'
=>
$epalStudent
->
relationtostudent
->
value
,
'birthdate'
=>
$epalStudent
->
birthdate
->
value
,
);
}
...
...
drupal/modules/epal/src/Controller/SubmitedApplications.php
View file @
c93d51dc
...
...
@@ -104,11 +104,7 @@ class SubmitedApplications extends ControllerBase
'telnum'
=>
$object
->
telnum
->
value
,
'relationtostudent'
=>
$object
->
relationtostudent
->
value
,
'birthdate'
=>
$object
->
birthdate
->
value
,
);
);
$i
++
;
}
...
...
@@ -178,6 +174,67 @@ public function getEpalChosen(Request $request, $studentId)
}
public
function
getCritiria
(
Request
$request
,
$studentId
,
$type
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$epalUsers
=
$this
->
entityTypeManager
->
getStorage
(
'epal_users'
)
->
loadByProperties
(
array
(
'authtoken'
=>
$authToken
));
$epalUser
=
reset
(
$epalUsers
);
if
(
$epalUser
)
{
$userid
=
$epalUser
->
user_id
->
entity
->
id
();
$studentIdNew
=
intval
(
$studentId
)
;
$critiriaChosen
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_moria'
)
->
loadByProperties
(
array
(
'user_id'
=>
$userid
,
'student_id'
=>
$studentIdNew
));
$i
=
0
;
if
(
$critiriaChosen
)
{
$list
=
array
();
foreach
(
$critiriaChosen
as
$object
)
{
$critirio_id
=
$object
->
criterio_id
->
entity
->
id
();
$critiriatype
=
$this
->
entityTypeManager
->
getStorage
(
'epal_criteria'
)
->
loadByProperties
(
array
(
'id'
=>
$critirio_id
));
$typeofcritiria
=
reset
(
$critiriatype
);
$typecrit
=
$typeofcritiria
->
category
->
value
;
if
(
$typecrit
==
"Κοινωνικό"
&&
$type
==
1
){
$list
[]
=
array
(
'critirio'
=>
$object
->
criterio_id
->
entity
->
get
(
'name'
)
->
value
,
'critirio_id'
=>
$critirio_id
,
);
$i
++
;
}
if
(
$typecrit
==
"Εισοδηματικό"
&&
$type
==
2
){
$list
[]
=
array
(
'critirio'
=>
$object
->
criterio_id
->
entity
->
get
(
'name'
)
->
value
,
'critirio_id'
=>
$critirio_id
,
);
$i
++
;
}
}
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"EPAL chosen not found!!!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"User not found"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
...
...
source/components/director/director-view.ts
View file @
c93d51dc
...
...
@@ -44,21 +44,63 @@ import {
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(txoption,1)">
Αναζήτηση
</button>
<div *ngIf="(retrievedStudent | async)">
<div *ngFor="let StudentDetails$ of StudentInfo$ | async; let i=index">
<br>
<br>
Όνομα: {{StudentDetails$.name}} <br>
Επώνυμο: {{StudentDetails$.studentsurname}}<br>
Όνομα Πατέρα: {{StudentDetails$.fatherfirstname}}<br>
Επώνυμο Πατέρα:{{StudentDetails$.fathersurname}}<br>
Όνομα Μητέρας: {{StudentDetails$.motherfirstname}}<br>
Επώνυμο Μητέρας:{{StudentDetails$.mothersurname}}<br>
Ημερομηνία Γέννησης: {{StudentDetails$.birthdate}}<br>
<ul class="list-group main-view">
<div *ngIf="(retrievedStudent | async)">
<div *ngFor="let StudentDetails$ of StudentInfo$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" [class.oddout]="isOdd" [class.evenout]="isEven" (click)="setActiveUser(StudentDetails$.i)" [class.selectedout]="userActive === StudentDetails$.i" >
<h5> {{StudentDetails$.name}} {{StudentDetails$.name}} </h5>
</li>
<strong>Επιβεβαίωση Εγγραφής: </strong>
<input #cb class="pull-right" type="checkbox" name="{{ StudentDetails$.id }}" (change)="updateCheckedOptions(StudentDetails$.id, $event)" >
<div [hidden]="userActive !== StudentDetails$.i" >
<table>
<tr><td>
<div class="form-group" *ngIf="StudentDetails$.relationtostudent === 'Μαθητής' ">
<label for="guardianfirstname">Όνομα κηδεμόνα</label><p class="form-control" id="guardianfirstname" style="border:1px solid #eceeef;">{{StudentDetails$.guardianfirstname}} </p>
</div>
</td>
<td>
<div class="form-group" *ngIf="StudentDetails$.relationtostudent === 'Μαθητής' ">
<label for="guardiansurname">Επώνυμο κηδεμόνα</label><p class="form-control" id="guardiansurname" style="border:1px solid #eceeef;">{{StudentDetails$.guardiansurname}} </p>
</div>
</td></tr>
</table>
<div class="form-group"><label for="name">Όνομα μαθητή</label> <p class="form-control" id="name" style="border:1px solid #eceeef;"> {{StudentDetails$.name}} </p> </div>
<div><label for="studentsurname">Επώνυμο μαθητή</label> <p class="form-control" id = "studentsurname" style="border:1px solid #eceeef;"> {{StudentDetails$.studentsurname}} </p></div>
<div><label for="fatherfirstname">Όνομα Πατέρα</label> <p class="form-control" id = "fatherfirstname" style="border:1px solid #eceeef;"> {{StudentDetails$.fatherfirstname}} </p></div>
<div><label for="fathersurname">Επώνυμο Πατέρα</label> <p class="form-control" id = "fathersurname" style="border:1px solid #eceeef;"> {{StudentDetails$.fathersurname}} </p></div>
<div><label for="motherfirstname">Όνομα Μητέρας</label> <p class="form-control" id = "motherfirstname" style="border:1px solid #eceeef;"> {{StudentDetails$.motherfirstname}} </p></div>
<div><label for="mothersurname">Επώνυμο Μητέρας</label> <p class="form-control" id = "mothersurname" style="border:1px solid #eceeef;"> {{StudentDetails$.mothersurname}} </p></div>
<div><label for="birthdate">Ημερομηνία Γέννησης</label> <p class="form-control" id = "birthdate" style="border:1px solid #eceeef;"> {{StudentDetails$.birthdate}} </p></div>
<table>
<tr>
<td>
<div class="form-group">
<label for="regionaddress">Διεύθυνση κατοικίας</label><p class="form-control" id = "regionaddress" style="border:1px solid #eceeef;"> {{StudentDetails$.regionaddress}} </p>
</div>
</td>
<td>
<div class="form-group">
<label for="regiontk">TK </label><p class="form-control" id = "regiontk" style="border:1px solid #eceeef;"> {{StudentDetails$.regiontk}} </p>
</div>
</td>
<td>
<div class="form-group">
<label for="regionarea">Πόλη/Περιοχή</label><p class="form-control" id = "regionarea" style="border:1px solid #eceeef;"> {{StudentDetails$.regionarea}} </p>
</div>
</td>
</tr>
</table>
<div><label for="certificatetype">Τύπος απολυτηρίου</label> <p class="form-control" id = "certificatetype" style="border:1px solid #eceeef;"> {{StudentDetails$.certificatetype}} </p></div>
<div><label for="telnum">Τηλέφωνο επικοινωνίας</label> <p class="form-control" id = "telnum" style="border:1px solid #eceeef;"> {{StudentDetails$.telnum}} </p></div>
<div><label for="relationtostudent">Η αίτηση γίνεται από</label> <p class="form-control" id = "relationtostudent" style="border:1px solid #eceeef;"> {{StudentDetails$.relationtostudent}} </p></div>
</div>
<!-- </div> -->
</div>
...
...
@@ -107,6 +149,8 @@ import {
private
StudentsSizeSub
:
Subscription
;
private
StudentSelectedSpecial$
:
BehaviorSubject
<
any
>
;
private
StudentSelectedSpecialSub
:
Subscription
;
private
SubmitedDetails$
:
BehaviorSubject
<
any
>
;
private
SubmitedDetailsSub
:
Subscription
;
private
retrievedStudent
:
BehaviorSubject
<
boolean
>
;
private
selectionBClass
:
BehaviorSubject
<
boolean
>
;
private
selectionCClass
:
BehaviorSubject
<
boolean
>
;
...
...
@@ -116,7 +160,7 @@ import {
private
limitdown
=
0
;
private
limitup
=
5
;
private
pageno
=
1
;
//
private
maxpage:N
umber;
private
userActive
=
<
n
umber
>-
1
;
constructor
(
private
fb
:
FormBuilder
,
...
...
@@ -127,6 +171,7 @@ import {
this
.
StudentSelectedSpecial$
=
new
BehaviorSubject
([{}]);
this
.
StudentInfo$
=
new
BehaviorSubject
([{}]);
this
.
StudentsSize$
=
new
BehaviorSubject
({});
this
.
SubmitedDetails$
=
new
BehaviorSubject
([{}]);
this
.
retrievedStudent
=
new
BehaviorSubject
(
false
);
this
.
selectionBClass
=
new
BehaviorSubject
(
false
);
this
.
selectionCClass
=
new
BehaviorSubject
(
false
);
...
...
@@ -151,6 +196,9 @@ import {
this
.
selectionCClass
.
unsubscribe
();
if
(
this
.
retrievedStudent
)
this
.
retrievedStudent
.
unsubscribe
();
if
(
this
.
SubmitedDetailsSub
)
this
.
SubmitedDetailsSub
.
unsubscribe
();
}
ngOnInit
()
{
...
...
@@ -323,4 +371,19 @@ import {
}
setActiveUser
(
ind
)
{
ind
=
+
ind
;
console
.
log
(
this
.
userActive
,
"
RA
"
,
ind
);
if
(
ind
===
this
.
userActive
){
ind
=
-
1
;
}
ind
--
;
this
.
userActive
=
ind
+
1
;
}
}
source/components/student-application-form/application.submit.ts
View file @
c93d51dc
...
...
@@ -72,8 +72,7 @@ import {AppSettings} from '../../app.settings';
this
.
studentDataFields$
=
new
BehaviorSubject
(
STUDENT_DATA_FIELDS_INITIAL_STATE
);
this
.
criteria$
=
new
BehaviorSubject
(
CRITERIA_INITIAL_STATE
);
this
.
loginInfo$
=
new
BehaviorSubject
(
LOGININFO_INITIAL_STATE
);
};
};
ngOnInit
()
{
this
.
loginInfoSub
=
this
.
_ngRedux
.
select
(
state
=>
{
...
...
source/components/student-application-form/submited.aplication.preview.ts
View file @
c93d51dc
...
...
@@ -76,10 +76,17 @@ import * as html2canvas from "html2canvas"
<div><label for="telnum">Τηλέφωνο επικοινωνίας</label> <p class="form-control" id = "telnum" style="border:1px solid #eceeef;"> {{StudentDetails$.telnum}} </p></div>
<div><label for="relationtostudent">Η αίτηση γίνεται από</label> <p class="form-control" id = "relationtostudent" style="border:1px solid #eceeef;"> {{StudentDetails$.relationtostudent}} </p></div>
<h5>Κοινωνικά Κριτίρια </h5>
<div *ngFor="let critiriaChoices$ of CritirioChosen$ | async" [hidden]="UserData$.id !== userActive">
{{critiriaChoices$.critirio}}
</div>
<h5>Εισοδηματικά Κριτίρια </h5>
<div *ngFor="let incomeChoices$ of incomeChosen$ | async" [hidden]="UserData$.id !== userActive">
{{incomeChoices$.critirio}}
</div>
<p><b>Επιλογές ΕΠΑΛ</b> </p>
<br>
<h5>Επιλογές ΕΠΑΛ</h5>
<div *ngFor="let epalChoices$ of EpalChosen$ | async" [hidden]="UserData$.id !== userActive">
Σχολείο: {{epalChoices$.epal_id}}
Σειρά Προτίμισης:{{epalChoices$.choice_no}}
...
...
@@ -105,7 +112,12 @@ import * as html2canvas from "html2canvas"
private
EpalChosen$
:
BehaviorSubject
<
any
>
;
private
EpalChosenSub
:
Subscription
;
private
incomeChosen$
:
BehaviorSubject
<
any
>
;
private
incomeChosenSub
:
Subscription
;
private
CritirioChosen$
:
BehaviorSubject
<
any
>
;
private
CritirioChosenSub
:
Subscription
;
public
StudentId
;
private
userActive
=
<
number
>-
1
;
...
...
@@ -117,6 +129,8 @@ import * as html2canvas from "html2canvas"
this
.
SubmitedApplic$
=
new
BehaviorSubject
([{}]);
this
.
SubmitedDetails$
=
new
BehaviorSubject
([{}]);
this
.
EpalChosen$
=
new
BehaviorSubject
([{}]);
this
.
CritirioChosen$
=
new
BehaviorSubject
([{}]);
this
.
incomeChosen$
=
new
BehaviorSubject
([{}]);
}
ngOnDestroy
()
...
...
@@ -127,6 +141,11 @@ import * as html2canvas from "html2canvas"
this
.
SubmitedDetailsSub
.
unsubscribe
();
if
(
this
.
EpalChosenSub
)
this
.
EpalChosenSub
.
unsubscribe
();
if
(
this
.
CritirioChosenSub
)
this
.
CritirioChosenSub
.
unsubscribe
();
if
(
this
.
incomeChosenSub
)
this
.
incomeChosenSub
.
unsubscribe
();
this
.
SubmitedDetails$
.
unsubscribe
();
this
.
EpalChosen$
.
unsubscribe
();
this
.
SubmitedApplic$
.
unsubscribe
();
...
...
@@ -144,12 +163,6 @@ import * as html2canvas from "html2canvas"
},
()
=>
console
.
log
(
"
Getting Schools
"
));
console
.
log
(
this
.
SubmitedApplic$
);
}
...
...
@@ -157,8 +170,7 @@ import * as html2canvas from "html2canvas"
setActiveUser
(
ind
,
i
)
{
ind
=
+
ind
;
ind
=
+
ind
;
console
.
log
(
this
.
userActive
,
"
RA
"
,
ind
);
if
(
ind
===
this
.
userActive
){
ind
=
-
1
;
...
...
@@ -179,6 +191,21 @@ import * as html2canvas from "html2canvas"
console
.
log
(
"
Error Getting Schools
"
);
},
()
=>
console
.
log
(
"
Getting Schools
"
));
this
.
CritirioChosenSub
=
this
.
_hds
.
getCritiria
(
this
.
userActive
+
1
,
1
).
subscribe
(
data
=>
{
this
.
CritirioChosen$
.
next
(
data
)},
error
=>
{
this
.
CritirioChosen$
.
next
([{}]);
console
.
log
(
"
Error Getting Schools
"
);
},
()
=>
console
.
log
(
"
Getting Schools
"
));
this
.
incomeChosenSub
=
this
.
_hds
.
getCritiria
(
this
.
userActive
+
1
,
2
).
subscribe
(
data
=>
{
this
.
incomeChosen$
.
next
(
data
)},
error
=>
{
this
.
incomeChosen$
.
next
([{}]);
console
.
log
(
"
Error Getting Schools
"
);
},
()
=>
console
.
log
(
"
Getting Schools
"
));
}
...
...
source/services/helper-data-service.ts
View file @
c93d51dc
...
...
@@ -752,5 +752,20 @@ export class HelperDataService implements OnInit, OnDestroy {
getCritiria
(
headerid
,
type
)
{
let
headerIdNew
=
headerid
.
toString
();
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
});
this
.
createAuthorizationHeader
(
headers
);
let
options
=
new
RequestOptions
({
headers
:
headers
});
return
this
.
http
.
get
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/critiriachosen/`
+
headerIdNew
+
'
/
'
+
type
,
options
)
.
map
(
response
=>
response
.
json
());
}
}
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