added redux field and mechanism check for app edit prohibition refering to schooltype modification

parent 34163fcb
This diff is collapsed.
......@@ -216,7 +216,7 @@ class PDFCreator extends ControllerBase {
$this->pdf->SetFont($this->fontLight, '', 11);
//if ($this->applicantsResultsDisabled === "1")
if ($status === "0" || $status === "3" || $status === "4")
if ($status === "0" || $status === "3" || $status === "4" || $status === "5" || $status === "6" || $status === "7")
$this->pdf->MultiCell(0, 8, $this->prepareString('(Αρχική)'), 0, 'R');
else
$this->pdf->MultiCell(0, 8, $this->prepareString('(Οριστική)'), 0, 'R');
......
......@@ -2273,7 +2273,8 @@ class ReportsCreator extends ControllerBase
->fields('eStudent', array('name','studentsurname','regionaddress', 'regiontk', 'regionarea','telnum'))
->condition('eStudent.id', $epalStudentClass->student_id, '=')
->condition('eStudent.delapp', 0 , '=')
->condition('eStudent.myschool_promoted', 2 , '<=');
->condition('eStudent.myschool_promoted', 2 , '<=')
->condition('eStudent.myschool_promoted', 1 , '>=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalStudents as $epalStudent) {
array_push($idColumn, $epalStudentClass->student_id);
......@@ -2329,7 +2330,8 @@ class ReportsCreator extends ControllerBase
->fields('eStudent', array('name','studentsurname','regionaddress', 'regiontk', 'regionarea','telnum'))
->condition('eStudent.delapp', 0 , '=')
->condition('eStudent.id', $epalStudentClass->student_id, '=')
->condition('eStudent.myschool_promoted', 2 , '<=');
->condition('eStudent.myschool_promoted', 2 , '<=')
->condition('eStudent.myschool_promoted', 1 , '>=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalStudents as $epalStudent) {
array_push($idColumn, $epalStudentClass->student_id);
......@@ -2375,7 +2377,8 @@ class ReportsCreator extends ControllerBase
->fields('eStudent', array('name','studentsurname','regionaddress', 'regiontk', 'regionarea','telnum'))
->condition('eStudent.delapp', 0 , '=')
->condition('eStudent.id', $epalStudentClass->student_id, '=')
->condition('eStudent.myschool_promoted', 2 , '<=');
->condition('eStudent.myschool_promoted', 2 , '<=')
->condition('eStudent.myschool_promoted', 1 , '>=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalStudents as $epalStudent) {
array_push($idColumn, $epalStudentClass->student_id);
......@@ -2421,7 +2424,8 @@ class ReportsCreator extends ControllerBase
->fields('eStudent', array('name','studentsurname','regionaddress', 'regiontk', 'regionarea','telnum'))
->condition('eStudent.delapp', 0 , '=')
->condition('eStudent.id', $epalStudentClass->student_id, '=')
->condition('eStudent.myschool_promoted', 2 , '<=');
->condition('eStudent.myschool_promoted', 2 , '<=')
->condition('eStudent.myschool_promoted', 1 , '>=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalStudents as $epalStudent) {
array_push($idColumn, $epalStudentClass->student_id);
......@@ -2487,6 +2491,7 @@ class ReportsCreator extends ControllerBase
], Response::HTTP_FORBIDDEN);
}
$schoolid = $user->init->value;
//$schoolid = 2792;
//user role validation
$roles = $user->getRoles();
......@@ -2537,7 +2542,8 @@ class ReportsCreator extends ControllerBase
->fields('eStudent', array('id', 'name', 'studentsurname','regionaddress', 'regiontk', 'regionarea','telnum','directorconfirm'))
->condition('eStudent.id', $gelClass->student_id, '=')
->condition('eStudent.delapp', 0 , '=')
->condition('eStudent.myschool_promoted', 2 , '<=');
->condition('eStudent.myschool_promoted', 2 , '<=')
->condition('eStudent.myschool_promoted', 1 , '>=');
$gelStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($gelStudents as $gelStudent) {
array_push($idColumn, $gelStudent->id);
......@@ -2587,6 +2593,7 @@ class ReportsCreator extends ControllerBase
->fields('eStudent', array('id', 'name', 'studentsurname','regionaddress', 'regiontk', 'regionarea','telnum','directorconfirm'))
->condition('eStudent.lastschool_registrynumber', $gelSchool->registry_no , '=')
->condition('eStudent.myschool_promoted', 2 , '<=')
->condition('eStudent.myschool_promoted', 1 , '>=')
->condition('eStudent.delapp', 0 , '=')
->condition('eStudent.nextclass', $k, '=');
......
......@@ -190,7 +190,7 @@ class PDFCreator extends ControllerBase {
$this->pdf->SetFont($this->fontLight, '', 11);
//if ($this->applicantsResultsDisabled === "1")
if ($status === "0" || $status === "4")
if ($status === "0" || $status === "2" || $status === "3" || $status === "5" || $status === "6" || $status === "7")
$this->pdf->MultiCell(0, 8, $this->prepareString('(Αρχική)'), 0, 'R');
else
$this->pdf->MultiCell(0, 8, $this->prepareString('(Οριστική)'), 0, 'R');
......
......@@ -162,7 +162,7 @@ class CurrentUser extends ControllerBase
public function getApplicantUserData(Request $request)
{
//test
//for ($k=0;$k<2;$k++)
//for ($k=0;$k<14;$k++)
// $this->logger->warning(\Drupal::service('uuid')->generate() );
$authToken = $request->headers->get('PHP_AUTH_USER');
......
No preview for this file type
......@@ -195,6 +195,7 @@ import { StudentCourseChosen, StudentEpalChosen, StudentSectorChosen } from "../
private disclaimer_checked: number;
private hasright: number;
private app_update: BehaviorSubject<boolean>;
private apptype: BehaviorSubject<string>;
private appId: BehaviorSubject<string>;
private previousClass: BehaviorSubject<string>;
private previousSector: BehaviorSubject<string>;
......@@ -234,6 +235,7 @@ import { StudentCourseChosen, StudentEpalChosen, StudentSectorChosen } from "../
this.showLoader = new BehaviorSubject(false);
this.app_update = new BehaviorSubject(false);
this.appId = new BehaviorSubject("");
this.apptype = new BehaviorSubject("epal");
this.previousClass = new BehaviorSubject("");
this.previousSector = new BehaviorSubject("");
......@@ -301,6 +303,7 @@ import { StudentCourseChosen, StudentEpalChosen, StudentSectorChosen } from "../
if (datamode.get("app_update") === true) {
this.app_update.next(true);
this.appId.next(datamode.get("appid"));
this.apptype.next(datamode.get("apptype"));
this.previousClass.next(datamode.get("currentclass"));
this.previousSector.next(datamode.get("sector_id"));
this.previousCourse.next(datamode.get("course_id"));
......@@ -420,6 +423,23 @@ import { StudentCourseChosen, StudentEpalChosen, StudentSectorChosen } from "../
submitNow(newapp) {
//not allowed to edit application targeted to other school type (epal)
if (this.app_update.getValue() && this.apptype.getValue() != "epal")
{
console.log("Error: trying to edit application in different schooltype.");
let mTitle = "Αποτυχία τροποποίησης αίτησης";
let mText = "Δεν έχετε δικαίωμα να τροποποιήσετε αίτηση για άλλο τύπο σχολείου. " +
"Παρακαλώ σε περίπτωση που θέλετε να κάνετε Νέα Αίτηση, πατήστε την επιλογή 'Νέα' που βρίσκετε πάνω αριστερά στην οθόνη της εφαρμογής.";
let mHeader = "modal-header-danger";
this.modalTitle.next(mTitle);
this.modalText.next(mText);
this.modalHeader.next(mHeader);
this.showModal();
(<any>$(".loading")).remove();
this.showLoader.next(false);
return;
}
//έλεγχος αν πρέπει να γίνει έλεγχος πληρότητας
let nonCheckOccupancy = "$";
if (newapp === false) {
......
......@@ -216,6 +216,7 @@ import { StudentGelCourseChosen } from "../students/student";
private hasright: number;
private app_update: BehaviorSubject<boolean>;
private appId: BehaviorSubject<string>;
private apptype: BehaviorSubject<string>;
//private wsIdentSub: Subscription;
private wsEnabled: BehaviorSubject<number>;
private limitSchoolYear: string;
......@@ -252,6 +253,7 @@ import { StudentGelCourseChosen } from "../students/student";
this.showLoader = new BehaviorSubject(false);
this.app_update = new BehaviorSubject(false);
this.appId = new BehaviorSubject("");
this.apptype = new BehaviorSubject("gel");
this.orientationSelected = new BehaviorSubject(-1);
this.classSelected = new BehaviorSubject(-1);
this.wsEnabled = new BehaviorSubject(-1);
......@@ -311,6 +313,7 @@ import { StudentGelCourseChosen } from "../students/student";
if (datamode.get("app_update") === true) {
this.app_update.next(true);
this.appId.next(datamode.get("appid"));
this.apptype.next(datamode.get("apptype"));
}
return datamode;
}, {});
......@@ -423,6 +426,24 @@ import { StudentGelCourseChosen } from "../students/student";
if (this.gelstudentDataFields$.getValue().size === 0 || this.gelclasses$.getValue().size === 0 || this.loginInfo$.getValue().size === 0)
return;
//not allowed to edit application targeted to other school type (gel)
if (this.app_update.getValue() && this.apptype.getValue() != "gel")
{
console.log("Error: trying to edit application in different schooltype.");
let mTitle = "Αποτυχία τροποποίησης αίτησης";
let mText = "Δεν έχετε δικαίωμα να τροποποιήσετε αίτηση για άλλο τύπο σχολείου. " +
"Παρακαλώ σε περίπτωση που θέλετε να κάνετε Νέα Αίτηση, πατήστε την επιλογή 'Νέα' που βρίσκετε πάνω αριστερά στην οθόνη της εφαρμογής.";
let mHeader = "modal-header-danger";
this.modalTitle.next(mTitle);
this.modalText.next(mText);
this.modalHeader.next(mHeader);
this.showModal();
(<any>$(".loading")).remove();
this.showLoader.next(false);
return;
}
let aitisiObj: Array<any> = [];
let std = this.gelstudentDataFields$.getValue().get(0);
//aitisiObj[0]: στοιχεία μαθητών
......
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