Commit 971cd80e by Matteo

ultime modifiche

parent f337ed62
......@@ -41,7 +41,7 @@ export class ChangePwdPage implements OnInit {
else
{
this.utilService.presentAlert("Info", "", "La Password è stata cambiata correttamente", ["OK"]);
this.router.navigateByUrl('');
this.utilService.apriPagina("home");
}
},
(error: ErrorResponse) => {
......@@ -81,10 +81,7 @@ matching_passwords_group = new FormGroup({
back()
{
UtilService.titoloPagina = '';
this.events.publish('functionCall:cambiaTitolo', null);
this.router.navigateByUrl('home');
this.utilService.apriPagina("home");
}
ngOnInit() {
......
......@@ -52,6 +52,9 @@
<ion-input formControlName="email" type="email" placeholder="{{ 'email' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
<ion-input formControlName="cellulare" type="cellulare" placeholder="{{ 'cellulare' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
<ion-input formControlName="password" type="password" placeholder="{{ 'pwd' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
......
......@@ -160,7 +160,7 @@ export class AuthService {
registra(value) : Observable<ErrorResponse>{
this.tipoStruttura = environment.struttura;
var param = UtilService.encodeBody({nome: value.nome, cognome: value.cognome, email: value.email, password: value.password, tipostruttura: this.tipoStruttura});
var param = UtilService.encodeBody({nome: value.nome, cognome: value.cognome, email: value.email, cellulare: value.cellulare, password: value.password, tipostruttura: this.tipoStruttura});
this.clientiSalvati = false;
return this.httpClient.post<ErrorResponse>(this.httpClientDataService.BASE_ADDRESS+'/autenticazione/registrazione.do', param, this.httpClientDataService.httpOptions)
.pipe(
......
......@@ -9,7 +9,7 @@
<ion-row justify-content-center>
<ion-col align-self-center size-lg="7">
<ion-toolbar class="business-toolbar" color="#2b94d1">
<ion-buttons (click)="openSideBar()" slot="start" title="{{'apri_menu' | translate}}" *ngIf="!isClienteLoggato">
<ion-buttons (click)="openSideBar()" slot="start" title="{{'apri_menu' | translate}}">
<ion-icon name="menu" color="light" class="menu-show" tappable></ion-icon>
</ion-buttons>
<ion-title class="logo-piccolo titolo-home" (click)="gotoPreview()">
......@@ -78,7 +78,7 @@
</ion-tabs>
</ion-content>
<ion-menu side="start" menu-id="mainmenu" content-id="content" class="menu" *ngIf="!platform.is('desktop') && !isClienteLoggato">
<ion-menu side="start" menu-id="mainmenu" content-id="content" class="menu" *ngIf="!platform.is('desktop')">
<ion-header no-border class="header">
<ion-toolbar class="menu-toolbar" color="#2b94d1">
<ion-item class="menu-title item-no-border">{{ 'menu_principale' | translate }}</ion-item>
......@@ -88,7 +88,7 @@
</ion-toolbar>
</ion-header>
<ion-content class="menu-content label-border">
<ion-item class="item-border-grey">
<ion-item class="item-border-grey" *ngIf="!isClienteLoggato">
<ion-label>{{ 'azienda_selezionata' | translate }}</ion-label>
<ion-select value="clienteSel" [(ngModel)]="clienteSel" (ionChange)="cambiaCliente()" interface="popover" [placeholder]="clienteSelezionato ? clienteSelezionato.denominazione : 'Tap to select..'" title="Seleziona un cliente">
<ion-select-option *ngFor="let cliente of clienti; let i=index;" value="{{cliente.id}}">{{cliente.denominazione}}</ion-select-option>
......@@ -172,16 +172,26 @@
</div>
</ion-row>
</div>
<ion-row class="row-content" tappable>
<ion-row class="row-content" tappable *ngIf="!isClienteLoggato">
<div class="div-Consulting background-transparent" tappable>
<div tappable class="icon2" (click)="selectStruttura('notifiche')">
<img src="assets/img/notifiche.png" tappable/>
<img src="assets/img/campanaBianca.png" tappable/>
</div>
<div tappable class="section-title title-bianca" (click)="selectStruttura('notifiche')">
{{ 'notifiche' | translate }}
</div>
</div>
</ion-row>
<ion-row class="row-content" tappable>
<div class="div-Consulting background-transparent" tappable>
<div tappable class="icon2" (click)="getBC()">
<img src="assets/img/campanaBianca.png" tappable/>
</div>
<div tappable class="section-title title-bianca" (click)="getBC()">
{{ 'business_call' | translate }}
</div>
</div>
</ion-row>
</div>
<!--<ion-list>
<div>
......@@ -209,12 +219,12 @@
<div id="layout" *ngIf="platform.is('desktop')" class="layout">
<ion-grid>
<ion-row class="layout-row">
<ion-col class="menu menu-desktop" size-md="2" size-lg="2" size-xs="2" align-self-center *ngIf="!isClienteLoggato">
<ion-col class="menu menu-desktop" size-md="2" size-lg="2" size-xs="2" align-self-center>
<div class="logo-grande2" (click)="gotoPreview()" tappable>
<img src="assets/icon/2p2-logo-medium.svg" />
</div>
<div class="menu-content label-border">
<ion-item class="item-border-grey">
<ion-item class="item-border-grey" *ngIf="!isClienteLoggato">
<ion-label>{{ 'azienda_selezionata' | translate }}</ion-label>
<ion-select value="clienteSel" [(ngModel)]="clienteSel" (ionChange)="cambiaCliente()" interface="popover" [placeholder]="clienteSelezionato ? clienteSelezionato.denominazione : 'Tap to select..'" title="Seleziona un cliente">
<ion-select-option *ngFor="let cliente of clienti; let i=index;" value="{{cliente.id}}">{{cliente.denominazione}}</ion-select-option>
......@@ -301,6 +311,26 @@
</div>
</ion-row>
</div>
<ion-row class="row-content" tappable *ngIf="!isClienteLoggato">
<div class="div-Consulting background-transparent" tappable>
<div tappable class="icon" (click)="selectStruttura('notifiche')">
<img src="assets/img/campanaBianca.png" tappable/>
</div>
<div tappable class="section-title title-bianca" (click)="selectStruttura('notifiche')">
{{ 'notifiche' | translate }}
</div>
</div>
</ion-row>
<ion-row class="row-content" tappable>
<div class="div-Consulting background-transparent" tappable>
<div tappable class="icon" (click)="getBC()">
<img src="assets/img/campanaBianca.png" tappable/>
</div>
<div tappable class="section-title title-bianca" (click)="getBC()">
{{ 'business_call' | translate }}
</div>
</div>
</ion-row>
</div>
<ion-row>
<ion-buttons (click)="logout()" title="{{'uscita' | translate}}" class="logout-button">
......
......@@ -11,6 +11,7 @@ import { StruttureResponse } from './../../interface/strutture-response';
import { ErrorResponse } from '../../auth/interface/error-response';
import { environment } from '../../../environments/environment';
import { Struttura } from 'src/app/interface/struttura';
import { ParereResponse } from 'src/app/interface/parere-response';
@Component({
selector: 'app-home',
......@@ -278,10 +279,8 @@ export class HomePage {
gotoPreview()
{
if(AuthService.isClienteLoggato) return;
UtilService.titoloPagina = '';
this.events.publish('functionCall:cambiaTitolo', null);
this.router.navigateByUrl('home/preview-home');
//if(AuthService.isClienteLoggato) return;
this.utilService.apriPagina("preview-home");
}
setStrutture()
......@@ -334,6 +333,14 @@ export class HomePage {
this.utilService.logout();
}
async getBC ()
{
(await this.utilService.chiediBCall()).subscribe((ok: ParereResponse) => {
if(ok.autorizzato) this.utilService.presentAlert("Info", "", "Business Call richiesta", ["OK"]);
else this.utilService.presentAlert("Errore", "", "C'è stato un problema con il server, riprovare tra qualche minuto!", ["OK"]);
});
}
ngOnInit() {
}
......
......@@ -98,10 +98,14 @@
(press)="selectItem(notifica.id)" [ngStyle]="{'background-color': notifica.checked ? '#c3ddec' : '#ffffff'}">
<ion-checkbox name="privacy" [(ngModel)]="notifica.checked" class="check" (click)="checkSelected(notifica.id)"> </ion-checkbox>
<div class="table-row">
<div class="row-text data" text-wrap>
<div class="row-text data2" text-wrap *ngIf="notifica.visualizzata">
<div text-wrap>{{notifica.titolo}}</div>
{{notifica.data}}
</div>
<div class="row-text data2" text-wrap *ngIf="!notifica.visualizzata">
<div text-wrap><strong>{{notifica.titolo}}</strong></div>
{{notifica.data}}
</div>
<div class="row-download item-no-border">
<ion-icon class="button-icon-documenti-smart ios-icon" name="ios-arrow-dropright-circle" (click)="apriNotifica(notifica.id)" tappable title="{{ 'visualizza_dettagli' | translate }}"></ion-icon>
</div>
......@@ -190,9 +194,12 @@
<div class="checkbox-desktop">
<ion-checkbox name="privacy" [(ngModel)]="notifica.checked" class="check" (click)="checkSelected(notifica.id)"> </ion-checkbox>
</div>
<div class="title" (click)="apriNotifica(notifica.id)">
<div class="title" (click)="apriNotifica(notifica.id)" *ngIf="!notifica.visualizzata">
<strong>{{notifica.titolo}}</strong>
</div>
<div class="title" (click)="apriNotifica(notifica.id)" *ngIf="notifica.visualizzata">
{{notifica.titolo}}
</div>
</ion-row>
<div class="data" (click)="apriNotifica(notifica.id)">
{{notifica.data}}
......
......@@ -30,7 +30,7 @@ export class NotifichePage implements OnInit {
public httpClientDataService: HttpClientDataService,
public translate: TranslateService,
public router: Router,
public authService: AuthService
public authService: AuthService,
) {
this.events.publish('functionCall:startup', null);
this.initPage();
......@@ -73,7 +73,7 @@ export class NotifichePage implements OnInit {
}, 60000);
}
refreshNotifiche()
refreshNotifiche()
{
this.loadNotifiche();
setTimeout(() => {
......@@ -276,12 +276,17 @@ export class NotifichePage implements OnInit {
this.notifiche.forEach(this.setNotifica, this);
}
setNotifica(notifica, index)
async setNotifica(notifica, index)
{
if(notifica.id == this.idSelezionato)
{
this.notificaAttiva = notifica;
this.notifica = "dettaglio";
var idReferente = await this.utilService.getIdUser();
this.notificheService.resetNotifiche(idReferente, environment.struttura, notifica.id).subscribe((res: Boolean)=>{});
setTimeout(() => {
this.loadNotifiche();
}, 5000);
}
}
......
......@@ -121,10 +121,10 @@ export class NotificheService {
);
}
resetNotifiche(idReferente: string, struttura: string) : Observable<Boolean> {
resetNotifiche(idReferente: string, struttura: string, idNotifica: number) : Observable<Boolean> {
var param = "";
if(!AuthService.isClienteLoggato) param = UtilService.encodeBody({clienteId: -1, referenteId: idReferente, gruppoStrutture: struttura});
else param = UtilService.encodeBody({clienteId: idReferente, referenteId: -1, gruppoStrutture: struttura});
if(!AuthService.isClienteLoggato) param = UtilService.encodeBody({clienteId: -1, referenteId: idReferente, gruppoStrutture: struttura, idNotifica: idNotifica});
else param = UtilService.encodeBody({clienteId: idReferente, referenteId: -1, gruppoStrutture: struttura, idNotifica: idNotifica});
return this.httpClient.post<Boolean>(this.httpClientDataService.BASE_ADDRESS+'/intranet/resetNotificheNonLette.do', param, this.httpClientDataService.httpOptions)
.pipe(
catchError(this.handleError),
......
......@@ -392,6 +392,34 @@ export class UtilService {
});
}
async chiediBCall()
{
var id = await this.getIdUser();
var isCliente = await this.getIsCliente();
var param = "";
if(isCliente) param = UtilService.encodeBody({id: id, gruppoStruttura:environment.struttura});
else
{
var idCliente = AuthService.clienteSelezionato.id;
param = UtilService.encodeBody({id: idCliente, idReferente:id, gruppoStruttura:environment.struttura});
}
return this.httpClient.post<ParereResponse>(this.httpClientDataService.BASE_ADDRESS+'/intranet/chiediBCall.do', param, this.httpClientDataService.httpOptions)
.pipe(
catchError(this.handleError),
tap( (res: ParereResponse ) => {
if (!res.error) {
this.errorRespose.error = false;
return res;
}
else{
this.errorRespose.error = true;
this.errorRespose.errorMsg = res.error;
}
})
);
}
downloadDocumento(fileUrl: string, nomeFile: string)
{
var path = "";
......@@ -451,9 +479,16 @@ export class UtilService {
async apriPagina(pagina:string)
{
if(AuthService.isClienteLoggato && pagina != 'notifiche') return;
if(AuthService.isClienteLoggato && (pagina != 'notifiche' && pagina != 'change-password')) pagina = 'notifiche';
switch(pagina)
{
case "preview-home":
{
UtilService.titoloPagina = '';
this.events.publish('functionCall:cambiaTitolo', null);
this.router.navigateByUrl('home/preview-home');
break;
}
case "home":
{
......@@ -519,8 +554,7 @@ export class UtilService {
}
case "notifiche":
{
var idReferente = await this.getIdUser();
this.notificheService.resetNotifiche(idReferente, environment.struttura).subscribe((res: Boolean)=>{});
//var idReferente = await this.getIdUser();
this.translate.get('notifiche_titolo').subscribe(
value => {
UtilService.titoloPagina = value;
......
......@@ -85,7 +85,7 @@
"back_login":"Torna alla login",
"reset_pwd":"Reset Password",
"registrazione":"Registrazione",
"email":"email",
"email":"Email",
"prenota":"Prenota subito la tua",
"business_call":"Business Call",
"nome":"Nome",
......@@ -101,7 +101,7 @@
"username":"Username *",
"password":"Password *",
"pwd":"Password",
"repeat_pwd":"Ripeti password",
"repeat_pwd":"Conferma password",
"accedi":"ACCEDI",
"lost_password":"Password dimenticata?",
"hai_account":"Non hai ancora un account?",
......
......@@ -449,6 +449,14 @@ $grigio-superlite: #e5e5ea;
font-size: 14px;
font-weight: 400;
}
.data2 {
div {
font-size: 18px;
border-bottom: $grigio-superlite;
}
font-size: 14px;
font-weight: 400;
}
.row-text {
font-size: 15px;
display:inline-block;
......
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