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
628a738b
Commit
628a738b
authored
Aug 01, 2017
by
Χάρης Παπαδόπουλος
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'edge_v4' into 'develop_v4'
Restructured ILoginInfo See merge request !244
parents
94b9c239
b790526b
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
328 additions
and
514 deletions
+328
-514
drupal/modules/epal/src/Controller/DirectorView.php
drupal/modules/epal/src/Controller/DirectorView.php
+60
-41
source/app.ts
source/app.ts
+1
-1
source/components/director/director-classcapacity.ts
source/components/director/director-classcapacity.ts
+0
-14
source/components/director/director-view.ts
source/components/director/director-view.ts
+0
-30
source/components/header/header.component.ts
source/components/header/header.component.ts
+8
-15
source/components/home.ts
source/components/home.ts
+10
-9
source/components/infoviews/eduadmin-view.ts
source/components/infoviews/eduadmin-view.ts
+0
-1
source/components/infoviews/perfecture-view.ts
source/components/infoviews/perfecture-view.ts
+0
-3
source/components/minister/minister-informstudents.ts
source/components/minister/minister-informstudents.ts
+7
-9
source/components/minister/minister-reports.ts
source/components/minister/minister-reports.ts
+11
-14
source/components/minister/minister-settings.ts
source/components/minister/minister-settings.ts
+7
-20
source/components/minister/minister-view.ts
source/components/minister/minister-view.ts
+7
-13
source/components/minister/report-all-stat.ts
source/components/minister/report-all-stat.ts
+14
-43
source/components/minister/report-general.ts
source/components/minister/report-general.ts
+7
-16
source/components/minister/report-no-capacity.ts
source/components/minister/report-no-capacity.ts
+7
-16
source/components/minister/report-users.ts
source/components/minister/report-users.ts
+7
-15
source/components/ministry.home.ts
source/components/ministry.home.ts
+7
-10
source/components/navbar/navbar.component.ts
source/components/navbar/navbar.component.ts
+10
-13
source/components/school.home.ts
source/components/school.home.ts
+8
-8
source/components/student-application-form/after.submit.ts
source/components/student-application-form/after.submit.ts
+8
-8
source/components/student-application-form/application.form.main.ts
...ponents/student-application-form/application.form.main.ts
+5
-7
source/components/student-application-form/application.submit.ts
...components/student-application-form/application.submit.ts
+12
-17
source/components/student-application-form/disclaimer.ts
source/components/student-application-form/disclaimer.ts
+8
-8
source/components/student-application-form/help-desk.ts
source/components/student-application-form/help-desk.ts
+9
-9
source/components/student-application-form/info.ts
source/components/student-application-form/info.ts
+4
-3
source/components/student-application-form/region.schools.select.ts
...ponents/student-application-form/region.schools.select.ts
+0
-4
source/components/student-application-form/sector.fields.select.ts
...mponents/student-application-form/sector.fields.select.ts
+1
-9
source/components/student-application-form/submited.aplication.preview.ts
...s/student-application-form/submited.aplication.preview.ts
+0
-1
source/containers/main.ts
source/containers/main.ts
+3
-3
source/services/auth.service.ts
source/services/auth.service.ts
+61
-61
source/services/helper-data-service.ts
source/services/helper-data-service.ts
+9
-36
source/store/index.ts
source/store/index.ts
+4
-2
source/store/logininfo/index.ts
source/store/logininfo/index.ts
+4
-3
source/store/logininfo/logininfo.initial-state.ts
source/store/logininfo/logininfo.initial-state.ts
+2
-2
source/store/logininfo/logininfo.reducer.ts
source/store/logininfo/logininfo.reducer.ts
+19
-25
source/store/logininfo/logininfo.transformers.ts
source/store/logininfo/logininfo.transformers.ts
+3
-21
source/store/logininfo/logininfo.types.ts
source/store/logininfo/logininfo.types.ts
+4
-2
source/store/store.ts
source/store/store.ts
+1
-1
source/store/studentdatafields/studentdatafields.types.ts
source/store/studentdatafields/studentdatafields.types.ts
+0
-1
No files found.
drupal/modules/epal/src/Controller/DirectorView.php
View file @
628a738b
...
...
@@ -81,7 +81,6 @@ class DirectorView extends ControllerBase
'error_code'
=>
4003
,
],
Response
::
HTTP_FORBIDDEN
);
}
elseif
(
$userRole
===
'epal'
)
{
$selectIdNew
=
$selectId
;
if
(
$classId
==
1
)
{
$selectIdNew
=
-
1
;
}
elseif
(
$classId
==
2
)
{
...
...
@@ -374,6 +373,7 @@ class DirectorView extends ControllerBase
$userRole
=
$tmpRole
;
}
}
if
(
$userRole
===
''
)
{
return
$this
->
respondWithStatus
([
'error_code'
=>
4003
,
...
...
@@ -390,6 +390,7 @@ class DirectorView extends ControllerBase
}
else
{
$schools
=
[];
}
if
(
$schools
)
{
$list
=
array
();
...
...
@@ -582,6 +583,27 @@ class DirectorView extends ControllerBase
}
}
protected
function
getLimit
(
$name
,
$categ
)
{
static
$limits
=
array
();
$key
=
"
{
$name
}
_
{
$categ
}
"
;
if
(
isset
(
$limits
[
$key
]))
{
$limit
=
$limits
[
$key
];
}
else
{
$limit_down
=
$this
->
entityTypeManager
->
getStorage
(
'epal_class_limits'
)
->
loadByProperties
(
array
(
'name'
=>
$name
,
'category'
=>
$categ
));
$limitdown
=
reset
(
$limit_down
);
if
(
$limitdown
)
{
$limit
=
$limitdown
->
limit_down
->
value
;
}
else
{
$limit
=
-
1
;
}
$limits
[
$key
]
=
$limit
;
}
return
$limit
;
}
public
function
returnstatus
(
$id
)
{
$schoolid
=
$id
;
...
...
@@ -595,13 +617,7 @@ class DirectorView extends ControllerBase
$CourseA
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student'
)
->
loadByProperties
(
array
(
'id'
=>
$schoolid
));
if
(
$CourseA
)
{
$limit_down
=
$this
->
entityTypeManager
->
getStorage
(
'epal_class_limits'
)
->
loadByProperties
(
array
(
'name'
=>
1
,
'category'
=>
$categ
));
$limitdown
=
reset
(
$limit_down
);
if
(
$limitdown
)
{
$limit
=
$limitdown
->
limit_down
->
value
;
}
else
{
$limit
=
-
1
;
}
$limit
=
$this
->
getLimit
(
1
,
$categ
);
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialization_id'
=>
-
1
,
'currentclass'
=>
1
));
...
...
@@ -610,42 +626,45 @@ class DirectorView extends ControllerBase
}
}
$CourseB
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_sectors_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
));
if
(
$CourseB
)
{
$limit_down
=
$this
->
entityTypeManager
->
getStorage
(
'epal_class_limits'
)
->
loadByProperties
(
array
(
'name'
=>
2
,
'category'
=>
$categ
));
$limitdown
=
reset
(
$limit_down
);
if
(
$limitdown
)
{
$limit
=
$limitdown
->
limit_down
->
value
;
}
else
{
$limit
=
-
1
;
}
foreach
(
$CourseB
as
$object
)
{
$sectorid
=
$object
->
sector_id
->
entity
->
id
();
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialization_id'
=>
$sectorid
,
'currentclass'
=>
2
));
if
(
sizeof
(
$studentPerSchool
)
<
$limit
)
{
return
false
;
}
$limit
=
$this
->
getLimit
(
2
,
$categ
);
$sCon
=
$this
->
connection
->
select
(
'eepal_sectors_in_epal_field_data'
,
'eSchool'
);
$sCon
->
leftJoin
(
'epal_student_class'
,
'eStudent'
,
'eStudent.epal_id = '
.
$schoolid
.
' '
.
'AND eStudent.specialization_id = eSchool.sector_id '
.
'AND eStudent.currentclass = 2'
);
$sCon
->
fields
(
'eSchool'
,
array
(
'sector_id'
))
->
fields
(
'eStudent'
,
array
(
'specialization_id'
))
->
groupBy
(
'specialization_id'
)
->
groupBy
(
'sector_id'
)
->
condition
(
'eSchool.epal_id'
,
$schoolid
,
'='
);
$sCon
->
addExpression
(
'count(eStudent.id)'
,
'eStudent_count'
);
$results
=
$sCon
->
execute
()
->
fetchAll
(
\
PDO
::
FETCH_OBJ
);
foreach
(
$results
as
$result
)
{
if
(
$result
->
eStudent_count
<
$limit
)
{
return
false
;
}
}
$CourseC
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialties_in_epal'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
));
if
(
$CourseC
)
{
$limit_down
=
$this
->
entityTypeManager
->
getStorage
(
'epal_class_limits'
)
->
loadByProperties
(
array
(
'name'
=>
3
,
'category'
=>
$categ
));
$limitdown
=
reset
(
$limit_down
);
if
(
$limitdown
)
{
$limit
=
$limitdown
->
limit_down
->
value
;
}
else
{
$limit
=
-
1
;
}
foreach
(
$CourseC
as
$object
)
{
$specialityid
=
$object
->
specialty_id
->
entity
->
id
();
$studentPerSchool
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_class'
)
->
loadByProperties
(
array
(
'epal_id'
=>
$schoolid
,
'specialization_id'
=>
$specialityid
,
'currentclass'
=>
3
));
if
(
sizeof
(
$studentPerSchool
)
<
$limit
)
{
return
false
;
}
$limit
=
$this
->
getLimit
(
3
,
$categ
);
$sCon
=
$this
->
connection
->
select
(
'eepal_specialties_in_epal_field_data'
,
'eSchool'
);
$sCon
->
leftJoin
(
'epal_student_class'
,
'eStudent'
,
'eStudent.epal_id = '
.
$schoolid
.
' '
.
'AND eStudent.specialization_id = eSchool.specialty_id '
.
'AND eStudent.currentclass = 3'
);
$sCon
->
fields
(
'eSchool'
,
array
(
'specialty_id'
))
->
fields
(
'eStudent'
,
array
(
'specialization_id'
))
->
groupBy
(
'specialization_id'
)
->
groupBy
(
'specialty_id'
)
->
condition
(
'eSchool.epal_id'
,
$schoolid
,
'='
);
$sCon
->
addExpression
(
'count(eStudent.id)'
,
'eStudent_count'
);
$results
=
$sCon
->
execute
()
->
fetchAll
(
\
PDO
::
FETCH_OBJ
);
foreach
(
$results
as
$result
)
{
if
(
$result
->
eStudent_count
<
$limit
)
{
return
false
;
}
}
...
...
source/app.ts
View file @
628a738b
...
...
@@ -101,5 +101,5 @@ class MyLocalization extends NgLocalization {
})
class
AppModule
{
}
//
enableProdMode();
enableProdMode
();
platformBrowserDynamic
().
bootstrapModule
(
AppModule
);
source/components/director/director-classcapacity.ts
View file @
628a738b
...
...
@@ -8,7 +8,6 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
VALID_CAPACITY_PATTERN
}
from
"
../../constants
"
;
import
{
maxValue
}
from
"
../../constants
"
;
import
{
minValue
}
from
"
../../constants
"
;
...
...
@@ -66,7 +65,6 @@ import {
</form>
</div>
<div id="checksaved1" (onHidden)="onHidden('#checksaved1')"
class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
...
...
@@ -102,10 +100,6 @@ import {
private
courseActive
=
<
number
>-
1
;
private
showLoader
:
BehaviorSubject
<
boolean
>
;
constructor
(
private
fb
:
FormBuilder
,
private
_hds
:
HelperDataService
,
private
activatedRoute
:
ActivatedRoute
,
...
...
@@ -121,8 +115,6 @@ import {
}
public
showModal
(
popupMsgId
):
void
{
(
<
any
>
$
(
popupMsgId
)).
modal
(
"
show
"
);
}
...
...
@@ -135,7 +127,6 @@ import {
}
ngOnDestroy
()
{
}
...
...
@@ -153,7 +144,6 @@ import {
});
}
handleChange
(
e
:
Event
)
{
this
.
newvalue
=
e
.
target
[
"
value
"
];
}
...
...
@@ -166,7 +156,6 @@ import {
else
{
this
.
showLoader
.
next
(
true
);
let
std
=
this
.
CapacityPerCourse$
.
getValue
();
std
[
ind
].
capacity
=
this
.
newvalue
;
this
.
saveCapacitySub
=
this
.
_hds
.
saveCapacity
(
taxi
,
sect
,
spec
,
this
.
newvalue
).
subscribe
(
data
=>
{
...
...
@@ -179,9 +168,7 @@ import {
this
.
showLoader
.
next
(
false
);
console
.
log
(
"
Error Saving Capacity
"
);
});
}
}
else
{
if
(
oldvalue
===
null
)
...
...
@@ -189,7 +176,6 @@ import {
}
}
setActive
(
ind
)
{
this
.
courseActive
=
ind
;
}
...
...
source/components/director/director-view.ts
View file @
628a738b
...
...
@@ -8,12 +8,9 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
VALID_CAPACITY_PATTERN
}
from
"
../../constants
"
;
import
{
maxValue
}
from
"
../../constants
"
;
import
{
minValue
}
from
"
../../constants
"
;
import
{
FormBuilder
,
FormGroup
,
...
...
@@ -114,11 +111,6 @@ import {
<option value="3" [selected]="StudentDetails$.checkstatus != '0' && StudentDetails$.checkstatus != '1'">Δεν ελέγχθηκε</option>
</select>
</div>
<!-- <div class="col-md-2">
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent(StudentDetails$.id, cb, j)">
Ενημέρωση
</button>
</div> -->
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
...
...
@@ -277,8 +269,6 @@ import {
</div>
</div>
</div>
`
})
...
...
@@ -302,8 +292,6 @@ import {
private
sector
=
<
number
>
0
;
private
special
=
<
number
>
0
;
constructor
(
private
fb
:
FormBuilder
,
private
_hds
:
HelperDataService
,
private
activatedRoute
:
ActivatedRoute
,
...
...
@@ -321,7 +309,6 @@ import {
}
public
showConfirmModal
():
void
{
(
<
any
>
$
(
"
#applicationDeleteConfirm
"
)).
modal
(
"
show
"
);
}
...
...
@@ -337,7 +324,6 @@ import {
(
<
any
>
$
(
"
#applicationDeleteError
"
)).
modal
(
"
hide
"
);
}
public
showModal
(
popupMsgId
):
void
{
(
<
any
>
$
(
popupMsgId
)).
modal
(
"
show
"
);
}
...
...
@@ -351,7 +337,6 @@ import {
}
ngOnDestroy
()
{
(
<
any
>
$
(
"
#applicationDeleteConfirm
"
)).
remove
();
(
<
any
>
$
(
"
#applicationDeleteError
"
)).
remove
();
...
...
@@ -367,17 +352,14 @@ import {
this
.
CoursesPerSchoolSub
=
this
.
_hds
.
FindCoursesPerSchool
().
subscribe
(
x
=>
{
this
.
CoursesPerSchool$
.
next
(
x
);
this
.
showLoader
.
next
(
false
);
},
error
=>
{
this
.
CoursesPerSchool$
.
next
([{}]);
console
.
log
(
"
Error Getting courses perSchool
"
);
this
.
showLoader
.
next
(
false
);
});
}
findstudent
(
taxi
,
sector
,
special
)
{
this
.
showLoader
.
next
(
true
);
this
.
retrievedStudent
.
next
(
false
);
...
...
@@ -396,7 +378,6 @@ import {
}
setActive
(
ind
)
{
this
.
StudentActive
=
-
1
;
if
(
this
.
courseActive
===
ind
)
{
...
...
@@ -421,8 +402,6 @@ import {
this
.
StudentActive
=
ind
;
}
confirmStudent
(
student
,
cb
,
ind
)
{
let
rtype
;
if
(
cb
.
value
===
1
)
...
...
@@ -451,7 +430,6 @@ import {
});
}
deleteApplication
(
appId
:
number
,
taxi
,
sector
,
special
):
void
{
this
.
applicationId
=
appId
;
...
...
@@ -461,10 +439,6 @@ import {
this
.
showConfirmModal
();
}
deleteApplicationDo
():
void
{
this
.
hideConfirmModal
();
...
...
@@ -485,8 +459,6 @@ import {
console
.
log
(
"
Error Getting courses perSchool
"
);
this
.
showLoader
.
next
(
false
);
});
this
.
StudentInfoSub
=
this
.
_hds
.
getStudentPerSchool
(
this
.
taxi
,
this
.
sector
,
this
.
special
)
.
subscribe
(
data
=>
{
this
.
StudentInfo$
.
next
(
data
);
...
...
@@ -499,8 +471,6 @@ import {
this
.
showLoader
.
next
(
false
);
this
.
showModal
(
"
#emptyselection
"
);
});
}).
catch
(
err
=>
{
this
.
showErrorModal
();
this
.
showLoader
.
next
(
false
);
...
...
source/components/header/header.component.ts
View file @
628a738b
...
...
@@ -5,7 +5,7 @@ import { Injectable } from "@angular/core";
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
NgRedux
,
select
}
from
"
@angular-redux/store
"
;
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
ILoginInfo
,
ILoginInfoToken
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
ILoginInfo
Records
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
HelperDataService
}
from
"
../../services/helper-data-service
"
;
import
{
LoginInfoActions
}
from
"
../../actions/logininfo.actions
"
;
import
{
LOGININFO_INITIAL_STATE
}
from
"
../../store/logininfo/logininfo.initial-state
"
;
...
...
@@ -25,7 +25,7 @@ export default class HeaderComponent implements OnInit, OnDestroy {
private
studentRole
=
STUDENT_ROLE
;
private
authRole
:
string
;
private
cuName
:
string
;
private
loginInfo$
:
BehaviorSubject
<
ILoginInfo
>
;
private
loginInfo$
:
BehaviorSubject
<
ILoginInfo
Records
>
;
private
cuser
:
any
;
private
showLoader$
:
BehaviorSubject
<
boolean
>
;
private
modalTitle
:
BehaviorSubject
<
string
>
;
...
...
@@ -66,14 +66,14 @@ export default class HeaderComponent implements OnInit, OnDestroy {
ngOnInit
()
{
(
<
any
>
$
(
"
#headerNotice
"
)).
appendTo
(
"
body
"
);
this
.
loginInfoSub
=
this
.
_ngRedux
.
select
(
"
loginInfo
"
)
.
map
(
loginInfo
=>
<
ILoginInfo
>
loginInfo
)
.
map
(
loginInfo
=>
<
ILoginInfo
Records
>
loginInfo
)
.
subscribe
(
loginInfo
=>
{
if
(
loginInfo
.
size
>
0
)
{
loginInfo
.
reduce
(({},
loginInfo
Token
)
=>
{
this
.
authToken
=
loginInfo
Token
.
auth_token
;
this
.
authRole
=
loginInfo
Token
.
auth_role
;
this
.
cuName
=
loginInfo
Token
.
cu_name
;
return
loginInfo
Token
;
loginInfo
.
reduce
(({},
loginInfo
Obj
)
=>
{
this
.
authToken
=
loginInfo
Obj
.
auth_token
;
this
.
authRole
=
loginInfo
Obj
.
auth_role
;
this
.
cuName
=
loginInfo
Obj
.
cu_name
;
return
loginInfo
Obj
;
},
{});
if
(
this
.
hasvalue
===
false
)
{
...
...
@@ -88,17 +88,11 @@ export default class HeaderComponent implements OnInit, OnDestroy {
console
.
log
(
"
Error Getting courses perSchool
"
);
this
.
showLoader
.
next
(
false
);
});
}
}
this
.
loginInfo$
.
next
(
loginInfo
);
});
}
ngOnDestroy
()
{
...
...
@@ -106,7 +100,6 @@ export default class HeaderComponent implements OnInit, OnDestroy {
if
(
this
.
loginInfoSub
)
{
this
.
loginInfoSub
.
unsubscribe
();
}
}
signOut
()
{
...
...
source/components/home.ts
View file @
628a738b
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
OnInit
,
OnDestroy
,
Component
}
from
"
@angular/core
"
;
import
{
LoginInfoActions
}
from
"
../actions/logininfo.actions
"
;
import
{
ILoginInfo
}
from
"
../store/logininfo/logininfo.types
"
;
import
{
ILoginInfo
Records
}
from
"
../store/logininfo/logininfo.types
"
;
import
{
NgRedux
,
select
}
from
"
@angular-redux/store
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
IAppState
}
from
"
../store/store
"
;
...
...
@@ -60,7 +60,7 @@ export default class Home implements OnInit, OnDestroy {
private
authRole
:
string
;
private
name
:
any
;
private
xcsrftoken
:
any
;
private
loginInfo$
:
BehaviorSubject
<
ILoginInfo
>
;
private
loginInfo$
:
BehaviorSubject
<
ILoginInfo
Records
>
;
private
apiEndPoint
=
API_ENDPOINT
;
private
apiEndPointParams
=
API_ENDPOINT_PARAMS
;
private
loginInfoSub
:
Subscription
;
...
...
@@ -83,20 +83,21 @@ export default class Home implements OnInit, OnDestroy {
ngOnInit
()
{
this
.
loginInfoSub
=
this
.
_ngRedux
.
select
(
"
loginInfo
"
).
subscribe
(
loginInfo
=>
{
let
linfo
=
<
ILoginInfo
>
loginInfo
;
this
.
loginInfoSub
=
this
.
_ngRedux
.
select
(
"
loginInfo
"
)
.
map
(
loginInfo
=>
<
ILoginInfoRecords
>
loginInfo
)
.
subscribe
(
linfo
=>
{
if
(
linfo
.
size
>
0
)
{
linfo
.
reduce
(({},
loginInfo
Token
)
=>
{
this
.
authToken
=
loginInfo
Token
.
auth_token
;
this
.
authRole
=
loginInfo
Token
.
auth_role
;
linfo
.
reduce
(({},
loginInfo
Obj
)
=>
{
this
.
authToken
=
loginInfo
Obj
.
auth_token
;
this
.
authRole
=
loginInfo
Obj
.
auth_role
;
if
(
this
.
authToken
&&
this
.
authToken
.
length
>
0
&&
this
.
authRole
&&
this
.
authRole
===
STUDENT_ROLE
)
{
if
(
loginInfo
Token
.
lock_application
===
1
)
if
(
loginInfo
Obj
.
lock_application
===
1
)
this
.
router
.
navigate
([
"
/info
"
]);
else
{
this
.
router
.
navigate
([
"
/parent-form
"
]);
}
}
return
loginInfo
Token
;
return
loginInfo
Obj
;
},
{});
}
...
...
source/components/infoviews/eduadmin-view.ts
View file @
628a738b
...
...
@@ -7,7 +7,6 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
FormBuilder
,
...
...
source/components/infoviews/perfecture-view.ts
View file @
628a738b
...
...
@@ -7,8 +7,6 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
FormBuilder
,
FormGroup
,
...
...
@@ -124,7 +122,6 @@ import {
this
.
showModal
();
this
.
showLoader
.
next
(
false
);
});
}
calccolor
(
size
,
limit
)
{
...
...
source/components/minister/minister-informstudents.ts
View file @
628a738b
...
...
@@ -8,7 +8,7 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
ILoginInfo
Records
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
LOGININFO_INITIAL_STATE
}
from
"
../../store/logininfo/logininfo.initial-state
"
;
import
{
API_ENDPOINT
}
from
"
../../app.settings
"
;
...
...
@@ -109,7 +109,7 @@ import { API_ENDPOINT } from "../../app.settings";
@
Injectable
()
export
default
class
InformStudents
implements
OnInit
,
OnDestroy
{
loginInfo$
:
BehaviorSubject
<
ILoginInfo
>
;
loginInfo$
:
BehaviorSubject
<
ILoginInfo
Records
>
;
private
modalTitle
:
BehaviorSubject
<
string
>
;
private
modalText
:
BehaviorSubject
<
string
>
;
private
modalHeader
:
BehaviorSubject
<
string
>
;
...
...
@@ -143,13 +143,13 @@ import { API_ENDPOINT } from "../../app.settings";
(
<
any
>
$
(
"
#emaiSentNotice
"
)).
appendTo
(
"
body
"
);
this
.
loginInfoSub
=
this
.
_ngRedux
.
select
(
"
loginInfo
"
)
.
map
(
loginInfo
=>
<
ILoginInfo
>
loginInfo
)
.
map
(
loginInfo
=>
<
ILoginInfo
Records
>
loginInfo
)
.
subscribe
(
loginInfo
=>
{
if
(
loginInfo
.
size
>
0
)
{
loginInfo
.
reduce
(({
},
loginInfo
Token
)
=>
{
this
.
minedu_userName
=
loginInfo
Token
.
minedu_username
;
this
.
minedu_userPassword
=
loginInfo
Token
.
minedu_userpassword
;
return
loginInfo
Token
;
loginInfo
.
reduce
(({
},
loginInfo
Obj
)
=>
{
this
.
minedu_userName
=
loginInfo
Obj
.
minedu_username
;
this
.
minedu_userPassword
=
loginInfo
Obj
.
minedu_userpassword
;
return
loginInfo
Obj
;
},
{});
}
this
.
loginInfo$
.
next
(
loginInfo
);
...
...
@@ -160,7 +160,6 @@ import { API_ENDPOINT } from "../../app.settings";
this
.
successSending
=
-
1
;
this
.
retrieveSettings
();
}
ngOnDestroy
()
{
...
...
@@ -187,7 +186,6 @@ import { API_ENDPOINT } from "../../app.settings";
}
informUnlocatedStudents
(
unallocated
,
period
)
{
this
.
successSending
=
-
2
;
this
.
numSuccessMails
=
0
;
this
.
numFailMails
=
0
;
...
...
source/components/minister/minister-reports.ts
View file @
628a738b
...
...
@@ -8,7 +8,7 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
ILoginInfo
Records
}
from
"
../../store/logininfo/logininfo.types
"
;
import
{
LOGININFO_INITIAL_STATE
}
from
"
../../store/logininfo/logininfo.initial-state
"
;
import
{
MINISTRY_ROLE
,
PDE_ROLE
,
DIDE_ROLE
}
from
"
../../constants
"
;
...
...
@@ -27,8 +27,6 @@ import { API_ENDPOINT } from "../../app.settings";
// encapsulation: ViewEncapsulation.None,
template
:
`
<div style="min-height: 500px; ">
<h5> >Επιλογή Αναφοράς<br><br></h5>
...
...
@@ -88,7 +86,7 @@ import { API_ENDPOINT } from "../../app.settings";
@
Injectable
()
export
default
class
MinisterReports
implements
OnInit
,
OnDestroy
{
private
formGroup
:
FormGroup
;
private
loginInfo$
:
BehaviorSubject
<
ILoginInfo
>
;
private
loginInfo$
:
BehaviorSubject
<
ILoginInfo
Records
>
;
private
loginInfoSub
:
Subscription
;
private
apiEndPoint
=
API_ENDPOINT
;
private
minedu_userName
:
string
;
...
...
@@ -117,23 +115,22 @@ import { API_ENDPOINT } from "../../app.settings";
ngOnInit
()
{
this
.
loginInfoSub
=
this
.
_ngRedux
.
select
(
"
loginInfo
"
)
.
map
(
loginInfo
=>
<
ILoginInfo
>
loginInfo
)
.
map
(
loginInfo
=>
<
ILoginInfo
Records
>
loginInfo
)
.
subscribe
(
loginInfo
=>
{
if
(
loginInfo
.
size
>
0
)
{
loginInfo
.
reduce
(({},
loginInfo
Token
)
=>
{
this
.
minedu_userName
=
loginInfo
Token
.
minedu_username
;
this
.
minedu_userPassword
=
loginInfo
Token
.
minedu_userpassword
;
if
(
loginInfo
Token
.
auth_role
===
PDE_ROLE
||
loginInfoToken
.
auth_role
===
DIDE_ROLE
)
{
this
.
userRole
=
loginInfo
Token
.
auth_role
;
this
.
minedu_userName
=
loginInfo
Token
.
auth_token
;
this
.
minedu_userPassword
=
loginInfo
Token
.
auth_token
;
loginInfo
.
reduce
(({},
loginInfo
Obj
)
=>
{
this
.
minedu_userName
=
loginInfo
Obj
.
minedu_username
;
this
.
minedu_userPassword
=
loginInfo
Obj
.
minedu_userpassword
;
if
(
loginInfo
Obj
.
auth_role
===
PDE_ROLE
||
loginInfoObj
.
auth_role
===
DIDE_ROLE
)
{
this
.
userRole
=
loginInfo
Obj
.
auth_role
;
this
.
minedu_userName
=
loginInfo
Obj
.
auth_token
;
this
.
minedu_userPassword
=
loginInfo
Obj
.
auth_token
;
}
return
loginInfo
Token
;
return
loginInfo
Obj
;
},
{});
}
this
.
loginInfo$
.
next
(
loginInfo
);
},
error
=>
console
.
log
(
"
error selecting loginInfo
"
));
}
ngOnDestroy
()
{
...
...
source/components/minister/minister-settings.ts
View file @
628a738b
...
...
@@ -8,7 +8,7 @@ import { NgRedux, select } from "@angular-redux/store";
import
{
IAppState
}
from
"
../../store/store
"
;
import
{
Router
,
ActivatedRoute
,
Params
}
from
"
@angular/router
"
;
import
{
BehaviorSubject
,
Subscription
}
from
"
rxjs/Rx
"
;
import
{
ILoginInfo
}
from
"
../../store/logininfo/logininfo.types
"
;