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
Show 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,16 +14,21 @@ 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'
)
);
}
...
...
@@ -34,10 +39,23 @@ 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
;
...
...
@@ -60,7 +78,7 @@ public function getSectorsPerSchool(Request $request, $epalId)
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"School not found!!!"
),
],
Response
::
HTTP_
FORBIDDEN
);
],
Response
::
HTTP_
OK
);
}
...
...
@@ -79,10 +97,21 @@ 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
;
...
...
@@ -111,7 +140,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"School not found!!!"
),
],
Response
::
HTTP_
FORBIDDEN
);
],
Response
::
HTTP_
OK
);
}
...
...
@@ -131,10 +160,22 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$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
)
...
...
@@ -180,7 +221,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"No students found!!!"
),
],
Response
::
HTTP_
FORBIDDEN
);
],
Response
::
HTTP_
OK
);
}
...
...
@@ -207,9 +248,21 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
}
$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
())
...
...
@@ -259,9 +312,20 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
$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
())
...
...
@@ -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
...
...
@@ -193,6 +193,26 @@ 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
(
'Αριθμητικό όριο.'
))
...
...
source/components/director/director-view.ts
View file @
13b0bb76
...
...
@@ -134,7 +134,7 @@ 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
"
)
...
...
@@ -144,12 +144,11 @@ 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
.
selectionBClass
.
next
(
true
);
this
.
selectionCClass
.
next
(
true
);
this
.
StudentSelected$
=
new
BehaviorSubject
([{}]);
this
.
StudentSelectedSub
=
this
.
_hds
.
getSectorPerSchool
(
this
.
SchoolId
).
subscribe
(
this
.
StudentSelected$
);
}
}
...
...
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
()
{
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
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
...
@@ -178,10 +188,12 @@ export class HelperDataService implements OnInit, OnDestroy{
};
getSectorFields
()
{
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
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
...
@@ -210,10 +222,12 @@ export class HelperDataService implements OnInit, OnDestroy{
};
getRegionsWithSchools
(
classActive
,
courseActive
)
{
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
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
...
@@ -252,10 +266,12 @@ export class HelperDataService implements OnInit, OnDestroy{
};
getSectorsWithCourses
()
{
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
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
...
@@ -327,11 +343,12 @@ export class HelperDataService implements OnInit, OnDestroy{
getCriteria
()
{
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
console
.
log
(
loginInfoToken
.
get
(
0
));
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
"
,
"
X-CSRF-Token
"
:
"
LU92FaWYfImfZxfldkF5eVnssdHoV7Aa9fg8K1bWYUc
"
,
...
...
@@ -394,10 +411,12 @@ export class HelperDataService implements OnInit, OnDestroy{
}
signOut
()
{
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
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
// "Authorization": "Basic bmthdHNhb3Vub3M6emVtcmFpbWU=",
...
...
@@ -440,9 +459,12 @@ export class HelperDataService implements OnInit, OnDestroy{
getSubmittedPreviw
()
{
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
"
id
"
:
""
...
...
@@ -457,9 +479,12 @@ export class HelperDataService implements OnInit, OnDestroy{
getStudentDetails
(
headerid
)
{
let
headerIdNew
=
headerid
.
toString
();
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
});
...
...
@@ -473,9 +498,12 @@ export class HelperDataService implements OnInit, OnDestroy{
getEpalchosen
(
headerid
)
{
let
headerIdNew
=
headerid
.
toString
();
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
});
...
...
@@ -489,9 +517,12 @@ export class HelperDataService implements OnInit, OnDestroy{
getSectorPerSchool
(
SchoolId
)
{
let
SchoolIdNew
=
SchoolId
.
toString
();
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
});
...
...
@@ -505,9 +536,12 @@ export class HelperDataService implements OnInit, OnDestroy{
{
let
SchoolIdNew
=
SchoolId
.
toString
();
let
SectorIdNew
=
SectorId
.
toString
();
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
});
...
...
@@ -547,9 +581,12 @@ export class HelperDataService implements OnInit, OnDestroy{
saveConfirmStudents
(
students
)
{
console
.
log
(
students
,
"
hds
"
);
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
});
...
...
@@ -576,9 +613,12 @@ export class HelperDataService implements OnInit, OnDestroy{
{
console
.
log
(
taxi
,
capacity
,
"
hds
"
);
this
.
loginInfo$
.
forEach
(
loginInfoToken
=>
{
this
.
authToken
=
loginInfoToken
.
get
(
0
).
auth_token
;
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
"
,
});
...
...
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