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
c746bffe
Commit
c746bffe
authored
May 24, 2017
by
Open Source Developer
Browse files
ui improvement
parent
674560cc
Changes
6
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/epal.routing.yml
View file @
c746bffe
...
...
@@ -79,7 +79,7 @@ epal.allocation:
requirements
:
_user_is_logged_in
:
'
TRUE'
sectorperschool
:
path
:
'
/epal/sectorperSchool
/{epalId}
'
path
:
'
/epal/sectorperSchool'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
@@ -87,7 +87,7 @@ sectorperschool:
requirements
:
_user_is_logged_in
:
'
TRUE'
specialityperschool
:
path
:
'
/epal/specialityperSchool/{
epalId}/{
sectorId}'
path
:
'
/epal/specialityperSchool/{sectorId}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
@@ -103,7 +103,7 @@ confirmstudents:
requirements
:
_user_is_logged_in
:
'
TRUE'
studentperschool
:
path
:
'
/epal/studentperSchool/{
epalId}/{
selectId}/{classId}/{limitdown}/{limitup}'
path
:
'
/epal/studentperSchool/{selectId}/{classId}/{limitdown}/{limitup}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
@@ -111,7 +111,7 @@ studentperschool:
requirements
:
_user_is_logged_in
:
'
TRUE'
savecapacity
:
path
:
'
/epal/savecapacity/{taxi}/{tomeas}/{specialit}
/{schoolid}
'
path
:
'
/epal/savecapacity/{taxi}/{tomeas}/{specialit}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
@@ -207,7 +207,7 @@ critirioschosen:
requirements
:
_user_is_logged_in
:
'
TRUE'
findcapacity
:
path
:
'
/epal/findCapacity/{taxi}/{tomeas}/{specialit}
/{schoolid}
'
path
:
'
/epal/findCapacity/{taxi}/{tomeas}/{specialit}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
@@ -222,3 +222,13 @@ findschoolid:
_controller
:
'
\Drupal\epal\Controller\DirectorView::getSchoolID'
requirements
:
_user_is_logged_in
:
'
TRUE'
gettypeofschool
:
path
:
'
/epal/gettypeofschool'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
_controller
:
'
\Drupal\epal\Controller\DirectorView::gettypeofschool'
requirements
:
_user_is_logged_in
:
'
TRUE'
drupal/modules/epal/src/Controller/DirectorView.php
View file @
c746bffe
...
...
@@ -34,7 +34,7 @@ class DirectorView extends ControllerBase
public
function
getSectorsPerSchool
(
Request
$request
,
$epalId
)
public
function
getSectorsPerSchool
(
Request
$request
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
...
...
@@ -42,8 +42,10 @@ public function getSectorsPerSchool(Request $request, $epalId)
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
// $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId)));
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
intval
(
$epalId
)));
$epalId
=
$user
->
init
->
value
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$epalId
));
$school
=
reset
(
$schools
);
if
(
!
$school
)
{
$this
->
logger
->
warning
(
"no access to this school="
.
$user
->
id
());
...
...
@@ -56,8 +58,8 @@ public function getSectorsPerSchool(Request $request, $epalId)
$userid
=
$user
->
id
();
$epalIdNew
=
intval
(
$epalId
);
$sectorPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_sectors_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
New
));
//
$epalIdNew = intval($epalId);
$sectorPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_sectors_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
));
$i
=
0
;
if
(
$sectorPerSchool
)
{
...
...
@@ -92,7 +94,7 @@ public function getSectorsPerSchool(Request $request, $epalId)
}
public
function
getSpecialPerSchool
(
Request
$request
,
$epalId
,
$sectorId
)
public
function
getSpecialPerSchool
(
Request
$request
,
$sectorId
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
...
...
@@ -100,8 +102,9 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
// $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $user->mail->value, 'id' => intval($epalId)));
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
intval
(
$epalId
)));
$epalId
=
$user
->
init
->
value
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$epalId
));
$school
=
reset
(
$schools
);
if
(
!
$school
)
{
$this
->
logger
->
warning
(
"no access to this school="
.
$user
->
id
());
...
...
@@ -112,8 +115,8 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
return
$response
;
}
$userid
=
$user
->
id
();
$epalIdNew
=
intval
(
$epalId
);
$specialityPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
New
));
//
$epalIdNew = intval($epalId);
$specialityPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
));
$i
=
0
;
if
(
$specialityPerSchool
)
{
...
...
@@ -155,7 +158,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
}
public
function
getStudentPerSchool
(
Request
$request
,
$epalId
,
$selectId
,
$classId
,
$limitdown
,
$limitup
)
public
function
getStudentPerSchool
(
Request
$request
,
$selectId
,
$classId
,
$limitdown
,
$limitup
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
...
...
@@ -163,8 +166,8 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
//
$
schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no'
=
>
$user->
mail->value, 'id' => intval($epalId)))
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
intval
(
$epalId
))
)
;
$
epalId
=
$user
->
init
->
value
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$epalId
));
$school
=
reset
(
$schools
);
if
(
!
$school
)
{
$this
->
logger
->
warning
(
"no access to this school="
.
$user
->
id
());
...
...
@@ -176,17 +179,17 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
}
$userid
=
$user
->
id
();
$epalIdNew
=
intval
(
$epalId
);
//
$epalIdNew = intval($epalId);
$selectIdNew
=
intval
(
$selectId
);
if
(
$classId
==
1
)
{
$selectIdNew
=
-
1
;
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
New
,
'specialization_id'
=>
$selectIdNew
,
'currentclass'
=>
$classId
));
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
,
'specialization_id'
=>
$selectIdNew
,
'currentclass'
=>
$classId
));
}
else
{
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
New
,
'specialization_id'
=>
$selectIdNew
,
'currentclass'
=>
$classId
));
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalId
,
'specialization_id'
=>
$selectIdNew
,
'currentclass'
=>
$classId
));
}
$i
=
0
;
...
...
@@ -325,7 +328,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
public
function
SaveCapacity
(
Request
$request
,
$taxi
,
$tomeas
,
$specialit
,
$schoolid
)
public
function
SaveCapacity
(
Request
$request
,
$taxi
,
$tomeas
,
$specialit
)
{
...
...
@@ -340,7 +343,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
//
$school
s = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no'
=
>
$user->
mail->value, 'id' => intval($epalId)))
;
$school
id
=
$user
->
init
->
value
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$schoolid
));
$school
=
reset
(
$schools
);
if
(
!
$school
)
{
...
...
@@ -379,7 +382,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
if
((
$tomeas
!=
0
)
&&
(
$specialit
!=
0
))
if
((
$tomeas
!=
0
)
&&
(
$specialit
!=
0
)
&&
(
$taxi
==
3
)
)
{
$CapacityPerClass
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialty_id'
=>
$specialit
));
$classcapacity
=
reset
(
$CapacityPerClass
);
...
...
@@ -390,7 +393,15 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
if
((
$tomeas
!=
0
)
&&
(
$specialit
!=
0
)
&&
(
$taxi
==
4
))
{
$CapacityPerClass
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialty_id'
=>
$specialit
));
$classcapacity
=
reset
(
$CapacityPerClass
);
if
(
$classcapacity
)
{
$classcapacity
->
set
(
'capacity_class_specialty_d'
,
$cap
);
$classcapacity
->
save
();
}
}
...
...
@@ -414,7 +425,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
public
function
getSchoolsPerPerfetcure
(
Request
$request
,
$perfectureId
)
public
function
getSchoolsPerPerfetcure
(
Request
$request
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
...
...
@@ -423,6 +434,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
$user
=
reset
(
$users
);
if
(
$user
)
{
$perfectureId
=
$user
->
init
->
value
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'region_edu_admin_id'
=>
$perfectureId
));
if
(
$schools
)
{
...
...
@@ -472,6 +484,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
$user
=
reset
(
$users
);
if
(
$user
)
{
$list
=
array
();
$SchoolCats
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$schoolid
));
...
...
@@ -588,8 +601,7 @@ public function returnstatus($id)
public
function
findCapacity
(
Request
$request
,
$taxi
,
$tomeas
,
$specialit
,
$schoolid
)
public
function
findCapacity
(
Request
$request
,
$taxi
,
$tomeas
,
$specialit
)
{
$tomeasnew
=
intval
(
$tomeas
);
...
...
@@ -599,6 +611,7 @@ public function findCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
$schoolid
=
$user
->
init
->
value
;
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$schoolid
));
$school
=
reset
(
$schools
);
if
(
!
$school
)
{
...
...
@@ -624,9 +637,7 @@ public function findCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
$list
[]
=
array
(
'taxi'
=>
$taxi
,
'capacity'
=>
$classcapacity
->
capacity_class_a
->
value
,
'test'
=>
"lalalala"
,
'school'
=>
$schoolid
);
);
}
}
...
...
@@ -647,7 +658,7 @@ public function findCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
if
((
$tomeasnew
!=
0
)
&&
(
$specialitnew
!=
0
))
if
((
$tomeasnew
!=
0
)
&&
(
$specialitnew
!=
0
)
&&
(
$taxi
==
3
)
)
{
$CapacityPerClass
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialty_id'
=>
$specialitnew
));
$classcapacity
=
reset
(
$CapacityPerClass
);
...
...
@@ -663,6 +674,21 @@ public function findCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
}
if
((
$tomeasnew
!=
0
)
&&
(
$specialitnew
!=
0
)
&&
(
$taxi
==
4
))
{
$CapacityPerClass
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialty_id'
=>
$specialitnew
));
$classcapacity
=
reset
(
$CapacityPerClass
);
if
(
$classcapacity
)
{
$list
[]
=
array
(
'taxi'
=>
$taxi
,
'tomeas'
=>
$tomeasnew
,
'special'
=>
$specialitnew
,
'tomeas'
=>
$classcapacity
->
specialty_id
->
value
,
'capacity'
=>
$classcapacity
->
capacity_class_specialty_d
->
value
,
'specialty'
=>
"fromspecialityd"
);
}
}
...
...
@@ -716,11 +742,46 @@ public function getSchoolID(Request $request)
public
function
gettypeofschool
(
Request
$request
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
$schid
=
intval
(
$user
->
init
->
value
);
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$schid
));
$school
=
reset
(
$schools
);
if
(
!
$school
)
{
$this
->
logger
->
warning
(
"no access to this school="
.
$user
->
id
());
$response
=
new
Response
();
$response
->
setContent
(
'No access to this school'
);
$response
->
setStatusCode
(
Response
::
HTTP_FORBIDDEN
);
$response
->
headers
->
set
(
'Content-Type'
,
'application/json'
);
return
$response
;
}
else
{
$list
=
array
();
$list
[]
=
array
(
'type'
=>
$school
->
operation_shift
->
value
,
);
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
}
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"User not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
private
function
respondWithStatus
(
$arr
,
$s
)
{
...
...
source/components/director/director-classcapacity.ts
View file @
c746bffe
...
...
@@ -28,7 +28,10 @@ import {
<option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
<option *ngIf="(selectiontype | async)" value="4" >Δ' Λυκείου</option>
</select>
</div>
<div class="form-group">
...
...
@@ -86,6 +89,7 @@ import {
private
StudentSelectedSpecialSub
:
Subscription
;
private
saveCapacitySub
:
Subscription
;
private
selectionBClass
:
BehaviorSubject
<
boolean
>
;
private
selectiontype
:
BehaviorSubject
<
boolean
>
;
private
selectionCClass
:
BehaviorSubject
<
boolean
>
;
private
School$
:
BehaviorSubject
<
any
>
;
private
SchoolSub
:
Subscription
;
...
...
@@ -106,6 +110,7 @@ import {
this
.
StudentSelectedSpecial$
=
new
BehaviorSubject
([{}]);
this
.
classCapacity$
=
new
BehaviorSubject
([{}]);
this
.
selectionBClass
=
new
BehaviorSubject
(
false
);
this
.
selectiontype
=
new
BehaviorSubject
(
true
);
this
.
selectionCClass
=
new
BehaviorSubject
(
false
);
this
.
retrievedStudent
=
new
BehaviorSubject
(
false
);
this
.
School$
=
new
BehaviorSubject
([{}]);
...
...
@@ -118,9 +123,6 @@ import {
}
public
showModal
(
popupMsgId
):
void
{
console
.
log
(
"
about to show modal
"
);
//(<any>$('#distributionWaitingNotice')).modal('show');
...
...
@@ -155,11 +157,13 @@ import {
(
<
any
>
$
(
'
#capacitysaved
'
)).
appendTo
(
"
body
"
);
this
.
retrievedStudent
.
next
(
false
);
this
.
SchoolSub
=
this
.
_hds
.
get
S
chool
Id
().
subscribe
(
x
=>
{
this
.
SchoolSub
=
this
.
_hds
.
get
typeofs
chool
().
subscribe
(
x
=>
{
this
.
School$
.
next
(
x
);
console
.
log
(
x
[
0
].
id
,
"
schoolid!
"
);
this
.
SchoolId
=
x
[
0
].
id
;
console
.
log
(
x
[
0
].
type
,
"
schoolid!
"
);
this
.
SchoolId
=
x
[
0
].
type
;
if
(
this
.
SchoolId
==
'
ΗΜΕΡΗΣΙΟ
'
){
this
.
selectiontype
.
next
(
false
);
}
},
error
=>
{
...
...
@@ -182,7 +186,7 @@ import {
capacity
:
''
,
});
console
.
log
(
"
a class
"
);
this
.
classCapacitySub
=
this
.
_hds
.
getCapacityPerSchool
(
this
.
formGroup
.
value
.
taxi
,
0
,
0
,
this
.
SchoolId
).
subscribe
(
data
=>
{
this
.
classCapacitySub
=
this
.
_hds
.
getCapacityPerSchool
(
this
.
formGroup
.
value
.
taxi
,
0
,
0
).
subscribe
(
data
=>
{
this
.
classCapacity$
.
next
(
data
);
this
.
retrievedStudent
.
next
(
true
);
this
.
formGroup
.
patchValue
({
...
...
@@ -206,9 +210,9 @@ import {
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
false
);
this
.
StudentSelected$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
this
.
StudentSelected$
);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
().
subscribe
(
this
.
StudentSelected$
);
}
else
if
(
txop
.
value
===
"
3
"
)
{
else
if
(
txop
.
value
===
"
3
"
||
txop
.
value
===
"
4
"
)
{
this
.
formGroup
.
patchValue
({
tomeas
:
''
,
specialit
:
''
,
...
...
@@ -220,12 +224,12 @@ import {
if
(
this
.
formGroup
.
value
.
tomeas
!=
''
)
{
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
this
.
StudentSelectedSpecial$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
}
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
true
);
this
.
StudentSelected$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
this
.
StudentSelected$
);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
().
subscribe
(
this
.
StudentSelected$
);
}
...
...
@@ -235,12 +239,13 @@ import {
checkbclass
(
tmop
,
txop
)
{
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
console
.
log
(
sectorint
,
"
tomeas
"
);
console
.
log
(
tmop
,
txop
,
"
tomeas
!!!!
"
);
if
(
txop
.
value
===
"
2
"
)
{
console
.
log
(
"
b class
"
);
this
.
classCapacitySub
=
this
.
_hds
.
getCapacityPerSchool
(
this
.
formGroup
.
value
.
taxi
,
sectorint
,
0
,
this
.
SchoolId
).
subscribe
(
data
=>
{
this
.
classCapacitySub
=
this
.
_hds
.
getCapacityPerSchool
(
this
.
formGroup
.
value
.
taxi
,
sectorint
,
0
).
subscribe
(
data
=>
{
this
.
classCapacity$
.
next
(
data
);
this
.
retrievedStudent
.
next
(
true
);
this
.
formGroup
.
patchValue
({
...
...
@@ -253,9 +258,9 @@ import {
},
()
=>
console
.
log
(
"
Getting Capacity
"
));
}
if
(
txop
.
value
===
"
3
"
)
{
if
(
txop
.
value
===
"
3
"
||
txop
.
value
===
"
4
"
)
{
this
.
StudentSelectedSpecial$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
}
...
...
@@ -267,10 +272,10 @@ import {
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
var
specialint
=
+
this
.
formGroup
.
value
.
specialit
;
if
(
txop
.
value
===
"
3
"
)
{
if
(
txop
.
value
===
"
3
"
||
txop
.
value
===
"
4
"
)
{
console
.
log
(
"
c class
"
);
console
.
log
(
sectorint
,
specialint
,
"
cclass
"
)
this
.
classCapacitySub
=
this
.
_hds
.
getCapacityPerSchool
(
this
.
formGroup
.
value
.
taxi
,
sectorint
,
specialint
,
this
.
SchoolId
).
subscribe
(
data
=>
{
this
.
classCapacitySub
=
this
.
_hds
.
getCapacityPerSchool
(
this
.
formGroup
.
value
.
taxi
,
sectorint
,
specialint
).
subscribe
(
data
=>
{
this
.
classCapacity$
.
next
(
data
);
this
.
retrievedStudent
.
next
(
true
);
...
...
@@ -296,15 +301,18 @@ import {
var
tomeas
=
+
this
.
formGroup
.
value
.
tomeas
;
var
specialit
=
+
this
.
formGroup
.
value
.
specialit
;
this
.
saveCapacitySub
=
this
.
_hds
.
saveCapacity
(
this
.
formGroup
.
value
.
taxi
,
tomeas
,
specialit
,
this
.
formGroup
.
value
.
capacity
,
this
.
SchoolId
).
subscribe
(
data
=>
{
this
.
saveCapacitySub
=
this
.
_hds
.
saveCapacity
(
this
.
formGroup
.
value
.
taxi
,
tomeas
,
specialit
,
this
.
formGroup
.
value
.
capacity
).
subscribe
(
data
=>
{
},
error
=>
{
console
.
log
(
"
Error Saving Capacity
"
);
},
()
=>
console
.
log
(
"
Saved Capacity
"
));
()
=>
{
console
.
log
(
"
Saved Capacity
"
);
this
.
showModal
(
"
#capacitysaved
"
);
});
}
...
...
source/components/director/director-view.ts
View file @
c746bffe
...
...
@@ -30,6 +30,7 @@ import {
<option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
<option value="4" >Δ' Λυκείου</option>
</select>
</div>
<div class="form-group">
...
...
@@ -65,7 +66,7 @@ import {
<option value=2>Όχι</option>
<option value=3 selected></option>
</select>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent(
txoption
)">
Επιβεβαίωση Εγγραφής
</button>
...
...
@@ -173,7 +174,7 @@ import {
private
currentclass
:
Number
;
private
saved
:
Array
<
number
>
=
new
Array
();
private
limitdown
=
0
;
private
limitup
=
2
5
;
private
limitup
=
5
;
private
pageno
=
1
;
private
userActive
=
<
number
>-
1
;
private
type
:
Number
;
...
...
@@ -251,7 +252,7 @@ import {
}
else
if
(
txop
.
value
===
"
2
"
)
{
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
data
=>
{
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
().
subscribe
(
data
=>
{
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
false
);
this
.
StudentSelected$
.
next
(
data
);
...
...
@@ -263,13 +264,12 @@ import {
},
()
=>
console
.
log
(
"
Getting StudentSelectedSpecial
"
));
}
else
if
(
txop
.
value
===
"
3
"
)
{
else
if
(
txop
.
value
===
"
3
"
||
txop
.
value
===
"
4
"
)
{
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
console
.
log
(
sectorint
,
"
test
"
);
if
(
this
.
formGroup
.
value
.
tomeas
!=
''
)
{
if
(
this
.
formGroup
.
value
.
tomeas
!=
''
)
{
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
data
=>
{
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
sectorint
).
subscribe
(
data
=>
{
this
.
StudentSelectedSpecial$
.
next
(
data
);
},
error
=>
{
...
...
@@ -279,7 +279,7 @@ import {
()
=>
console
.
log
(
"
Getting StudentSelectedSpecial
"
));
}
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
data
=>
{
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
().
subscribe
(
data
=>
{
this
.
StudentSelected$
.
next
(
data
);
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
true
);
...
...
@@ -299,9 +299,9 @@ import {
this
.
retrievedStudent
.
next
(
false
);
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
console
.
log
(
sectorint
,
"
tomeas
"
);
if
(
txop
.
value
===
"
3
"
)
{
if
(
txop
.
value
===
"
3
"
||
txop
.
value
===
"
4
"
)
{
// this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
data
=>
{
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
sectorint
).
subscribe
(
data
=>
{
this
.
StudentSelectedSpecial$
.
next
(
data
);
},
...
...
@@ -327,10 +327,13 @@ import {
this
.
currentclass
=
3
;
}
else
if
(
txop
.
value
===
"
4
"
)
{
this
.
currentclass
=
4
;
}
this
.
formGroup
.
get
(
'
pageno
'
).
setValue
(
this
.
pageno
);
if
(
this
.
pageno
==
1
)
{
console
.
log
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
,
"
test
"
);
this
.
StudentsSizeSub
=
this
.
_hds
.
getStudentPerSchool
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
,
0
,
0
).
subscribe
(
x
=>
{
console
.
log
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
,
"
test
aaaaaa
"
);
this
.
StudentsSizeSub
=
this
.
_hds
.
getStudentPerSchool
(
sectorint
,
this
.
currentclass
,
0
,
0
).
subscribe
(
x
=>
{
this
.
StudentsSize$
.
next
(
x
);
tot_pages
=
x
.
id
/
5
;
if
(
x
.
id
%
5
>
0
)
{
...
...
@@ -341,7 +344,7 @@ import {
}
this
.
StudentInfoSub
=
this
.
_hds
.
getStudentPerSchool
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
,
this
.
limitdown
,
this
.
limitup
).
subscribe
(
data
=>
{
this
.
StudentInfoSub
=
this
.
_hds
.
getStudentPerSchool
(
sectorint
,
this
.
currentclass
,
this
.
limitdown
,
this
.
limitup
).
subscribe
(
data
=>
{
this
.
StudentInfo$
.
next
(
data
);
this
.
retrievedStudent
.
next
(
true
);
},
...
...
@@ -364,12 +367,7 @@ import {
else
if
(
cbvalue
.
value
===
'
2
'
)
{
this
.
saved
[
i
]
=
id
;
this
.
type
=
2
;
//var count = this.saved.length;
//for (var j = 0; j < count; j++) {
// if (this.saved[j] === id) {
// this.saved.splice(j, 1);
// }
console
.
log
(
"
not confirmed
"
)
}
else
if
(
cbvalue
.
value
===
'
3
'
)
{
...
...
@@ -379,8 +377,10 @@ import {
confirmStudent
()
{
confirmStudent
(
txop
)
{