Commit 2e111d71 authored by Open Source Developer's avatar Open Source Developer

conflicts

parents 9cc7ac0b ed2f86f3
......@@ -123,44 +123,6 @@ class CASLogin extends ControllerBase
}
$attributes = phpCAS::getAttributes();
/*
$isAllowed = true;
$att1 = $attributes[$this->allowed1];
$att2 = $attributes[$this->allowed2];
if (!isset($att1) || !isset($att2)) {
$isAllowed = false;
}
if (!is_array($attributes[$this->allowed1])) {
$attributes[$this->allowed1] = [$attributes[$this->allowed1]];
}
if (!is_array($attributes[$this->allowed2])) {
$attributes[$this->allowed2] = [$attributes[$this->allowed2]];
}
$found1 = false;
foreach ($attributes[$this->allowed1] as $value) {
if (1 === preg_match($this->allowed1Value, $value)) {
$found1 = true;
}
}
$found2 = false;
foreach ($attributes[$this->allowed2] as $value) {
if (1 === preg_match($this->allowed2Value, $value)) {
$found2 = true;
}
}
if (!$found1 || !$found2) {
$isAllowed = false;
}
if (!$isAllowed) {
$response = new Response();
$response->setContent(t('Access is allowed only to official school accounts'));
$response->setStatusCode(Response::HTTP_FORBIDDEN);
$response->headers->set('Content-Type', 'application/json;charset=UTF-8');
return $response;
}
*/
$CASUser = phpCAS::getUser();
$this->logger->warning($CASUser);
......@@ -173,28 +135,12 @@ class CASLogin extends ControllerBase
};
$umdobject = $filterAttribute("umdobject");
// $physicaldeliveryofficename = $filterAttribute("physicaldeliveryofficename");
/****** the following is for production : Χρήση μόνο από ΕΠΙΣΗΜΟΥΣ ΛΟΓΑΡΙΑΣΜΟΥΣ ***************************/
/*
if (!$umdobject || $umdobject !== "Account") {
return $this->redirectForbidden($configRowName, '5002');
}
if (!$physicaldeliveryofficename || preg_replace('/\s+/', '', $physicaldeliveryofficename) !== 'ΕΠΙΣΗΜΟΣΛΟΓΑΡΙΑΣΜΟΣ') {
return $this->redirectForbidden($configRowName, '5003');
}
*/
phpCAS::trace($umdobject);
// phpCAS::trace($physicaldeliveryofficename);
// $gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended');
$gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1);
$gsnunitcode = $filterAttribute('edupersonorgunitdn:gsnunitcode');
phpCAS::trace("$gsnunitcode=");
phpCAS::trace($gsnunitcode);
/* check if myschool account */
if (!$umdobject || $umdobject !== "ISaccount") {
return $this->redirectForbidden($configRowName, '5002');
......@@ -204,11 +150,8 @@ class CASLogin extends ControllerBase
}
/* end of checking myschool account */
$userAssigned = $this->assignRoleToUser($gsnunitcode);
if (sizeof($userAssigned) === 0) {
return $this->redirectForbidden($configRowName, '5004');
}
......
......@@ -44,7 +44,7 @@ class CASLogout extends ControllerBase
Connection $connection,
LoggerChannelFactoryInterface $loggerChannel
) {
$this->entityTypeManager = $entityTypeManager;
$this->entity_query = $entity_query;
$this->connection = $connection;
......@@ -117,10 +117,6 @@ class CASLogout extends ControllerBase
$user->setPassword(uniqid('pw'));
$user->save();
// $response = new Response();
// $response->setContent("{\"message\": \"Server logout successful\",\"next\": \"{$this->logoutRedirectUrl}\"}");
// $response->setStatusCode(Response::HTTP_OK);
// $response->headers->set('Content-Type', 'application/json');
$response = (new JsonResponse([
"message" => "Server logout successful",
......@@ -130,9 +126,6 @@ class CASLogout extends ControllerBase
session_unset();
session_destroy();
\Drupal::service('page_cache_kill_switch')->trigger();
// phpCAS::logout(array('service' => 'http://eduslim2.minedu.gov.gr/dist/#/school'));
// phpCAS::logoutWithRedirectService('http://eduslim2.minedu.gov.gr/dist/#/school');
// phpCAS::handleLogoutRequests();
session_start();
return $response;
......@@ -176,6 +169,7 @@ class CASLogout extends ControllerBase
$response = new Response();
$response->setContent("{\"message\": \"Server logout continue\",\"next\": \"{$this->logoutRedirectUrl}\"}");
$response->setStatusCode(Response::HTTP_OK);
$response->headers->set('Content-Type', 'application/json');
......
......@@ -28,7 +28,7 @@ import {
<div style="min-height: 500px;">
<form [formGroup]="formGroup">
<p style="margin-top: 20px; line-height: 2em;"> Στην παρακάτω λίστα βλέπετε τα τμήματα του σχολείου σας με την αντίστοιχη δυναμίκη τους σε αίθουσες. Παρακαλώ για να τροποποποιήσετε τη δυναμικήαυτή κάντε κλικ στον αντίστοιχο σύμβολο,
επιλέξτε τη νέα δυναμική και πατήστε το σύμβολο <i>ok</i>. Προσοχή! Κανένα τμήμα δεν πρέπει να έχει δυναμική 0.</p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Οι δηλώσεις σας </b></div>
......@@ -42,17 +42,17 @@ import {
<label style="font-weight:bold!important" *ngIf="!isEdit || CapacityPerCourses$.globalindex !== courseActive" > {{CapacityPerCourses$.capacity}} </label>
<i *ngIf="!isEdit || CapacityPerCourses$.globalindex !== courseActive" (click)= "modifycapc(i,$event)" class="fa fa-pencil isclickable pull-right" style="font-size: 1.5em;"></i>
<input *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive"
id="{{CapacityPerCourses$.globalindex}}" type="number"
id="{{CapacityPerCourses$.globalindex}}" type="number"
name="{{CapacityPerCourses$.globalindex}}" value ={{CapacityPerCourses$.capacity}} (change)="handleChange($event)">
</div>
<div class="col-md-1">
<div class="col-md-1">
<i *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" (click)= "isEdit = false" class="fa fa-ban isclickable" style="font-size: 1.5em;"></i>
</div>
<div class="col-md-2">
<div class="col-md-2">
<button *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" type="button" class="btn-primary pull-right"
(click)="isEdit=false" (click) ="saveCapacity(CapacityPerCourses$.newspecialit, CapacityPerCourses$.newsector, CapacityPerCourses$.class, CapacityPerCourses$.capacity, CapacityPerCourses$.globalindex )">
......@@ -97,12 +97,12 @@ import {
private CapacityPerCourse$: BehaviorSubject<any>;
private CapacityPerCourseSub: Subscription;
private saveCapacitySub: Subscription;
private newvalue:number;
private newvalue: number;
private isEdit: boolean;
private courseActive = <number>-1;
private showLoader: BehaviorSubject<boolean>;
......@@ -114,27 +114,25 @@ import {
this.CapacityPerCourse$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false);
this.isEdit = false;
this.formGroup = this.fb.group({
});
});
}
public showModal(popupMsgId):void {
console.log("about to show modal",popupMsgId);
//(<any>$('#distributionWaitingNotice')).modal('show');
public showModal(popupMsgId): void {
(<any>$(popupMsgId)).modal('show');
}
public hideModal(popupMsgId):void {
public hideModal(popupMsgId): void {
//(<any>$('#distributionWaitingNotice')).modal('hide');
(<any>$(popupMsgId)).modal('hide');
}
public onHidden(popupMsgId):void {
public onHidden(popupMsgId): void {
}
......@@ -144,89 +142,64 @@ import {
}
ngOnInit() {
(<any>$('#checksaved1')).appendTo("body");
this.CapacityPerCourseSub = this._hds.FindCapacityPerSchool().subscribe(x => {
this.CapacityPerCourse$.next(x);
},
error => {
this.CapacityPerCourse$.next([{}]);
console.log("Error Getting Capacity perSchool");
},
() => console.log("Getting School "));
(<any>$('#checksaved1')).appendTo("body");
this.CapacityPerCourseSub = this._hds.FindCapacityPerSchool().subscribe(x => {
this.CapacityPerCourse$.next(x);
},
error => {
this.CapacityPerCourse$.next([{}]);
console.log("Error Getting Capacity perSchool");
});
}
handleChange ( e: Event) {
handleChange(e: Event) {
this.newvalue = e.target['value'];
}
saveCapacity(spec,sect,taxi,oldvalue,ind){
console.log(taxi, sect, spec);
console.log(this.newvalue,"newvalue", oldvalue);
if (this.newvalue!= null)
{
if (this.newvalue <=0 || this.newvalue >10)
{
this.showModal("#checksaved1");
}
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 => {
this.showLoader.next(false);
this.CapacityPerCourse$.next(std);
},
error => {
std[ind].capacity = oldvalue;
this.CapacityPerCourse$.next(std);
saveCapacity(spec, sect, taxi, oldvalue, ind) {
if (this.newvalue != null) {
if (this.newvalue <= 0 || this.newvalue > 10) {
this.showModal("#checksaved1");
}
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 => {
this.showLoader.next(false);
console.log("Error Saving Capacity");
this.CapacityPerCourse$.next(std);
},
() =>{
console.log("Saved Capacity");
error => {
std[ind].capacity = oldvalue;
this.CapacityPerCourse$.next(std);
this.showLoader.next(false);
console.log("Error Saving Capacity");
});
}
}
}
else
{
if (oldvalue === null)
this.showModal("#checksaved1");
}
}
else {
if (oldvalue === null)
this.showModal("#checksaved1");
}
}
setActive(ind) {
this.courseActive = ind;
console.log(this.courseActive, ind, "ind");
setActive(ind) {
this.courseActive = ind;
}
modifycapc(ind, e:Event)
{
this.isEdit=true;
this.setActive(ind);
this.handleChange(e);
}
modifycapc(ind, e: Event) {
this.isEdit = true;
this.setActive(ind);
this.handleChange(e);
}
}
......@@ -112,8 +112,9 @@ import {
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Ημερομηνία Γέννησης</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Τηλέφωνο Επικοινωνίας</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.telnum}}</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
......@@ -121,20 +122,24 @@ import {
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolname}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Σχολικό έτος τελευταίας φοίτησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolyear}}</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Τάξη τελευταίας φοίτησης</div>
<div *ngIf="StudentDetails$.lastschool_class === '1'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.lastschool_class === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.lastschool_class === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.lastschool_class === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div>
<div *ngIf="StudentDetails$.lastschool_class === '1'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.lastschool_class === '2'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.lastschool_class === '3'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.lastschool_class === '4'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Δ</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Δήλωση από:</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{ StudentDetails$.relationtostudent }}</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Τάξη φοίτησης για το νέο σχολικό έτος</div>
<div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.currentclass === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div>
<div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.currentclass === '4'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Δ</div>
</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Τομέας φοίτησης για το νέο σχολικό έτος</div>
......@@ -260,8 +265,6 @@ import {
public showModal(popupMsgId): void {
console.log("about to show modal", popupMsgId);
(<any>$(popupMsgId)).modal('show');
}
......@@ -293,8 +296,7 @@ import {
this.CoursesPerSchool$.next([{}]);
console.log("Error Getting courses perSchool");
this.showLoader.next(false);
},
() => console.log("Getting School "));
});
}
......@@ -313,8 +315,7 @@ import {
console.log("Error Getting Students");
this.showLoader.next(false);
this.showModal("#emptyselection");
},
() => console.log("Getting Students"));
});
}
......@@ -325,7 +326,6 @@ import {
ind = -1;
}
this.courseActive = ind;
console.log(this.courseActive, ind, "ind");
}
setActiveStudent(ind) {
......@@ -334,7 +334,6 @@ import {
ind = -1;
}
this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
}
setActiveStudentnew(ind) {
......@@ -343,7 +342,6 @@ import {
ind = -1;
}
this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
}
......@@ -357,7 +355,6 @@ import {
if (cb.value == 3)
rtype = null;
var type = cb.value;
console.log(type, "aaa");
this.showLoader.next(true);
let std = this.StudentInfo$.getValue();
......@@ -367,19 +364,14 @@ import {
this.SavedStudents$.next(data);
this.StudentInfo$.next(std);
this.showLoader.next(false);
this.showModal("#checksaved");
},
error => {
this.SavedStudents$.next([{}]);
console.log("Error saving Students");
this.showLoader.next(false);
this.showModal("#dangermodal");
},
() => {
console.log("saved Students");
this.showModal("#checksaved");
});
}
}
......@@ -32,16 +32,16 @@ import {
[class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" >
<div class="col-md-12" style="font-size: 0.8em; font-weight: bold;" >{{SchoolNames$.name}}</div>
</li>
<div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even"
<div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even"
[class.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)"
[class.selectedappout]="regionActive === j"
[class.selectedappout]="regionActive === j"
[hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.name}}</div>
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.size}}</div>
</div>
</div>
</form>
</div>
......@@ -61,7 +61,7 @@ import {
private StudentsSize$: BehaviorSubject<any>;
private StudentsSizeSub: Subscription;
private showLoader: BehaviorSubject<boolean>;
public perfecture ;
public perfecture;
private regionActive = <number>-1;
private School$: BehaviorSubject<any>;
private SchoolSub: Subscription;
......@@ -69,9 +69,9 @@ import {
constructor(private fb: FormBuilder,
private router: Router,
private _hds: HelperDataService,
) {
private router: Router,
private _hds: HelperDataService,
) {
this.SchoolsPerPerf$ = new BehaviorSubject([{}]);
this.LimitPerCateg$ = new BehaviorSubject([{}]);
this.CoursesPerPerf$ = new BehaviorSubject([{}]);
......@@ -84,65 +84,56 @@ import {
}
ngOnDestroy() {
}
}
ngOnInit() {
this.showLoader.next(true);
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
this.showLoader.next(true);
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
});
}
calccolor(size, limit)
{
calccolor(size, limit) {
if (size < limit)
return true;
else
return false;
if (size < limit)
return true;
else
return false;
}
setActiveRegion(ind) {
console.log(ind, this.regionActive,"ind");
if (ind === this.regionActive){
ind = -1;
this.regionActive = ind;
}
else
{
this.regionActive = ind;
this.showLoader.next(true);
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.CoursesPerPerf$.next([{}]);
console.log("Error Getting Courses");
if (ind === this.regionActive) {
ind = -1;
this.regionActive = ind;
}
else {
this.regionActive = ind;
this.showLoader.next(true);
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data);
this.showLoader.next(false);
},
() => console.log("Getting Courses Per Perf"));
}
this.regionActive = ind;
error => {
this.CoursesPerPerf$.next([{}]);
console.log("Error Getting Courses");
this.showLoader.next(false);
});
}
this.regionActive = ind;
}
......
......@@ -55,7 +55,7 @@ import {
private CoursesPerPerfSub: Subscription;
private StudentsSize$: BehaviorSubject<any>;
private StudentsSizeSub: Subscription;
public perfecture ;
public perfecture;
private regionActive = <number>-1;
private School$: BehaviorSubject<any>;
private SchoolSub: Subscription;
......@@ -63,9 +63,9 @@ import {
constructor(private fb: FormBuilder,
private router: Router,
private _hds: HelperDataService,
) {
private router: Router,
private _hds: HelperDataService,
) {
this.SchoolsPerPerf$ = new BehaviorSubject([{}]);
this.LimitPerCateg$ = new BehaviorSubject([{}]);
this.CoursesPerPerf$ = new BehaviorSubject([{}]);
......@@ -77,59 +77,50 @@ import {
}
ngOnDestroy() {
}
}
ngOnInit() {
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
});
}
setActiveRegion(ind) {
setActiveRegion(ind) {
if (ind === this.regionActive)
ind = -1;
if (ind === this.regionActive)
ind = -1;
this.regionActive = ind;
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.regionActive = ind;
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data);
},
error => {
this.CoursesPerPerf$.next([{}]);
console.log("Error Getting Courses");
},
() => console.log("Getting Courses Per Perf"));
});
}
navigateToApplication()
{
navigateToApplication() {
var id: string= String(this.regionActive);
this.router.navigate(['', {ids:id}]);
var id: string = String(this.regionActive);
this.router.navigate(['', { ids: id }]);
}
calccolor(size, limit)
{
calccolor(size, limit) {
if (size < limit)
return true;
else
return false;
if (size < limit)
return true;
else
return false;
}
}
......@@ -71,9 +71,9 @@ import { API_ENDPOINT } from '../../app.settings';
private settings$: BehaviorSubject<any>;
loginInfoSub: Subscription;
private settingsSub: Subscription;
private numSuccessMails:number;
private numFailMails:number;