Merge branch 'component_updates' into 'develop'

Component updates

See merge request !124
parents 2dff0c88 161ea9ce
......@@ -199,7 +199,7 @@ epal.ministry.retrievesettings:
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.storesettings:
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}'
path: '/ministry/store-settings/{capacityDisabled}/{directorViewDisabled}/{applicantsLoginDisabled}/{applicantsResultsDisabled}'
options:
_auth: [ 'basic_auth' ]
defaults:
......@@ -262,3 +262,11 @@ getlimitspercourse:
_controller: '\Drupal\epal\Controller\DirectorView::getlimitsperCourse'
requirements:
_user_is_logged_in: 'TRUE'
epal.applicant.creationpdf:
path: '/epal/pdf-application'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\PdfCreator::createApplicantPDF'
requirements:
_user_is_logged_in: 'TRUE'
......@@ -94,7 +94,8 @@ class InformUnlocatedStudents extends ControllerBase {
// εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε
$sCon = $this->connection->select('epal_student_class', 'eStudent')
->fields('eStudent', array('student_id'));
->fields('eStudent', array('student_id'))
->condition('eStudent.finalized', 0 , '=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$studentIds = array();
......@@ -224,7 +225,8 @@ class InformUnlocatedStudents extends ControllerBase {
// εύρεση μαθητών που η αίτησή τους ΙΚΑΝΟΠΟΙΗΘΗΚΕ
$sCon = $this->connection->select('epal_student_class', 'eStudent')
->fields('eStudent', array('student_id', 'epal_id'));
->fields('eStudent', array('student_id', 'epal_id'))
->condition('eStudent.finalized', 1 , '=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$studentIds = array();
......
......@@ -98,6 +98,7 @@ class MinisterSettings extends ControllerBase {
$capacityDisabled = $epalConfig->lock_school_capacity->getString();
$directorViewDisabled = $epalConfig->lock_school_students_view->getString();
$applicantsLoginDisabled = $epalConfig->lock_application->getString();
$applicantsResultsDisabled = $epalConfig->lock_results->getString();
}
$config_storage->resetCache();
......@@ -107,6 +108,7 @@ class MinisterSettings extends ControllerBase {
'capacityDisabled' => $capacityDisabled,
'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
], Response::HTTP_OK);
} //end try
......@@ -123,7 +125,7 @@ class MinisterSettings extends ControllerBase {
}
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled ) {
public function storeSettings(Request $request, $capacityDisabled, $directorViewDisabled, $applicantsLoginDisabled, $applicantsResultsDisabled ) {
try {
if (!$request->isMethod('GET')) {
......@@ -168,6 +170,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
$epalConfig->set('lock_school_capacity', $capacityDisabled);
$epalConfig->set('lock_school_students_view', $directorViewDisabled);
$epalConfig->set('lock_application', $applicantsLoginDisabled);
$epalConfig->set('lock_results', $applicantsResultsDisabled);
$epalConfig->save();
}
$config_storage->resetCache();
......@@ -178,6 +181,7 @@ public function storeSettings(Request $request, $capacityDisabled, $directorView
'capacityDisabled' => $capacityDisabled,
'directorViewDisabled' => $directorViewDisabled,
'applicantsLoginDisabled' => $applicantsLoginDisabled,
'applicantsResultsDisabled' => $applicantsResultsDisabled,
], Response::HTTP_OK);
} //end try
......
<?php
/**
* @file
* Contains \Drupal\query_example\Controller\QueryExampleController.
*/
namespace Drupal\epal\Controller;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Connection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\TypedData\Plugin\DataType\TimeStamp;
use Drupal\Core\Language\LanguageManagerInterface;
//require_once('fpdf.php');
//require('C:\wamp64\bin\php\php5.6.25\fpdf16/fpdf.php');
use FPDF;
class PDFCreator extends ControllerBase {
protected $entity_query;
protected $entityTypeManager;
protected $logger;
protected $connection;
public function __construct(
EntityTypeManagerInterface $entityTypeManager,
QueryFactory $entity_query,
Connection $connection,
LoggerChannelFactoryInterface $loggerChannel)
{
$this->entityTypeManager = $entityTypeManager;
$this->entity_query = $entity_query;
$connection = Database::getConnection();
$this->connection = $connection;
$this->logger = $loggerChannel->get('epal');
}
public static function create(ContainerInterface $container)
{
return new static(
$container->get('entity_type.manager'),
$container->get('entity.query'),
$container->get('database'),
$container->get('logger.factory')
);
}
public function createApplicantPDF(Request $request) {
try {
if (!$request->isMethod('GET')) {
return $this->respondWithStatus([
"message" => t("Method Not Allowed")
], Response::HTTP_METHOD_NOT_ALLOWED);
}
/*
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
//$userid = $epalUser -> id();
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
if (!$user) {
return $this->respondWithStatus([
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
}
*/
//user validation
/*
$authToken = $request->headers->get('PHP_AUTH_USER');
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
return $this->respondWithStatus([
'message' => t("User:") . $authToken,
], Response::HTTP_FORBIDDEN);
if (!$user) {
return $this->respondWithStatus([
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
//user role validation
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role)
if ($role === "applicant") {
$validRole = true;
break;
}
return $this->respondWithStatus([
'message' => t("User Role:") . $role,
], Response::HTTP_FORBIDDEN);
if (!$validRole) {
return $this->respondWithStatus([
'message' => t("User Invalid Role"),
], Response::HTTP_FORBIDDEN);
}
*/
//$user->id()
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World! This is a funny day!!!!Hello World! This is a funny day!!!!Hello World! This is a funny day!!!!');
ob_end_clean();
//$s = $pdf->Output("c:\BACKUP\myFile2.pdf", "D");
$s = $pdf->Output("c:\BACKUP\myFile2.pdf", "S");
$s = utf8_encode($s);
$pdf->Close();
//ob_end_flush();
//$s = file_get_contents("c:/BACKUP/test.pdf");
//$s = utf8_encode($s);
//file_put_contents("c:/BACKUP/test2.pdf",$s);
return $this->respondWithStatus([
'pdfString' => $s,
//$s,
], Response::HTTP_OK);
} //end try
catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected problem occured during createApplicantPDF Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
public function array_utf8_encode($dat)
{
if (is_string($dat))
return utf8_encode($dat);
if (!is_array($dat))
return $dat;
$ret = array();
foreach ($dat as $i => $d)
$ret[$i] = self::array_utf8_encode($d);
return $ret;
}
private function respondWithStatus($arr, $s) {
$res = new JsonResponse($arr);
$res->setStatusCode($s);
return $res;
}
}
......@@ -207,7 +207,7 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
......@@ -227,7 +227,7 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
......@@ -247,7 +247,27 @@ class EpalConfig extends ContentEntityBase implements EpalConfigInterface {
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'boolean',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lock_results'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Lock Results'))
->setDescription(t('Lock Results.'))
->setSettings(array(
'text_processing' => 0,
))
->setRequired(FALSE)
->setDefaultValue(TRUE)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'boolean',
......
......@@ -42,13 +42,13 @@ import { API_ENDPOINT } from '../../app.settings';
<h5> >Αποστολή ειδοποιήσεων <br></h5>
<br><br>
<div class="col-md-12">
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(true)" >
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(true)" [disabled] = "!applicantsResultsDisabled" >
Μαζική αποστολή e-mail στους μαθητές που ΔΕΝ τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
<br>
<div class="col-md-12">
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(false)" >
<button type="submit" class="btn btn-lg btn-block" *ngIf="(loginInfo$ | async).size !== 0" (click)="informUnlocatedStudents(false)" [disabled] = "!applicantsResultsDisabled">
Μαζική αποστολή e-mail στους μαθητές που τοποθετήθηκαν<span class="glyphicon glyphicon-menu-right"></span>
</button>
</div>
......@@ -62,14 +62,16 @@ import { API_ENDPOINT } from '../../app.settings';
private modalTitle: BehaviorSubject<string>;
private modalText: BehaviorSubject<string>;
private modalHeader: BehaviorSubject<string>;
//public modalHeader: string;
private settings$: BehaviorSubject<any>;
loginInfoSub: Subscription;
private settingsSub: Subscription;
private numSuccessMails:number;
private numFailMails:number;
private successSending:number;
private apiEndPoint = API_ENDPOINT;
private minedu_userName: string;
private minedu_userPassword: string;
private applicantsResultsDisabled: boolean;
constructor(
private _ngRedux: NgRedux<IAppState>,
......@@ -78,10 +80,10 @@ import { API_ENDPOINT } from '../../app.settings';
private router: Router) {
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
//this.isModalShown = new BehaviorSubject(false);
this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject("");
this.modalHeader = new BehaviorSubject("");
this.settings$ = new BehaviorSubject([{}]);
}
......@@ -104,6 +106,8 @@ import { API_ENDPOINT } from '../../app.settings';
this.numFailMails = 0;
this.successSending = -1;
this.retrieveSettings();
}
ngOnDestroy() {
......@@ -112,13 +116,18 @@ import { API_ENDPOINT } from '../../app.settings';
if (this.loginInfoSub)
this.loginInfoSub.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.settingsSub)
this.settingsSub.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.settings$)
this.settings$.unsubscribe();
}
public showModal():void {
console.log("about to show modal");
(<any>$('#emaiSentNotice')).modal('show');
......@@ -172,4 +181,31 @@ import { API_ENDPOINT } from '../../app.settings';
}
retrieveSettings() {
this.settingsSub = this._hds.retrieveAdminSettings(this.minedu_userName, this.minedu_userPassword).subscribe(data => {
this.settings$.next(data);
},
error => {
this.settings$.next([{}]);
console.log("Error Getting MinisterRetrieveSettings");
},
() => {
console.log("Success Getting MinisterRetrieveSettings");
this.applicantsResultsDisabled = Boolean(Number(this.settings$.value['applicantsResultsDisabled']));
if (this.applicantsResultsDisabled == false) {
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next(("ΠΡΟΣΟΧΗ: Για να μπορείτε να αποστείλετε e-mail ενημέρωσης, παρακαλώ πηγαίνετε στις Ρυθμίσεις και ΕΝΕΡΓΟΠΟΙΗΣΤΕ ") +
("τη δυνατότητα της προβολής αποτελεσμάτων κατανομής από τους μαθητές.") );
this.modalHeader.next("modal-header-warning");
this.showModal();
}
}
)
}
}
......@@ -32,6 +32,8 @@ import { API_ENDPOINT } from '../../app.settings';
<h5> >Επιλογή Αναφοράς<br><br></h5>
<div class="col-md-1">
<!--
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(1)" [hidden]="minedu_userName == '' || userRole == 'pde' || userRole == 'dide'" >
<i class="fa fa-file-text"></i>
Κατανομή Μαθητών με Βάση τη Σειρά Προτίμησης
......@@ -52,12 +54,50 @@ import { API_ENDPOINT } from '../../app.settings';
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button>
<br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" [hidden]="minedu_userName == '' " >
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" [hidden]="minedu_userName == '' || userRole == 'pde' || userRole == 'dide' " >
<i class="fa fa-file-text"></i>
Ολιγομελή τμήματα (Προσωρινά τοποθετημένοι μαθητές)
</button>
<br><br>
</div>
-->
<div *ngIf = "minedu_userName != '' && userRole != 'pde' && userRole != 'dide'">
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(1)" >
<i class="fa fa-file-text"></i>
Κατανομή Μαθητών με Βάση τη Σειρά Προτίμησης
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != ''" >
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(2)" >
<i class="fa fa-file-text"></i>
Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != ''" >
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(3)" >
<i class="fa fa-file-text"></i>
Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != '' && userRole != 'pde' && userRole != 'dide'">
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(4)" >
<i class="fa fa-file-text"></i>
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button>
<br><br>
</div>
<div *ngIf = "minedu_userName != '' && userRole != 'pde' && userRole != 'dide'">
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" >
<i class="fa fa-file-text"></i>
Ολιγομελή τμήματα (Προσωρινά τοποθετημένοι μαθητές)
</button>
<br><br>
</div>
</div>
</div>
......
......@@ -85,6 +85,17 @@ import {
</div>
<br>
<div class="row">
<div class="col-md-1 ">
<input type="checkbox" [checked]="applicantsResultsDisabled" formControlName="applicantsResultsDisabled"
(click)="toggleApplicantsResults()" >
</div>
<div class="col-md-9">
<label for="applicantsResultsDisabled">Απενεργοποίηση δυνατότητας προβολής αποτελεσμάτων κατανομής από τους μαθητές </label>
</div>
</div>
<br>
<button type="submit" class="btn btn-md pull-right" (click)="storeSettings()" >
Εφαρμογή
</button>
......@@ -106,11 +117,11 @@ import {
private settings$: BehaviorSubject<any>;
loginInfoSub: Subscription;
private settingsSub: Subscription;
//private data;
private capacityDisabled: boolean;
private directorViewDisabled: boolean;
private applicantsLoginDisabled: boolean;
private applicantsResultsDisabled: boolean;
private dataRetrieved: number;
private minedu_userName: string;
......@@ -125,6 +136,7 @@ import {
capacityDisabled: ['', []],
directorViewDisabled: ['', []],
applicantsLoginDisabled: ['', []],
applicantsResultsDisabled: ['', []],
});
this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
......@@ -201,6 +213,7 @@ import {
this.capacityDisabled = Boolean(Number(this.settings$.value['capacityDisabled']));
this.directorViewDisabled = Boolean(Number(this.settings$.value['directorViewDisabled']));
this.applicantsLoginDisabled = Boolean(Number(this.settings$.value['applicantsLoginDisabled']));
this.applicantsResultsDisabled = Boolean(Number(this.settings$.value['applicantsResultsDisabled']));
this.dataRetrieved = 1;
}
......@@ -212,7 +225,8 @@ import {
this.dataRetrieved = -1;
this.settingsSub = this._hds.storeAdminSettings(this.minedu_userName, this.minedu_userPassword, this.capacityDisabled, this.directorViewDisabled, this.applicantsLoginDisabled )
this.settingsSub = this._hds.storeAdminSettings(this.minedu_userName, this.minedu_userPassword,
this.capacityDisabled, this.directorViewDisabled, this.applicantsLoginDisabled, this.applicantsResultsDisabled )
.subscribe(data => {
this.settings$.next(data);
//this.data = data;
......@@ -262,11 +276,11 @@ import {
}
toggleApplicantsResults() {
this.applicantsResultsDisabled = !this.applicantsResultsDisabled;
}
......
......@@ -105,6 +105,7 @@ import { API_ENDPOINT } from '../../app.settings';
private distStatus = "READY";
private capacityDisabled: boolean;
private directorViewDisabled: boolean;
private applicantsResultsDisabled: boolean;
constructor(/*private fb: FormBuilder,*/
// private _ata: LoginInfoActions,
......@@ -169,10 +170,10 @@ import { API_ENDPOINT } from '../../app.settings';
this.loginInfoSub.unsubscribe();
if (this.settingsSub)
this.settingsSub.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.settings$)
this.settings$.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.settings$)
this.settings$.unsubscribe();
}
ngOnInit() {
......@@ -205,10 +206,7 @@ import { API_ENDPOINT } from '../../app.settings';
this.showModal("#distributionWaitingNotice");
this._hds.makeDistribution(this.minedu_userName, this.minedu_userPassword)
.then(msg => {
//console.log("Nikos2");
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next("Η κατανομή ολοκληρώθηκε με επιτυχία!");
this.modalHeader.next("modal-header-success");
......@@ -218,8 +216,6 @@ import { API_ENDPOINT } from '../../app.settings';
this.distStatus = "FINISHED";
})
.catch(err => {console.log(err);
//console.log("Nikos1");
//console.log(err);
this.distStatus = "ERROR";
this.modalTitle.next("Κατανομή Μαθητών");
......@@ -247,6 +243,7 @@ import { API_ENDPOINT } from '../../app.settings';
this.capacityDisabled = Boolean(Number(this.settings$.value['capacityDisabled']));
this.directorViewDisabled = Boolean(Number(this.settings$.value['directorViewDisabled']));
this.applicantsResultsDisabled = Boolean(Number(this.settings$.value['applicantsResultsDisabled']));
console.log("Debugging..");
console.log(this.capacityDisabled);
......@@ -265,7 +262,13 @@ import { API_ENDPOINT } from '../../app.settings';
this.modalHeader.next("modal-header-warning");
this.showModal("#distributionNotice");
}
else if (this.applicantsResultsDisabled == false) {
this.modalTitle.next("Κατανομή Μαθητών");
this.modalText.next(("ΠΡΟΣΟΧΗ: Για να μπορείτε να εκτελέσετε την κατανομή, παρακαλώ πηγαίνετε στις Ρυθμίσεις και ΑΠΕΝΕΡΓΟΠΟΙΗΣΤΕ ") +
("τη δυνατότητα της προβολής αποτελεσμάτων κατανομής από τους μαθητές.") );
this.modalHeader.next("modal-header-warning");
this.showModal("#distributionNotice");
}
//this.dataRetrieved = 1;
}
......
......@@ -12,7 +12,7 @@ import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
import {reportsSchema, TableColumn} from './reports-schema';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
import { DIDE_ROLE, PDE_ROLE, MINISTRY_ROLE } from '../../constants';
import {csvCreator} from './csv-creator';
import {chartCreator} from './chart-creator';
......@@ -43,8 +43,13 @@ import { API_ENDPOINT } from '../../app.settings';
<!--<h5> >Επιλογή Φίλτρων <br><br></h5>-->
<br>
<button type="button" class="btn-link" (click)="toggleRegionFilter()" >
> Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου
<div *ngIf = "userLoggedIn == 'supervisor'"> > Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου </div>
<div *ngIf = "userLoggedIn == 'dide'" > > Φίλτρο Επιλογής Σχολείου </div>
<div *ngIf = "userLoggedIn == 'pde'"> > Φίλτρο Επιλογής Δ/νσης Εκπ/σης - Σχολείου </div>
</button>
<div class="col-md-11 offset-md-1">
<label *ngIf = "enableRegionFilter && userLoggedIn == 'supervisor'"> Περιφερειακή Διεύθυνση </label>
<select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" [value] = "regionSelected" [hidden] = "userLoggedIn != 'supervisor'" formControlName="region">
......@@ -67,10 +72,12 @@ import { API_ENDPOINT } from '../../app.settings';
</select>
</div>
<button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3 || reportId == 5" >
> Φίλτρο Επιλογής Τομέα / Ειδικότητας
</button>
<br>
<div *ngIf = "reportId == 3 || reportId == 5" >
<button type="button" class="btn-link" (click)="toggleCourseFilter()" >
> Φίλτρο Επιλογής Τομέα / Ειδικότητας
</button>
</div>
<div class="col-md-11 offset-md-1">
<label for="classid" *ngIf = "enableCourseFilter" >Τάξη</label><br/>
<select #class_sel class="form-control" (change)="checkclass(class_sel)" *ngIf = "enableCourseFilter" formControlName="classid" >
......@@ -97,7 +104,6 @@ import { API_ENDPOINT } from '../../app.settings';
<option *ngFor="let CourseSelection$ of CourseSelections$ | async; let i=index" [value] = "CourseSelection$.id"> {{CourseSelection$.name}}</option>
</select>
</div>
<br>
<button type="submit" class="btn btn-alert" (click)="createReport(regsel)" [hidden]="minedu_userName == ''" >
<i class="fa fa-file-text"></i>
......
......@@ -326,7 +326,7 @@ import {AppSettings} from '../../app.settings';
navigateToApplication() {
//[disabled] = " ( (selectionLimitOptional | async) === false && (classNight | async) === false && (numSelected | async) < (selectionLimit | async) )
// || ( (numSelected | async) === 0)"
if ( (this.selectionLimitOptional.value === false && this.classNight.value === false && this.numSelected.value < this.selectionLimit.value )
if ( (this.selectionLimitOptional.value === false /*&& this.classNight.value === false */ && this.numSelected.value < this.selectionLimit.value )
|| (this.numSelected.value === 0) ) {
//this.modalHeader = "modal-header-success";
......
......@@ -14,9 +14,22 @@ import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import * as html2canvas from "html2canvas"