Commit 60d95068 authored by Open Source Developer's avatar Open Source Developer

bugs fixed

parent 1b31d7e6
...@@ -43,7 +43,7 @@ public function getSectorsPerSchool(Request $request, $epalId) ...@@ -43,7 +43,7 @@ public function getSectorsPerSchool(Request $request, $epalId)
$user = reset($users); $user = reset($users);
if ($user) { 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' => $user->mail->value, 'id' => intval($epalId)));
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId, 'id' => intval($epalId))); $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => intval($epalId)));
$school = reset($schools); $school = reset($schools);
if (!$school) { if (!$school) {
$this->logger->warning("no access to this school=" . $user->id()); $this->logger->warning("no access to this school=" . $user->id());
...@@ -101,7 +101,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId) ...@@ -101,7 +101,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
$user = reset($users); $user = reset($users);
if ($user) { 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' => $user->mail->value, 'id' => intval($epalId)));
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId, 'id' => intval($epalId))); $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array( 'id' => intval($epalId)));
$school = reset($schools); $school = reset($schools);
if (!$school) { if (!$school) {
$this->logger->warning("no access to this school=" . $user->id()); $this->logger->warning("no access to this school=" . $user->id());
...@@ -164,7 +164,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas ...@@ -164,7 +164,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$user = reset($users); $user = reset($users);
if ($user) { 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' => $user->mail->value, 'id' => intval($epalId)));
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('registry_no' => $this->testSchoolId, 'id' => intval($epalId))); $schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array( 'id' => intval($epalId)));
$school = reset($schools); $school = reset($schools);
if (!$school) { if (!$school) {
$this->logger->warning("no access to this school=" . $user->id()); $this->logger->warning("no access to this school=" . $user->id());
...@@ -278,17 +278,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas ...@@ -278,17 +278,7 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken)); $users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users); $user = reset($users);
if ($user) { 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; $postData = null;
......
...@@ -80,7 +80,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -80,7 +80,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
</div> </div>
</ul> </ul>
<div *ngIf="currentUrl === '/submited-preview'"> <div *ngIf="currentUrl === '/application-submit'">
<div *ngFor="let studentDataField$ of studentDataFields$ | async;"> <div *ngFor="let studentDataField$ of studentDataFields$ | async;">
<ul class="list-group left-side-view" style="margin-bottom: 20px;"> <ul class="list-group left-side-view" style="margin-bottom: 20px;">
<li class="list-group-item active"> <li class="list-group-item active">
...@@ -119,7 +119,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -119,7 +119,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
<ul class="list-group left-side-view" style="margin-bottom: 20px;"> <ul class="list-group left-side-view" style="margin-bottom: 20px;">
<li class="list-group-item active"> <li class="list-group-item active">
<div *ngIf="currentUrl === '/submited-preview'"> <div *ngIf="currentUrl === '/application-submit'">
Κοινωνικά/Εισοδηματικά Κριτήρια Κοινωνικά/Εισοδηματικά Κριτήρια
</div> </div>
</li> </li>
...@@ -127,7 +127,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -127,7 +127,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
</div> </div>
</div> </div>
<div *ngIf="currentUrl === '/submited-preview'"> <div *ngIf="currentUrl === '/application-submit'">
<div *ngFor="let criteriaField$ of criteriaFields$ | async;"> <div *ngFor="let criteriaField$ of criteriaFields$ | async;">
<div *ngIf="criteriaField$.selected === true"> <div *ngIf="criteriaField$.selected === true">
{{criteriaField$.name}} {{criteriaField$.name}}
...@@ -172,6 +172,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st ...@@ -172,6 +172,7 @@ import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-st
ngOnInit() { ngOnInit() {
this.currentUrl = this.router.url; this.currentUrl = this.router.url;
console.log(this.currentUrl,"url");
this.sectorsSub = this._ngRedux.select(state => { this.sectorsSub = this._ngRedux.select(state => {
state.sectors.reduce((prevSector, sector) => { state.sectors.reduce((prevSector, sector) => {
sector.courses.reduce((prevCourse, course) => { sector.courses.reduce((prevCourse, course) => {
......
...@@ -56,7 +56,7 @@ import { HelperDataService } from '../../services/helper-data-service'; ...@@ -56,7 +56,7 @@ import { HelperDataService } from '../../services/helper-data-service';
</div> </div>
<application-preview-select></application-preview-select> <application-preview-select></application-preview-select>
<button type="button button-lg pull-right" *ngIf="(studentDataFields$ | async).size > 0 && (criteria$ | async).size > 0 && (regions$ | async).size > 0 && (epalclasses$ | async).size > 0 && (loginInfo$ | async).size > 0" class="btn-primary btn-lg pull-center" (click)="submitNow()">Υποβολή</button> <button type="button button-lg pull-right" *ngIf="(studentDataFields$ | async).size > 0 && (criteria$ | async).size > 0 && (regions$ | async).size > 0 && (epalclasses$ | async).size > 0 && (loginInfo$ | async).size > 0" class="btn-primary btn-lg pull-right" (click)="submitNow()">Υποβολή</button>
` `
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment