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
3b25e4a0
Commit
3b25e4a0
authored
May 02, 2017
by
Open Source Developer
Browse files
trans
parent
ef77a939
Changes
4
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/epal.routing.yml
View file @
3b25e4a0
...
...
@@ -7,7 +7,7 @@ epal.user.send_verification_code:
requirements
:
_user_is_logged_in
:
'
TRUE'
epal.user.verify_verification_code
:
path
:
'
/epal/user/verifyvercode'
path
:
'
/epal/user/verifyvercode'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
@@ -172,7 +172,14 @@ coursesperschools:
_controller
:
'
\Drupal\epal\Controller\DirectorView::getCoursesPerSchool'
requirements
:
_user_is_logged_in
:
'
TRUE'
limitpercateg
:
path
:
'
/epal/LimitPerCateg/{categ}/{classId}'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
_controller
:
'
\Drupal\epal\Controller\DirectorView::getLimitPerCateg'
requirements
:
_user_is_logged_in
:
'
TRUE'
drupal/modules/epal/src/Controller/DirectorView.php
View file @
3b25e4a0
...
...
@@ -538,7 +538,47 @@ public function SaveCapacity(Request $request,$taxi,$tomeas,$specialit,$schoolid
}
public
function
getLimitPerCateg
(
Request
$request
,
$categ
,
$classId
)
{
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
if
(
$user
)
{
$schools
=
$this
->
entityTypeManager
->
getStorage
(
'epal_class_limits'
)
->
loadByProperties
(
array
(
'name'
=>
$classId
,
'category'
=>
$categ
));
if
(
$schools
)
{
$list
=
array
();
foreach
(
$schools
as
$object
)
{
$list
[]
=
array
(
'limit_down'
=>
$object
->
limit_down
->
value
,
);
$i
++
;
}
return
$this
->
respondWithStatus
(
$list
,
Response
::
HTTP_OK
);
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"Perfecture not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
else
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"User not found!"
),
],
Response
::
HTTP_FORBIDDEN
);
}
}
private
function
respondWithStatus
(
$arr
,
$s
)
{
...
...
source/components/infoviews/perfecture-view.ts
View file @
3b25e4a0
...
...
@@ -50,8 +50,8 @@ import {
public
formGroup
:
FormGroup
;
private
SchoolsPerPerf$
:
BehaviorSubject
<
any
>
;
private
SchoolPerPerfSub
:
Subscription
;
private
LimitPerCateg
Sub
:
BehaviorSubject
<
any
>
;
private
LimitPerCateg
$
:
Subscription
;
private
LimitPerCateg
$
:
BehaviorSubject
<
any
>
;
private
LimitPerCateg
Sub
:
Subscription
;
private
CoursesPerPerf$
:
BehaviorSubject
<
any
>
;
private
CoursesPerPerfSub
:
Subscription
;
private
StudentsSize$
:
BehaviorSubject
<
any
>
;
...
...
source/services/helper-data-service.ts
View file @
3b25e4a0
...
...
@@ -726,8 +726,8 @@ export class HelperDataService implements OnInit, OnDestroy {
getLimitPerCateg
(
categ
,
classes
){
let
classesNew
=
classes
.
toString
();
console
.
log
(
categ
,
classes
,
"
aaaa
"
);
//
let classesNew = classes.toString();
this
.
loginInfo$
.
getValue
().
forEach
(
loginInfoToken
=>
{
...
...
@@ -741,7 +741,7 @@ export class HelperDataService implements OnInit, OnDestroy {
});
this
.
createAuthorizationHeader
(
headers
);
let
options
=
new
RequestOptions
({
headers
:
headers
});
return
this
.
http
.
get
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/LimitPerCateg/`
+
categ
+
classes
New
,
options
)
return
this
.
http
.
get
(
`
${
AppSettings
.
API_ENDPOINT
}
/epal/LimitPerCateg/`
+
categ
+
classes
,
options
)
.
map
(
response
=>
response
.
json
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment