Commit 971cd80e by Matteo

ultime modifiche

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