Merge branch 'develop' into 'master'

Merge to master

See merge request !224
parents b9c599e6 7680505d
......@@ -139,7 +139,7 @@ class CASLogin extends ControllerBase
phpCAS::trace($umdobject);
// phpCAS::trace($physicaldeliveryofficename);
// $gsnunitcodedn = $filterAttribute('edupersonorgunitdn:gsnunitcode:extended');
$gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1);
// $gsnunitcode = substr($gsnunitcodedn, strpos($gsnunitcodedn, ";") + 1);
$gsnunitcode = $filterAttribute('edupersonorgunitdn:gsnunitcode');
/* check if myschool account */
if (!$umdobject || $umdobject !== "ISaccount") {
......
......@@ -56,5 +56,10 @@ function epal_mail($key, &$message, $params) {
$message['subject'] = t('Ικανοποίηση ηλεκτρονικής δήλωσης προτίμησης ΕΠΑΛ', $options);
$message['body'][] = $params['message'];
break;
case 'help_desk':
$message['from'] = \Drupal::config('system.site')->get('mail');
$message['subject'] = t('Σύστημα υποβολής ηλεκτρονικών δηλώσεων προτίμησης ΕΠΑΛ για το νέο σχολικό έτος: Αίτημα Υποστήριξης', $options);
$message['body'][] = $params['message'];
break;
}
}
......@@ -38,6 +38,14 @@ epal.current_user:
_controller: '\Drupal\epal\Controller\CurrentUser::getLoginInfo'
requirements:
_user_is_logged_in: 'TRUE'
epal.applicationdetails:
path: '/epal/application/{studentId}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SubmitedApplications::getApplicationDetails'
requirements:
_user_is_logged_in: 'TRUE'
epal.submitedapplications:
path: '/epal/subapplic'
options:
......@@ -147,7 +155,7 @@ epal.ministry.general_report:
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\ReportsCreator::makegGeneralReport'
_controller: '\Drupal\epal\Controller\ReportsCreator::makeGeneralReport'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.report-completeness:
......@@ -294,3 +302,27 @@ epal.findcoursesperschool:
_controller: '\Drupal\epal\Controller\DirectorView::FindCoursesPerSchool'
requirements:
_user_is_logged_in: 'TRUE'
epal.user.send_email:
path: '/epal/user/sendmail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\HelpDesk::sendEmail'
requirements:
_user_is_logged_in: 'TRUE'
epal.applicant.showresults:
path: '/epal/showresults/{studentId}'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\SubmitedApplications::getResults'
requirements:
_user_is_logged_in: 'TRUE'
epal.totalstudents:
path: '/epal/totalstudent'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\HelpDesk::findTotalStudents'
requirements:
_user_is_logged_in: 'TRUE'
<?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;
class HelpDesk 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')
);
}
private function respondWithStatus($arr, $s) {
$res = new JsonResponse($arr);
$res->setStatusCode($s);
return $res;
}
public function sendEmail(Request $request)
{
if (!$request->isMethod('POST')) {
return $this->respondWithStatus([
"message" => t("Method Not Allowed")
], Response::HTTP_METHOD_NOT_ALLOWED);
}
$postData = null;
if ($content = $request->getContent()) {
$postData = json_decode($content);
$this->sendEmailToHelpDesk($postData->userEmail, $postData->userName, $postData->userMessage,$postData->userSurname);
return $this->respondWithStatus([
'error_code' => 0,
], Response::HTTP_OK);
}
else {
return $this->respondWithStatus([
'message' => t("post with no data"),
], Response::HTTP_BAD_REQUEST);
}
}
private function sendEmailToHelpDesk($email, $name, $cont_message, $surname) {
$mailManager = \Drupal::service('plugin.manager.mail');
$module = 'epal';
$key = 'help_desk';
$to = 'dialogos_eek@minedu.gov.gr';
$params['message'] = '<p>Αποστολέας:'.$email.'</p><p>Όνομα: '.$name.'</p><p>Επώνυμο: '.$surname.'</p><p>Μήνυμα: '.$cont_message .'</p>';
$langcode = 'el';
$send = true;
$mail_sent = $mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);
if ($mail_sent) {
$this->logger->info("Mail Sent successfully.");
}
else {
$this->logger->info("There was an error in sending mail.");
}
return;
}
public function findTotalStudents(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$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 role validation
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role) {
if ($role === "applicant") {
$validRole = true;
break;
}
}
if (!$validRole) {
return $this->respondWithStatus([
'message' => t("User Invalid Role"),
], Response::HTTP_FORBIDDEN);
}
$list = array();
$sCon = $this->connection
->select('epal_student', 'eStudent')
->fields('eStudent', array('id'));
$numApplications = $sCon->countQuery()->execute()->fetchField();
array_push($list, (object) array('name' => "Αριθμός Αιτήσεων (συνολικά)", 'numStudents' => $numApplications));
return $this->respondWithStatus($list, Response::HTTP_OK);
}
}
......@@ -264,7 +264,7 @@ class InformUnlocatedStudents extends ControllerBase {
$to = $email;
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " / " . date('d-m-y H:i:s', $appDate)
. " δεν ικανοποιήθηκε. Παρακαλώ επικοινωνήστε άμεσα τηλεφωνικά με τη Διεύθυνση Δευτεροβάθμιας Εκπαίδευσης / Τμήμα Επαγγελματικής Εκπαίδευσης."
. " είναι σε εκκρεμότητα. Για την τοποθέτησή σας και τις ενέργειες που πρέπει να κάνετε θα ενημερωθείτε με νέο μήνυμα, με τον ίδιο τρόπο, μετά τις 8-7-2017."
. "\r\n\r\n Ομάδα Διαχείρισης της εφαρμογής e-epal."
. "\r\n Προσοχή: το μήνυμα που διαβάζετε είναι αυτοματοποιημένο. Παρακαλώ μην απαντάτε σε αυτό το μήνυμα.." ;//e-mail body" ;//e-mail body
$send = true;
......@@ -419,10 +419,10 @@ class InformUnlocatedStudents extends ControllerBase {
$to = $email;
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " / " . date('d-m-y H:i:s', $appDate)
. " ΙΚΑΝΟΠΟΙΗΘΗΚΕ. Έχετε επιλεγεί να γίνει η εγγραφή σας στο " . $schName .", που βρίσκεται στη διεύθυνση: " . $schStreet
. ". Παρακαλώ επικοινωνήστε άμεσα με τη Σχολική Μονάδα τοποθέτησής σας"
. ", ώστε να ενημερωθείτε για τη διαδικασία που πρέπει να ακολουθήσετε για την εγγραφή σας στο σχολείο. "
. "Τηλέφωνο επικοινωνίας σχολείου: " . $schTel
. " ΙΚΑΝΟΠΟΙΗΘΗΚΕ. Έχετε επιλεγεί για να εγγραφείτε στο " . $schName
. ". Παρακαλώ να προσέλθετε ΑΜΕΣΑ στο σχολείο για να προχωρήσει η διαδικασία εγγραφής σας σε αυτό, "
. "προσκομίζοντας τα απαραίτητα δικαιολογητικά. Διεύθυνση σχολείου: " . $schStreet
. " Τηλέφωνο επικοινωνίας σχολείου: " . $schTel
. "\r\n\r\n Ομάδα Διαχείρισης της εφαρμογής e-epal."
. "\r\n Προσοχή: το μήνυμα που διαβάζετε είναι αυτοματοποιημένο. Παρακαλώ μην απαντάτε σε αυτό το μήνυμα." ;//e-mail body
......
......@@ -304,14 +304,15 @@ class CBController extends ControllerBase
public function getXMLElements($doc){
$webUserDetails = $doc->getElementsByTagName( "WebUserDetails" );
if (!$webUserDetails || $webUserDetails->length === 0)
return array( // to be changed to empty array
return false;
/* return array( // to be changed to empty array
'firstName' => '',
'surname' => '',
'fathersName' => '',
'comments' => '',
'tin' => '12345'
);
// return false;
); */
foreach( $webUserDetails as $element )
{
$comments = $element->getElementsByTagName( "comments" );
......@@ -330,13 +331,14 @@ class CBController extends ControllerBase
$tin = $tins->item(0)->nodeValue;
if (!$tin || $tin === '')
return array( // to be changed to empty array
return false;
/* return array( // to be changed to empty array
'firstName' => '',
'surname' => '',
'fathersName' => '',
'comments' => '',
'tin' => '12345'
);
); */
return array(
'firstName' => $firstName,
'surname' => $surname,
......
......@@ -129,8 +129,8 @@ class OAuthLogin extends ControllerBase
$oauthostSession->save();
$this->logger->warning('redirected to:'.$this->user_authorization_url);
header('Location: '.$this->user_authorization_url.'?oauth_token='.$requestToken['oauth_token']);
$this->logger->warning('redirected to:'.$this->user_authorization_url.'?oauth_token='.$requestToken['oauth_token']);
exit;
} catch (OAuthException $e) {
$this->logger->warning($e->getMessage());
......
......@@ -2,7 +2,7 @@
// position: absolute;
// bottom: 41px;
background-color: #dcdcdc;
height: 100px;
height: 50px;
width: 100%;
}
......@@ -12,10 +12,11 @@
//position: absolute;
//bottom: 0;
width: 100%;
height: 41px;
line-height: 41px;
height: 120px;
line-height: 20px;
background-color: #3a3a3a;
color: #909090;
padding-top:10px;
.ft-text {
font-size: 12px;
a {
......
......@@ -31,13 +31,19 @@ import {
<p style="margin-top: 20px; line-height: 2em;"> H παρακάτω λίστα διαμορφώνει τη δυναμική του σχολείου σας σε τμήματα με κριτήριο τον αριθμό των διαθεσίμων αιθουσών. </p>
<p style="margin-top: 20px; line-height: 2em;"> Παρακαλείστε να καταγράψετε τον αριθμό των τμημάτων ανά τάξη, τομέα και ειδικότητα. </p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Τα τμήματα του σχολείου σας. </b></div>
<div class="row">
<div class="col-md-10" style="font-weight: bold;"> Τα τμήματα του σχολείου σας.</div>
<div class="col-md-2" style="font-weight: bold;"> <span class="pull-right" style="text-align: right; padding-right: 2px;">Αριθμός Μαθητών</span></div>
</div>
<div *ngFor="let CoursesPerSchools$ of CoursesPerSchool$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" (click)="setActive(i)"
(click)="findstudent(CoursesPerSchools$.class, CoursesPerSchools$.newsector, CoursesPerSchools$.newspecialit)"
[class.changelistcolor]= "CoursesPerSchools$.size < CoursesPerSchools$.limitdown"
[class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="courseActive === i" >
<h5 >{{CoursesPerSchools$.taxi}}&nbsp; <b></b></h5>
<div class="row" style="line-height: 2em;">
<div class="col-md-10" style="font-weight: bold;" >{{CoursesPerSchools$.taxi}}</div>
<div class="col-md-2" style="font-weight: bold;" ><span class="pull-right" style="text-align: right; padding-right: 2px;">{{CoursesPerSchools$.size}}</span></div>
</div>
</li>
<div [hidden]="courseActive !== i" *ngIf="(retrievedStudent | async)">
......@@ -47,31 +53,38 @@ import {
[class.notconfirmed]="StudentDetails$.checkstatus === '0'"
[class.notchecked]="(StudentDetails$.checkstatus !== '1') && (StudentDetails$.checkstatus !== '0')"
[class.oddout]="isOdd" [class.evenout]="isEven" style="margin: 0px 2px 0px 2px;">
<div class="col-md-4" style="font-size: 0.8em; font-weight: bold;" (click) ="setActiveStudent(j)" >{{StudentDetails$.studentsurname}}</div>
<div class="col-md-4" style="font-size: 0.8em; font-weight: bold;" (click) ="setActiveStudent(j)">{{StudentDetails$.name}}</div>
<div [hidden]="StudentActive !== j" class="col-md-2" style="color: black;" *ngIf = "opened == true"> <span aria-hidden="true"><i class="fa fa-close" (click) ="setActiveStudentnew(j)"></i></span> </div>
<div class="col-md-5" style="font-size: 0.8em; font-weight: bold;" (click) ="setActiveStudent(j)" >{{StudentDetails$.studentsurname}}</div>
<div class="col-md-5" style="font-size: 0.8em; font-weight: bold;" (click) ="setActiveStudent(j)">{{StudentDetails$.name}}</div>
<div [hidden]="StudentActive !== j" class="col-md-2 pull-right" style="color: black;" > <span aria-hidden="true"><button type="button" class="btn-primary btn-sm pull-right" (click) ="setActiveStudentnew(j)">Κλείσιμο</button></span> </div>
<div style="width: 100%; color: #000000;">
<div [hidden]="StudentActive !== j" style="margin: 20px 10px 10px 10px;">
<p style="margin-top: 20px; line-height: 2em;"> Παρακαλούμε, αφού γίνει ο έλεγχος των στοιχείων του μαθητή επιβεβαιώστε τη δυνατότητα εγγραφής του.</p>
<p style="margin-top: 10px; margin-bottom: 5px; line-height: 2em;"> Παρακαλούμε, αφού γίνει ο έλεγχος των στοιχείων του μαθητή επιβεβαιώστε τη δυνατότητα εγγραφής του.</p>
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-6">
<div class="col-md-8">&nbsp;</div>
<div class="col-md-4">
<strong><label>Επιβεβαίωση Εγγραφής:</label> </strong>
<select #cb name="{{StudentDetails$.id}}" >
<select class="form-control pull-right" #cb name="{{StudentDetails$.id}}" (change)="confirmStudent(StudentDetails$.id, cb, j)">
<option value="1" [selected]="StudentDetails$.checkstatus === '1' ">Ναι</option>
<option value="2" [selected]="StudentDetails$.checkstatus === '0' ">Όχι</option>
<option value="3" [selected]="StudentDetails$.checkstatus != '0' && StudentDetails$.checkstatus != '1'"></option>
<option value="3" [selected]="StudentDetails$.checkstatus != '0' && StudentDetails$.checkstatus != '1'">Δεν ελέγχθηκε</option>
</select>
</div>
<div class="col-md-6">
<!-- <div class="col-md-2">
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent(StudentDetails$.id, cb, j)">
Επιβεβαίωση Εγγραφής
Ενημέρωση
</button>
</div>
</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-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.id}}</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$.created}}</div>
</div>
<div class="row evenin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-12" style="font-size: 1em; font-weight: bold; text-align: center;">Στοιχεία αιτούμενου</div>
......@@ -165,7 +178,7 @@ import {
class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-warning">
<div class="modal-header modal-header-success">
<h3 class="modal-title pull-left"><i class="fa fa-check-square-o"></i>&nbsp;&nbsp;Η επιλογή σας έχει αποθηκευτεί</h3>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#checksaved')">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
......@@ -187,7 +200,7 @@ import {
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<h3 class="modal-title pull-left"><i class="fa fa-check-square-o"></i>&nbsp;&nbsp;Η επιλογή σας δεν έχει αποθηκευτεί</h3>
<h3 class="modal-title pull-left"><i class="fa fa-ban"></i>&nbsp;&nbsp;Η επιλογή σας δεν έχει αποθηκευτεί</h3>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#dangermodal')">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button>
......@@ -208,7 +221,7 @@ import {
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<h3 class="modal-title pull-left"><i class="fa fa-check-square-o"></i>&nbsp;&nbsp;Δεν υπάρχουν μαθητές</h3>
<h3 class="modal-title pull-left"><i class="fa fa-ban"></i>&nbsp;&nbsp;Δεν υπάρχουν μαθητές</h3>
<button type="button" class="close pull-right" aria-label="Close" (click)="hideModal('#emptyselection')">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button>
......
......@@ -2,12 +2,18 @@
</div>
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4"><span class="ft-text">Copyright (c) ΥΠ.Π.Ε.Θ. 2017</span></div>
<div class="cols-xs-12 col-md-6 text-center">
<!-- <span class="ft-text"><a href="#">ΟΡΟΙ ΧΡΗΣΗΣ – ΕΜΠΙΣΤΕΥΤΙΚΟΤΗΤΑ</a></span>
<span class="ft-text"><a href="#">ΠΡΟΣΩΠΙΚΑ ΔΕΔΟΜΕΝΑ</a></span> -->
</div>
<div class="row">
<div class="col-xs-12 col-md-3"><span class="ft-text">Copyright (c) ΥΠ.Π.Ε.Θ. 2017</span></div>
<div class="cols-xs-12 col-md-7 text-center">
<span class="ft-text align-middle">
Η εφαρμογή σχεδιάστηκε και υλοποιήθηκε από την <a href="http://ostmgmt.minedu.gov.gr/" target="_blank" >Ομάδα Ανοιχτού Λογισμικού του ΥΠΠΕΘ</a>
<br></span>
<span class="ft-text align-middle"> <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.el" target="_blank" > Άδεια χρήσης περιεχομένου: CC-BY-SA</a> </span> </div>
<div class="col-xs-12 col-md-2"><span class="ft-text" style="text-align: right;">Version 1.0</span></div>
</div>
</div>
......
......@@ -20,16 +20,27 @@
<div class="header-wrapper">
<header id="navbar" role="banner" class="navbar navbar-default">
<div class="container">
<div *ngIf="(loginInfo$ | async).size > 0">
<div *ngFor="let loginInfoRow$ of loginInfo$ | async; let i=index;">
<ul class="navbar-nav">
<div *ngIf="(loginInfo$ | async).cu_name !== ''">
<div *ngIf="loginInfoRow$.cu_name !== ''">
<div class="row">
<div class="col-md-2">
<i class="fa fa-home isclickable" (click)="goHome()"></i>
<span class="signout isclickable" (click)="goHome()" style="color:#CC3300;">&nbsp;&nbsp;Αρχική</span>
</div>
<div class="col-md-6">&nbsp;</div>
<div class="col-md-2">
<span *ngIf="loginInfoRow$.auth_role===studentRole" class="signout isclickable" (click)="gohelpDesk()" style="color:#CC3300;">Επικοινωνία</span>
</div>
<div class="col-md-4">
<span *ngIf="loginInfoRow$.auth_role===studentRole" class="signout" style="color:#CC3300;">
<div *ngFor="let TotalStudent$ of TotalStudents$ | async;">
Σύνολο Δηλώσεων: {{TotalStudent$.numStudents}}
</div>
</span>
</div>
<div class="col-md-4" style="text-align: right">
<span class="username" style="text-align: right">{{ cuName }}&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class="signout isclickable" style="text-align: right" (click)="signOut()" style="color:#CC3300;">Αποσύνδεση&nbsp;&nbsp;</span>
......
......@@ -2,7 +2,7 @@ import {Component, OnInit, OnDestroy} from "@angular/core";
import {Router} from "@angular/router";
import { Injectable } from "@angular/core";
import { BehaviorSubject } from "rxjs/Rx";
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { NgRedux, select } from "ng2-redux";
import { IAppState } from "../../store/store";
import { ILoginInfo, ILoginInfoToken } from "../../store/logininfo/logininfo.types";
......@@ -17,12 +17,14 @@ import { SectorCoursesActions } from "../../actions/sectorcourses.actions";
import { CriteriaActions } from "../../actions/criteria.actions";
import { StudentDataFieldsActions } from "../../actions/studentdatafields.actions";
@Component({
selector: "reg-header",
templateUrl: "header.component.html"
})
export default class HeaderComponent implements OnInit, OnDestroy {
private authToken: string;
private studentRole = STUDENT_ROLE;
private authRole: string;
private cuName: string;
private loginInfo$: BehaviorSubject<ILoginInfo>;
......@@ -32,6 +34,11 @@ export default class HeaderComponent implements OnInit, OnDestroy {
private modalText: BehaviorSubject<string>;
private modalHeader: BehaviorSubject<string>;
private TotalStudents$: BehaviorSubject<any>;
private TotalStudentsSub: Subscription;
private showLoader: BehaviorSubject<boolean>;
private hasvalue: boolean;
constructor(private _ata: LoginInfoActions,
private _hds: HelperDataService,
private _csa: SectorCoursesActions,
......@@ -52,6 +59,9 @@ export default class HeaderComponent implements OnInit, OnDestroy {
this.modalTitle = new BehaviorSubject("");
this.modalText = new BehaviorSubject("");
this.modalHeader = new BehaviorSubject("");
this.TotalStudents$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false);
this.hasvalue = false;
};
......@@ -65,11 +75,31 @@ export default class HeaderComponent implements OnInit, OnDestroy {
this.cuName = loginInfoToken.cu_name;
return loginInfoToken;
}, {});
if (this.hasvalue == false)
{
this.showLoader.next(true);
this.TotalStudentsSub = this._hds.findTotalStudents().subscribe(x => {
this.TotalStudents$.next(x);
this.showLoader.next(false);
this.hasvalue = true;
},
error => {
this.TotalStudents$.next([{}]);
console.log("Error Getting courses perSchool");
this.showLoader.next(false);
});
}
}
return state.loginInfo;
}).subscribe(this.loginInfo$);
}
ngOnDestroy() {
......@@ -139,6 +169,11 @@ export default class HeaderComponent implements OnInit, OnDestroy {
}
}
gohelpDesk()
{
this.router.navigate(['/help-desk']);
}
public showModal(): void {
(<any>$("#headerNotice")).modal("show");
}
......
......@@ -23,6 +23,10 @@ import { API_ENDPOINT, API_ENDPOINT_PARAMS } from '../app.settings';
<form [formGroup]="formGroup" method = "POST" action="{{apiEndPoint}}/oauth/login{{apiEndPointParams}}" #form>
<!-- <input type="hidden" name="X-oauth-enabled" value="true"> -->
<!-- <div class="text-center bg-warning" style="padding: 2em;"><p>
<strong>Ανακοίνωση:</strong> τη Δευτέρα <strong>26/6/2017</strong>
το σύστημα θα είναι διαθέσιμο<br/> <strong>μετά τις 13:00</strong> λόγω εργασιών συντήρησης.</p></div> -->
<div *ngFor="let loginInfoToken$ of loginInfo$ | async; let i=index"></div>
<div class="row" style="min-height: 300px; margin-top: 100px;">
......
......@@ -3,12 +3,34 @@
<div class="row">
&nbsp;&nbsp;&nbsp;
</div>
<div class="row">
<div class="col-sm-12 col-md-3 hidden-md-down">
<div class="left-sidebar">
<div class="navig-left-img">
<img src="../myschool/assets/images/default.png" alt="">
</div>
<br>
<br>
<div class="left-choices">
<div class="row">
<div class="col-md-12">
<button type="button" class="btn-primary btn-lg pull-left isclickable" style="width: 10em;" (click)="navigatelegal()" >
<span style="font-size: 0.9em; font-family: arial, sans-serif!important; font-weight: bold; color: #ffffff;"> Νομοθεσία </span>
</button>
</div>
</div>
</div>
<div style="margin-top:15px; margin-bottom: 10px;" class="left-choices">
<div class="row">
<div class="col-md-12">
<a href="/pdfs/files/odigies.pdf" target="_blank" class="btn btn-primary btn-lg pull-left isclickable active" style="width: 10em; " role="button" aria-pressed="true">
<span style="font-size: 0.9em; font-family: arial, sans-serif!important; font-weight: bold; color: #ffffff;">Οδηγίες χρήσης</span>
</a>
</div>
</div>
</div>
<div class="left-choices">
<application-preview-select></application-preview-select>
......@@ -18,7 +40,7 @@
</div>
<div class="col-sm-12 col-md-9">
<div class="main-content">
<div class="panel panel-primary">
<div class="panel-body">
<router-outlet></router-outlet>
......
import {Component} from '@angular/core';
import { Router } from "@angular/router";
@Component({
selector: 'reg-main',
templateUrl: 'main.component.html'
})
export default class MainComponent { }
export default class MainComponent {
constructor(
private router: Router
) {}
navigatelegal() {
this.router.navigate(['/legal-info']);
}
}
......@@ -20,6 +20,8 @@ import { API_ENDPOINT } from '../../app.settings';
class = "loading" *ngIf="successSending == -2" >
</div>
<div style="min-height: 400px;">
<div id="emaiSentNotice" (onHidden)="onHidden()" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
......@@ -59,6 +61,8 @@ import { API_ENDPOINT } from '../../app.settings';
</button>
</div>
</div>
`
})
......
import { Component, OnInit, OnDestroy } from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { AppSettings } from "../../app.settings";
import { HelperDataService } from "../../services/helper-data-service";
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';