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
13b0bb76
Commit
13b0bb76
authored
Apr 12, 2017
by
Χάρης Παπαδόπουλος
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed director view bug. Other fixes
parent
88da1f2e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
256 additions
and
146 deletions
+256
-146
drupal/modules/casost/src/Controller/CASLogin.php
drupal/modules/casost/src/Controller/CASLogin.php
+0
-2
drupal/modules/epal/src/Controller/DirectorView.php
drupal/modules/epal/src/Controller/DirectorView.php
+119
-66
drupal/modules/epal/src/Entity/EpalCriteria.php
drupal/modules/epal/src/Entity/EpalCriteria.php
+23
-3
source/components/director/director-view.ts
source/components/director/director-view.ts
+25
-26
source/services/helper-data-service.ts
source/services/helper-data-service.ts
+89
-49
No files found.
drupal/modules/casost/src/Controller/CASLogin.php
View file @
13b0bb76
...
...
@@ -5,8 +5,6 @@ use Drupal\Core\Entity\Query\QueryFactory;
use
Drupal\Core\Entity\EntityTypeManagerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Drupal\Core\Controller\ControllerBase
;
// require_once '/home/haris/devel/eepal/drupal/modules/casost/src/CAS/phpCAS.php';
use
phpCAS
;
use
Drupal\user\Entity\User
;
use
Drupal\Core\Database\Connection
;
...
...
drupal/modules/epal/src/Controller/DirectorView.php
View file @
13b0bb76
...
...
@@ -14,30 +14,48 @@ use Drupal\Core\Logger\LoggerChannelFactoryInterface;
class
DirectorView
extends
ControllerBase
{
protected
$entityTypeManager
;
protected
$logger
;
protected
$testSchoolId
=
'0640050'
;
public
function
__construct
(
EntityTypeManagerInterface
$entityTypeManager
)
public
function
__construct
(
EntityTypeManagerInterface
$entityTypeManager
,
LoggerChannelFactoryInterface
$loggerChannel
)
{
$this
->
entityTypeManager
=
$entityTypeManager
;
$this
->
logger
=
$loggerChannel
->
get
(
'epal-school'
);
}
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'entity_type.manager'
)
$container
->
get
(
'entity_type.manager'
),
$container
->
get
(
'logger.factory'
)
);
}
}
public
function
getSectorsPerSchool
(
Request
$request
,
$epalId
)
{
$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
();
$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
(
'registry_no'
=>
$this
->
testSchoolId
,
'id'
=>
intval
(
$epalId
)));
$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
;
}
$userid
=
$user
->
id
();
$epalIdNew
=
intval
(
$epalId
);
$sectorPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_sectors_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalIdNew
));
$i
=
0
;
...
...
@@ -52,7 +70,7 @@ public function getSectorsPerSchool(Request $request, $epalId)
$i
++
;
}
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
...
...
@@ -60,9 +78,9 @@ public function getSectorsPerSchool(Request $request, $epalId)
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"School not found!!!"
),
],
Response
::
HTTP_
FORBIDDEN
);
],
Response
::
HTTP_
OK
);
}
}
else
{
...
...
@@ -71,18 +89,29 @@ public function getSectorsPerSchool(Request $request, $epalId)
'message'
=>
t
(
"User not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
public
function
getSpecialPerSchool
(
Request
$request
,
$epalId
,
$sectorId
)
{
$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
();
$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
(
'registry_no'
=>
$this
->
testSchoolId
,
'id'
=>
intval
(
$epalId
)));
$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
;
}
$userid
=
$user
->
id
();
$epalIdNew
=
intval
(
$epalId
);
$specialityPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$epalIdNew
));
$i
=
0
;
...
...
@@ -95,15 +124,15 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
$specialityPerSector
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialty'
)
->
loadByProperties
(
array
(
'id'
=>
$idSpecial
,
'sector_id'
=>
$SectorIdNew
));
$specialPerSec
=
reset
(
$specialityPerSector
);
if
(
$specialPerSec
)
if
(
$specialPerSec
)
{
$list
[]
=
array
(
'specialty_id'
=>
$object
->
specialty_id
->
entity
->
get
(
'name'
)
->
value
,
'id'
=>
$object
->
specialty_id
->
entity
->
id
()
);
$i
++
;
}
}
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
...
...
@@ -111,9 +140,9 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"School not found!!!"
),
],
Response
::
HTTP_
FORBIDDEN
);
],
Response
::
HTTP_
OK
);
}
}
else
{
...
...
@@ -122,43 +151,55 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
'message'
=>
t
(
"User not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
public
function
getStudentPerSchool
(
Request
$request
,
$epalId
,
$selectId
,
$classId
)
{
$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
();
$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
(
'registry_no'
=>
$this
->
testSchoolId
,
'id'
=>
intval
(
$epalId
)));
$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
;
}
$userid
=
$user
->
id
();
$epalIdNew
=
intval
(
$epalId
);
$selectIdNew
=
intval
(
$selectId
);
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
)
{
$list
=
array
();
foreach
(
$studentPerSchool
as
$object
)
{
foreach
(
$studentPerSchool
as
$object
)
{
$studentId
=
$object
->
id
()
;
$epalStudents
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student'
)
->
loadByProperties
(
array
(
'id'
=>
$studentId
));
$epalStudent
=
reset
(
$epalStudents
);
$i
=
0
;
if
(
$epalStudents
)
{
$list
[]
=
array
(
'id'
=>
$epalStudent
->
id
(),
'name'
=>
$epalStudent
->
name
->
value
,
...
...
@@ -180,19 +221,19 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"No students found!!!"
),
],
Response
::
HTTP_
FORBIDDEN
);
],
Response
::
HTTP_
OK
);
}
}
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"User not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
...
...
@@ -201,15 +242,27 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
{
if
(
!
$request
->
isMethod
(
'POST'
))
{
return
$this
->
respondWithStatus
([
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"Method Not Allowed"
)
],
Response
::
HTTP_METHOD_NOT_ALLOWED
);
}
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$epalUsers
=
$this
->
entityTypeManager
->
getStorage
(
'epal_users'
)
->
loadByProperties
(
array
(
'authtoken'
=>
$authToken
));
$epalUser
=
reset
(
$epalUsers
);
if
(
$epalUser
)
{
$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
(
'registry_no'
=>
$this
->
testSchoolId
));
$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
;
}
$postData
=
null
;
if
(
$content
=
$request
->
getContent
())
...
...
@@ -218,14 +271,14 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$arr
=
$postData
->
students
;
foreach
(
$arr
as
$value
)
{
$valnew
=
intval
(
$value
);
$valnew
=
intval
(
$value
);
$studentForConfirm
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'id'
=>
$valnew
));
$studentConfirm
=
reset
(
$studentForConfirm
);
if
(
$studentConfirm
)
{
$studentConfirm
->
set
(
'directorconfirm'
,
true
);
$studentConfirm
->
save
();
}
}
}
}
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"saved"
),
],
Response
::
HTTP_OK
);
...
...
@@ -253,15 +306,26 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
{
if
(
!
$request
->
isMethod
(
'POST'
))
{
return
$this
->
respondWithStatus
([
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"Method Not Allowed"
)
],
Response
::
HTTP_METHOD_NOT_ALLOWED
);
}
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$epalUsers
=
$this
->
entityTypeManager
->
getStorage
(
'epal_users'
)
->
loadByProperties
(
array
(
'authtoken'
=>
$authToken
));
$epalUser
=
reset
(
$epalUsers
);
if
(
$epalUser
)
{
$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
(
'registry_no'
=>
$this
->
testSchoolId
));
$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
;
}
$postData
=
null
;
if
(
$content
=
$request
->
getContent
())
...
...
@@ -275,7 +339,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
if
(
$classcapacity
)
{
$classcapacity
->
set
(
'capacity_class_a'
,
$cap
);
$classcapacity
->
save
();
}
}
}
...
...
@@ -286,7 +350,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
if
(
$classcapacity
)
{
$classcapacity
->
set
(
'capacity_class_sector'
,
$cap
);
$classcapacity
->
save
();
}
}
}
...
...
@@ -297,7 +361,7 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
if
(
$classcapacity
)
{
$classcapacity
->
set
(
'capacity_class_specialty'
,
$cap
);
$classcapacity
->
save
();
}
}
}
...
...
@@ -325,12 +389,6 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
private
function
respondWithStatus
(
$arr
,
$s
)
{
$res
=
new
JsonResponse
(
$arr
);
$res
->
setStatusCode
(
$s
);
...
...
@@ -342,8 +400,3 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
drupal/modules/epal/src/Entity/EpalCriteria.php
View file @
13b0bb76
...
...
@@ -192,7 +192,27 @@ class EpalCriteria extends ContentEntityBase implements EpalCriteriaInterface {
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields
[
'category'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Κατηγορα'
))
->
setDescription
(
t
(
'Κατηγορία κριτηρίου.'
))
->
setSettings
(
array
(
'max_length'
=>
100
,
'text_processing'
=>
0
,
))
->
setRequired
(
true
)
->
setDisplayOptions
(
'view'
,
array
(
'label'
=>
'above'
,
'type'
=>
'string'
,
'weight'
=>
-
4
,
))
->
setDisplayOptions
(
'form'
,
array
(
'type'
=>
'string_textfield'
,
'weight'
=>
-
4
,
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields
[
'value_limit'
]
=
BaseFieldDefinition
::
create
(
'float'
)
->
setLabel
(
t
(
'Αριθμητικό όριο'
))
->
setDescription
(
t
(
'Αριθμητικό όριο.'
))
...
...
@@ -210,7 +230,7 @@ class EpalCriteria extends ContentEntityBase implements EpalCriteriaInterface {
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields
[
'moria'
]
=
BaseFieldDefinition
::
create
(
'float'
)
->
setLabel
(
t
(
'Μόρια'
))
->
setDescription
(
t
(
'Μόρια.'
))
...
...
@@ -228,7 +248,7 @@ class EpalCriteria extends ContentEntityBase implements EpalCriteriaInterface {
))
->
setDisplayConfigurable
(
'form'
,
TRUE
)
->
setDisplayConfigurable
(
'view'
,
TRUE
);
$fields
[
'mutual_disabled_id'
]
=
BaseFieldDefinition
::
create
(
'integer'
)
->
setLabel
(
t
(
'Id αμοιβαία αποκλειόμενου κριτηρίου'
))
->
setDescription
(
t
(
'Id αμοιβαία αποκλειόμενου κριτηρίου.'
))
...
...
source/components/director/director-view.ts
View file @
13b0bb76
...
...
@@ -28,7 +28,7 @@ import {
<option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option>
</select>
</div>
</div>
<div class="form-group">
<select #tmop class="form-control" *ngIf="(selectionBClass | async)" (change)="checkbclass(tmop,txoption)" formControlName="tomeas">
...
...
@@ -54,10 +54,10 @@ import {
Όνομα Μητέρας: {{StudentDetails$.motherfirstname}}<br>
Επώνυμο Μητέρας:{{StudentDetails$.mothersurname}}<br>
Ημερομηνία Γέννησης: {{StudentDetails$.birthdate}}<br>
<strong>Επιβεβαίωση Εγγραφής: </strong>
<strong>Επιβεβαίωση Εγγραφής: </strong>
<input #cb class="pull-right" type="checkbox" name="{{ StudentDetails$.id }}" (change)="updateCheckedOptions(StudentDetails$.id, $event)" >
</div>
</div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
...
...
@@ -84,7 +84,7 @@ import {
constructor
(
private
fb
:
FormBuilder
,
private
_hds
:
HelperDataService
,
private
_hds
:
HelperDataService
,
private
activatedRoute
:
ActivatedRoute
,
private
router
:
Router
)
{
...
...
@@ -99,7 +99,7 @@ import {
taxi
:
[
''
,
[]],
specialit
:
[
''
,
[]],
});
}
ngOnDestroy
()
...
...
@@ -111,11 +111,11 @@ import {
if
(
this
.
selectionBClass
)
this
.
selectionBClass
.
unsubscribe
();
if
(
this
.
selectionCClass
)
this
.
selectionCClass
.
unsubscribe
();
this
.
selectionCClass
.
unsubscribe
();
if
(
this
.
retrievedStudent
)
this
.
retrievedStudent
.
unsubscribe
();
}
ngOnInit
()
{
}
...
...
@@ -134,24 +134,23 @@ import {
{
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
"
)
{
{
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
console
.
log
(
sectorint
,
"
test
"
);
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
(
this
.
SchoolId
,
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
}
this
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
true
);
this
.
StudentSelected$
=
new
BehaviorSubject
([{}]);
this
.
selectionCClass
.
next
(
true
);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
this
.
StudentSelected$
);
}
}
}
...
...
@@ -163,13 +162,13 @@ import {
if
(
txop
.
value
===
"
3
"
)
{
this
.
StudentSelectedSpecial$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
this
.
StudentSelectedSpecialSub
=
this
.
_hds
.
getSpecialityPerSchool
(
this
.
SchoolId
,
sectorint
).
subscribe
(
this
.
StudentSelectedSpecial$
);
}
}
findstudent
(
txop
)
{
var
sectorint
=
+
this
.
formGroup
.
value
.
tomeas
;
if
(
txop
.
value
===
"
1
"
)
{
...
...
@@ -180,15 +179,15 @@ import {
this
.
currentclass
=
2
;
}
else
if
(
txop
.
value
===
"
3
"
)
{
{
this
.
currentclass
=
3
;
}
}
this
.
retrievedStudent
.
next
(
true
);
this
.
StudentInfo$
=
new
BehaviorSubject
(
false
);
this
.
StudentInfoSub
=
this
.
_hds
.
getStudentPerSchool
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
).
subscribe
(
this
.
StudentInfo$
);
this
.
StudentInfoSub
=
this
.
_hds
.
getStudentPerSchool
(
this
.
SchoolId
,
sectorint
,
this
.
currentclass
).
subscribe
(
this
.
StudentInfo$
);
}
updateCheckedOptions
(
id
,
event
)
...
...
@@ -196,8 +195,8 @@ updateCheckedOptions(id, event)
let
i
=
this
.
saved
.
length
;
if
(
event
.
target
.
checked
===
false
)
if
(
event
.
target
.
checked
===
false
)
{
var
count
=
this
.
saved
.
length
;
for
(
var
j
=
0
;
j
<
count
;
j
++
)
...
...
@@ -225,4 +224,4 @@ checkcclass()
this
.
retrievedStudent
.
next
(
false
);
}
}
\ No newline at end of file
}
source/services/helper-data-service.ts
View file @
13b0bb76
...
...
@@ -51,10 +51,12 @@ export class HelperDataService implements OnInit, OnDestroy{
}
getEpalUserData
()
{
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
)
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
get
(
0
)
.
auth_role
;
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
});
...
...
@@ -65,10 +67,12 @@ export class HelperDataService implements OnInit, OnDestroy{
};
sendVerificationCode
(
email
)
{
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
)
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
get
(
0
)
.
auth_role
;
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
// "Accept": "*/*",
...
...
@@ -92,10 +96,12 @@ export class HelperDataService implements OnInit, OnDestroy{
}
verifyVerificationCode
(
verificationCode
)
{
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
)
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
get
(
0
)
.
auth_role
;
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
// "Accept": "*/*",
...
...
@@ -120,10 +126,12 @@ export class HelperDataService implements OnInit, OnDestroy{
}
saveProfile
(
userProfile
)
{
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
)
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
get
(
0
)
.
auth_role
;
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
auth_token
;
this
.
authRole
=
loginInfoToken
.
auth_role
;
});
console
.
log
(
"
authToken=
"
+
this
.
authToken
);
console
.
log
(
"
authRole=
"
+
this
.
authRole
);
let
headers
=
new
Headers
({
"
Content-Type
"
:
"
application/json
"
,
});
...
...
@@ -145,10 +153,12 @@ export class HelperDataService implements OnInit, OnDestroy{
getCourseFields
()
{