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
E
e-epal
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
Σταύρος Παπαδάκης
e-epal
Commits
265becb1
Commit
265becb1
authored
Apr 06, 2017
by
Open Source Developer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trans
parent
17b44cb3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
38 deletions
+54
-38
drupal/modules/epal/epal.routing.yml
drupal/modules/epal/epal.routing.yml
+1
-1
drupal/modules/epal/src/Controller/DirectorView.php
drupal/modules/epal/src/Controller/DirectorView.php
+11
-2
source/components/director/director-view.ts
source/components/director/director-view.ts
+40
-33
source/services/helper-data-service.ts
source/services/helper-data-service.ts
+2
-2
No files found.
drupal/modules/epal/epal.routing.yml
View file @
265becb1
...
...
@@ -107,7 +107,7 @@ confirmstudents:
requirements
:
_user_is_logged_in
:
'
TRUE'
studentperschool
:
path
:
'
/epal/studentperSchool/{epalId}/{selectId}'
path
:
'
/epal/studentperSchool/{epalId}/{selectId}
/{classId}
'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
drupal/modules/epal/src/Controller/DirectorView.php
View file @
265becb1
...
...
@@ -126,7 +126,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
}
public
function
getStudentPerSchool
(
Request
$request
,
$epalId
,
$selectId
)
public
function
getStudentPerSchool
(
Request
$request
,
$epalId
,
$selectId
,
$classId
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
...
...
@@ -137,7 +137,16 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId)
$userid
=
$epalUser
->
user_id
->
entity
->
id
();
$epalIdNew
=
intval
(
$epalId
);
$selectIdNew
=
intval
(
$selectId
);
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalIdNew
,
'specialization_id'
=>
$selectIdNew
));
if
(
$classId
==
1
)
{
$selectIdNew
=
-
1
;
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalIdNew
,
'specialization_id'
=>
$selectIdNew
,
'currentclass'
=>
$classId
));
}
else
{
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalIdNew
,
'specialization_id'
=>
$selectIdNew
,
'currentclass'
=>
$classId
));
}
$i
=
0
;
if
(
$studentPerSchool
)
{
...
...
source/components/director/director-view.ts
View file @
265becb1
...
...
@@ -30,24 +30,17 @@ import {
</select>
</div>
<div class="form-group">
<div *ngIf="(selectionBClass | async)" >
<select #tmop class="form-control" (change)="checkbclass(tmop,txoption)" formControlName="tomeas">
<select #tmop class="form-control"
*ngIf="(selectionBClass | async)"
(change)="checkbclass(tmop,txoption)" formControlName="tomeas">
<option *ngFor="let SectorSelection$ of StudentSelected$ | async; let i=index" [value] = "SectorSelection$.id"> {{SectorSelection$.sector_id}} </option>
</select>
</div>
</div>
<div class="form-group">
<div *ngIf="(selectionCClass | async)">
<select #spop class="form-control" formControlName="specialit">
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index"> {{SpecialSelection$.specialty_id}} </option>
<select #spop class="form-control" *ngIf="(selectionCClass | async)" (change) ="checkcclass()" formControlName="specialit">
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option>
</select>
</div>
</div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(tmop,txoption)">
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(txoption)">
Αναζήτηση
</button>
<div *ngIf="(retrievedStudent | async)">
...
...
@@ -67,8 +60,6 @@ import {
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
Επιβεβαίωση Εγγραφής
</button>
`
})
...
...
@@ -85,6 +76,7 @@ import {
private
selectionBClass
:
BehaviorSubject
<
boolean
>
;
private
selectionCClass
:
BehaviorSubject
<
boolean
>
;
private
SchoolId
=
147
;
private
currentclass
:
Number
;
private
saved
:
Array
<
number
>
=
new
Array
();
...
...
@@ -117,36 +109,34 @@ import {
this
.
selectionBClass
.
unsubscribe
();
if
(
this
.
selectionCClass
)
this
.
selectionCClass
.
unsubscribe
();
}
ngOnInit
()
{
}
verifyclass
(
txop
)
{
console
.
log
(
txop
.
value
,
"
aaaaa
"
);
this
.
retrievedStudent
.
next
(
false
);
if
(
txop
.
value
===
"
1
"
)
{
this
.
selectionBClass
.
next
(
false
);
this
.
selectionCClass
.
next
(
false
);
}
else
if
(
txop
.
value
===
"
2
"
)
{
console
.
log
(
this
.
SchoolId
,
"
school_id
"
);
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
false
);
this
.
StudentSelected$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
this
.
StudentSelected$
);
}
else
if
(
txop
.
value
===
"
3
"
)
{
console
.
log
(
"
trith
"
);
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
true
);
this
.
StudentSelected$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
this
.
StudentSelected$
);
}
}
...
...
@@ -154,23 +144,37 @@ import {
checkbclass
(
tmop
,
txop
)
{
console
.
log
(
tmop
.
value
,
"
aaaaaaa!!!
"
);
var
sectorint
=
+
tmop
.
value
;
this
.
retrievedStudent
.
next
(
false
);
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
console
.
log
(
sectorint
,
"
tomeas
"
);
if
(
txop
.
value
===
"
3
"
)
{
this
.
StudentSelectedSpecial$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
}
}
findstudent
(
t
mop
,
t
xop
)
findstudent
(
txop
)
{
var
sectorint
=
document
.
getElementById
(
tmop
);
console
.
log
(
sectorint
,
"
aaaaaa
"
);
// this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint).subscribe(this.StudentInfo$);
// this.retrievedStudent.next(true);
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
if
(
txop
.
value
===
"
1
"
)
{
this
.
currentclass
=
1
;
}
else
if
(
txop
.
value
===
"
2
"
)
{
this
.
currentclass
=
2
;
}
else
if
(
txop
.
value
===
"
3
"
)
{
this
.
currentclass
=
3
;
}
this
.
retrievedStudent
.
next
(
true
);
this
.
retrievedStudent
=
new
BehaviorSubject
(
false
);
this
.
StudentInfoSub
=
this
.
_hds
.
getStudentPerSchool
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
).
subscribe
(
this
.
StudentInfo$
);
}
...
...
@@ -200,9 +204,12 @@ updateCheckedOptions(id, event)
confirmStudent
()
{
this
.
_hds
.
saveConfirmStudents
(
this
.
saved
);
this
.
_hds
.
saveConfirmStudents
(
this
.
saved
);
}
checkcclass
()
{
this
.
retrievedStudent
.
next
(
false
);
}
}
\ No newline at end of file
source/services/helper-data-service.ts
View file @
265becb1
...
...
@@ -491,7 +491,7 @@ export class HelperDataService {
getStudentPerSchool
(
SchoolId
,
SelectId
)
getStudentPerSchool
(
SchoolId
,
SelectId
,
classId
)
{
let
SchoolIdNew
=
SchoolId
.
toString
();
let
SelectIdNew
=
SelectId
.
toString
();
...
...
@@ -503,7 +503,7 @@ export class HelperDataService {
});
this
.
createAuthorizationHeader
(
headers
);
let
options
=
new
RequestOptions
({
headers
:
headers
});
return
this
.
http
.
get
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/studentperSchool/`
+
SchoolIdNew
+
'
/
'
+
SelectIdNew
,
options
)
return
this
.
http
.
get
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/studentperSchool/`
+
SchoolIdNew
+
'
/
'
+
SelectIdNew
+
'
/
'
+
classId
,
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