Commit e901180d by Matteo

Aggiunte Splash, Configurato accesso http per Android 9, Aggiunta ricerca…

Aggiunte Splash, Configurato accesso http per Android 9, Aggiunta ricerca testuale documenti, Aggiuntacondivisione documenti su whatsapp, fix su interviste
parent c624c409
......@@ -5,6 +5,7 @@
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
......@@ -91,6 +92,8 @@
<icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
<icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
<icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
<splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
......
......@@ -753,6 +753,14 @@
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/social-sharing": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@ionic-native/social-sharing/-/social-sharing-5.9.0.tgz",
"integrity": "sha512-/h3ldE8L+YoLqrOViia51MbEBFr7H9crligE5KQ5anPHGwN7tzoZ6X2vsV5m8g7EctGNpeYufF7PGp4lAWUnhQ==",
"requires": {
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/splash-screen": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-5.5.1.tgz",
......@@ -2761,6 +2769,11 @@
"integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q=",
"dev": true
},
"cordova-plugin-x-socialsharing": {
"version": "5.4.7",
"resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-5.4.7.tgz",
"integrity": "sha512-owN2DN02AHdt6WAzn1E35AxVDrmIo8ebZwtPQjzCvxCelkdiie/FMsgkUUT4Z1fUXunh0Oxovx9ce0w3zRXdlw=="
},
"cordova-serve": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cordova-serve/-/cordova-serve-3.0.0.tgz",
......@@ -3508,6 +3521,11 @@
"integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==",
"dev": true
},
"es6-promise-plugin": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz",
"integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA=="
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
......
......@@ -29,6 +29,7 @@
"@ionic-native/file": "^5.6.0",
"@ionic-native/file-opener": "^5.7.0",
"@ionic-native/in-app-browser": "^5.8.0",
"@ionic-native/social-sharing": "^5.9.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^4.1.0",
......@@ -42,8 +43,10 @@
"cordova-plugin-file": "6.0.1",
"cordova-plugin-file-opener2": "2.2.0",
"cordova-plugin-inappbrowser": "3.0.0",
"cordova-plugin-x-socialsharing": "5.4.7",
"cordova-sqlite-storage": "3.2.0",
"core-js": "^2.5.4",
"es6-promise-plugin": "4.2.2",
"ionic-angular": "^3.9.5",
"rxjs": "~6.5.1",
"rxjs-compat": "^6.5.2",
......@@ -101,7 +104,10 @@
"cordova-plugin-email-composer": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-inappbrowser": {}
"cordova-plugin-inappbrowser": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
}
},
"platforms": [
"android",
......
resources/ios/splash/Default-667h.png

39.5 KB | W: | H:

resources/ios/splash/Default-667h.png

17.5 KB | W: | H:

resources/ios/splash/Default-667h.png
resources/ios/splash/Default-667h.png
resources/ios/splash/Default-667h.png
resources/ios/splash/Default-667h.png
  • 2-up
  • Swipe
  • Onion skin
resources/ios/splash/Default~iphone.png

7.04 KB | W: | H:

resources/ios/splash/Default~iphone.png

5.84 KB | W: | H:

resources/ios/splash/Default~iphone.png
resources/ios/splash/Default~iphone.png
resources/ios/splash/Default~iphone.png
resources/ios/splash/Default~iphone.png
  • 2-up
  • Swipe
  • Onion skin
resources/splash.png

272 KB | W: | H:

resources/splash.png

19.7 KB | W: | H:

resources/splash.png
resources/splash.png
resources/splash.png
resources/splash.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -27,11 +27,14 @@ export class AppComponent {
this.initializeApp();
}
initializeApp() {
this.splashScreen.show();
async initializeApp() {
var state = await this.authService.syncIsLoggedIn();
if (!state) {
this.router.navigate(['login']);
}
this.platform.ready().then(() => {
this.statusBar.styleDefault();
//this.splashScreen.hide();
this.splashScreen.hide();
if(!navigator.onLine)
{
this.router.navigate(['error']);
......@@ -57,17 +60,17 @@ export class AppComponent {
}
);
}
this.authService.isLoggedIn().then(state => {
/*this.authService.isLoggedIn().then(state => {
if (!state) {
this.router.navigate(['login']);
}
});
});*/
}
});
}
logout(){
this.authService.logout();
async logout(){
await this.authService.logout();
this.router.navigateByUrl('login');
}
......
......@@ -17,6 +17,7 @@ import { FileOpener } from '@ionic-native/file-opener/ngx';
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
import { EmailComposer } from '@ionic-native/email-composer/ngx';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
@NgModule({
declarations: [AppComponent],
......@@ -38,6 +39,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
AndroidPermissions,
EmailComposer,
InAppBrowser,
SocialSharing,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
],
bootstrap: [AppComponent]
......
......@@ -187,4 +187,9 @@ export class AuthService {
return data;
});
}
async syncIsLoggedIn()
{
return await this.storage.get("logged");
}
}
......@@ -5,4 +5,5 @@ export interface Documento {
url: string;
tipo: string;
nomeFile: string;
checked: boolean;
}
......@@ -10,7 +10,7 @@
<ion-grid>
<ion-row class="search-date">
<div *ngIf="platform.is('desktop')">
<strong>Cerca</strong> da <input type="date" name="calendar" [(ngModel)]="date1" title="Seleziona una data"> a <input type="date" name="calendar" [(ngModel)]="date2" title="Seleziona la data"> <ion-button (click)="cercaDocumenti()" class="search-arrow" title="Cerca documenti"><ion-icon class="button-icon" slot="icon-only" name="arrow-round-forward" title="Cerca documenti"></ion-icon></ion-button>
<strong>Cerca</strong> da <input type="date" name="calendar" [(ngModel)]="date1" title="Seleziona una data"> a <input type="date" name="calendar" [(ngModel)]="date2" title="Seleziona la data">
</div>
<div class="float-date" *ngIf="!platform.is('desktop')">
<span class="date-text"><strong>Cerca</strong> da </span>
......@@ -23,9 +23,18 @@
<div floating class="element-date item-no-border date-text">
{{date2}}
</div>
<ion-button (click)="cercaDocumenti()" class="search-arrow"><ion-icon class="button-icon" slot="icon-only" name="arrow-round-forward"></ion-icon></ion-button>
</div>
</ion-row>
<ion-row class="search-date">
<div><strong>Cerca</strong> titolo <input type="text" name="calendar" [(ngModel)]="titolo" title="Seleziona una data">
<ion-button (click)="cercaDocumenti()" class="search-arrow" title="Cerca documenti"><ion-icon class="button-icon" slot="icon-only" name="arrow-round-forward" title="Cerca documenti"></ion-icon></ion-button></div>
</ion-row>
<ion-row class="search-date" id="buttons" style="display:none">
<div>Condividi documenti su whatsapp</div>
<ion-button (click)="condividiDocumenti()" class="search-arrow" title="Condividi documenti"><ion-icon class="button-icon" slot="icon-only" name="share-alt" title="Condividi documenti"></ion-icon></ion-button>
</ion-row>
<ion-row class="search-date-border">
</ion-row>
<!--<ion-row class="search-date" *ngIf="!platform.is('desktop')">
<ion-col>
<ion-grid>
......@@ -73,11 +82,12 @@
<ion-col></ion-col>
</ion-row>-->
<ion-list *ngFor="let documento of documenti.documenti; trackBy: trackByDoc" class="row-results">
<ion-checkbox name="privacy" *ngIf="!platform.is('desktop')" [(ngModel)]="documento.checked" class="check" (click)="checkSelected(documento.idDocumento)"> </ion-checkbox>
<div class="table-row">
<div class="row-text">
{{documento.titolo}}
<div class="detail">
{{documento.data}} - Tipo: {{documento.tipo}}
{{documento.data}}
</div>
</div>
<ion-item class="row-download item-no-border">
......@@ -88,6 +98,7 @@
<ion-icon name="cloud-download" *ngIf="!platform.is('desktop')" (click)="getDocumento(documento.idDocumento, documento.nomeFile);" target="_blank" download tappable>Clicca per scaricare il documento</ion-icon>
</ion-item>
</div>
<div class="clr"></div>
</ion-list>
</ion-grid>
</div>
......
......@@ -25,17 +25,16 @@ export class DocumentiPage implements OnInit {
private datePicker: DatePicker,
public platform: Platform,
public events: Events,
public httpClientDataService: HttpClientDataService,
public httpClientDataService: HttpClientDataService
) {
this.documenti = {
cliente: null,
error: "",
documenti: null
};
var date : Date;
date = new Date();
this.date1 = "";
this.date2 = "";
this.titolo = "";
this.events.publish('functionCall:startup', null);
if(AuthService.clienteSelezionato.id != null) this.chiediDocumenti("initial");
this.events.subscribe('functionCall:clienteCambiato', eventData => {
......@@ -76,17 +75,56 @@ export class DocumentiPage implements OnInit {
this.utilService.downloadDocumento(fileUrl, nomeFile);
}
documentoId;
checkSelected(id)
{
this.documentoId = id;
this.hideButtons()
this.documenti.documenti.forEach(this.check, this);
}
check(documento: Documento, index)
{
if(documento.checked && documento.idDocumento != this.documentoId) this.showButtons();
if(!documento.checked && documento.idDocumento == this.documentoId) this.showButtons();
}
showButtons()
{
var buttons = document.getElementById('buttons');
buttons.setAttribute("style", "display:block");
}
hideButtons()
{
var buttons = document.getElementById('buttons');
buttons.setAttribute("style", "display:none");
}
async condividiDocumenti()
{
this.documenti.documenti.forEach(this.recuperaDocumento, this);
}
async recuperaDocumento(documento: Documento, index)
{
if(documento.checked != null && documento.checked) this.utilService.shareDocumento(documento.url, documento.nomeFile);
}
chiediDocumenti(fase)
{
this.utilService.showLoading();
var dataA = null;
var dataDa = null;
var tit = null;
if(this.titolo != "") tit = this.titolo;
if(this.date1 != null && this.date1 != "") dataDa = this.utilService.dateFormatConvert(this.date1);
if(this.date2 != null && this.date2 != "") dataA = this.utilService.dateFormatConvert(this.date2);
var request: DocumentiRequest;
this.idCliente = AuthService.clienteSelezionato.id;
if(fase == "initial") request = this.docService.createInitialRequest(this.idCliente);
else request = this.docService.createRequest(this.idCliente,null,null,null,dataDa, dataA);
else request = this.docService.createRequest(this.idCliente,null,tit,null,dataDa, dataA);
this.docService.getDocumenti(request).subscribe((res: DocumentiResponse)=>{
this.utilService.closeLoading();
if(res.error){
......@@ -115,6 +153,7 @@ export class DocumentiPage implements OnInit {
documenti: DocumentiResponse;
date1;
date2;
titolo: string;
ngOnInit() {
}
......
......@@ -19,6 +19,11 @@ export class HomePage {
denominazione: null,
id: null
};
/*this.authService.isLoggedIn().then(state => {
if (!state) {
this.router.navigate(['login']);
}
});*/
this.events.subscribe('functionCall:startup', eventData => {
if(this.clienteSelezionato.id == null) {
if(!authService.areClientiSalvati())
......
......@@ -42,7 +42,7 @@
Novità
</div>
</div>
-->
<div class="box" tappable>
<div class="icon" tappable>
<img src="assets/img/verifico-reports.svg" (click)="apriPagina('bi')" tappable/>
......@@ -50,7 +50,7 @@
<div class="section-title" (click)="apriPagina('bi')" tappable>
I miei risultati
</div>
</div>
</div>-->
</div>
</div>
</ion-content>
......@@ -184,10 +184,9 @@ export class IntervistePage implements OnInit {
async loadTopics(fase)
{
this.utilService.showLoading();
//this.utilService.showLoading();
this.idCliente = AuthService.clienteSelezionato.id;
if(fase == "initial") this.intervisteService.getListaTopics(AuthService.clienteSelezionato.id, null, null).subscribe((res: RichiesteResponse)=>{
this.utilService.closeLoading();
if(res.error){
this.utilService.presentAlert("Errore", "", res.error, ["OK"]);
}
......@@ -197,9 +196,10 @@ export class IntervistePage implements OnInit {
if(this.topics != null && this.topics.length > 0 && this.topicAttivo.idRichiesta == null) this.topicAttivo = this.topics[0];
else this.apriTopic(this.topicAttivo.idRichiesta);
}
//this.utilService.closeLoading();
},
(error: ErrorResponse) => {
this.utilService.closeLoading();
//this.utilService.closeLoading();
if(error != null && error.errorMsg != null) this.utilService.presentAlert("Errore", "", error.errorMsg, ["OK"]);
else if(error!=null) this.utilService.presentAlert("Errore", "", error, ["OK"]);
else this.utilService.presentAlert("Errore", "", "Errore durante la procedura di apertura del Topic", ["OK"]);
......@@ -330,10 +330,10 @@ export class IntervistePage implements OnInit {
saveNewTopic(form)
{
this.utilService.showLoading();
//this.utilService.showLoading();
this.idCliente = AuthService.clienteSelezionato.id;
this.intervisteService.newTopic(this.idCliente, form.value.title, form.value.question).subscribe((res: NewRichiestaResponse)=>{
this.utilService.closeLoading();
//this.utilService.closeLoading();
if(res.error){
this.utilService.presentAlert("Errore", "", res.error, ["OK"]);
}
......@@ -344,7 +344,7 @@ export class IntervistePage implements OnInit {
}
},
(error: ErrorResponse) => {
this.utilService.closeLoading();
//this.utilService.closeLoading();
if(error != null && error.errorMsg != null) this.utilService.presentAlert("Errore", "", error.errorMsg, ["OK"]);
else if(error!=null) this.utilService.presentAlert("Errore", "", error, ["OK"]);
else this.utilService.presentAlert("Errore", "", "Errore durante la procedura di creazione nuovo topic", ["OK"]);
......
......@@ -154,6 +154,7 @@ export class SegreteriaPage implements OnInit {
async redirectTo2p2()
{
var id = await this.authService.getId();
//id = 1096;
this.segreteriaService.getP2pToken(id).subscribe((res)=>{
var token = res.token;
window.open(this.httpClientDataService.P2PSingleSignOnUrl+token, "_system");
......
......@@ -64,7 +64,7 @@ export class SegreteriaService {
getP2pToken(idCliente)
{
idCliente = 1096;
//idCliente = 1096;
var body = UtilService.encodeBody({userkey: idCliente});
return this.httpClient.post<P2pResponse>(this.httpClientDataService.P2PTokenUrl, body, this.httpClientDataService.httpOptions)
.pipe(
......
......@@ -4,6 +4,7 @@ import { HttpClient } from '@angular/common/http';
import { File} from '@ionic-native/file/ngx';
import { FileOpener } from '@ionic-native/file-opener/ngx';
import { Router } from "@angular/router";
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
const delay = ms => new Promise(res => setTimeout(res, ms));
......@@ -24,7 +25,8 @@ export class UtilService {
private file: File,
private fileOpener: FileOpener,
private router: Router,
public platform: Platform
public platform: Platform,
private socialSharing: SocialSharing
) {
this.loaders = new Array();
this.loader = this.loadingCtrl.create({
......@@ -45,7 +47,7 @@ export class UtilService {
}
loader;
loaders;
loaders: Array<any>;
async showLoading() {
this.loader = await this.loadingCtrl.create({
......@@ -56,8 +58,25 @@ export class UtilService {
}
closeLoading() {
this.loader = this.loaders.pop();
this.loader.dismiss();
if(this.loaders.length > 0)
{
this.loader = this.loaders.pop();
this.loader.dismiss();
}
else{
setTimeout(() => {
this.secondClose()
}, 2000)
}
}
secondClose()
{
if(this.loaders.length > 0)
{
this.loader = this.loaders.pop();
this.loader.dismiss();
}
}
getDateString(date: Date) :string
......@@ -113,6 +132,31 @@ export class UtilService {
wait();
}
shareDocumento(fileUrl: string, nomeFile: string)
{
var path = "";
path = this.file.externalDataDirectory;
nomeFile = nomeFile.replace(/\//g, "-");
this.showLoading();
this.download(fileUrl)
.subscribe(
(data) => { // Success
this.file.writeFile(path, nomeFile, data, { replace: true }).then((fileEntry: FileEntry) => {
console.log("File created!");
this.closeLoading();
this.socialSharing.shareViaWhatsApp(null, fileEntry.toURL(), null).then(() => {
console.log("Filecondiviso con successo!");
}).catch((e) => {
this.presentAlert("Avviso", "", 'Errore durante l\'apertura del file:' + e, ["OK"]);
});
},
(error) =>{
console.error(error);
}
);
});
}
downloadDocumento(fileUrl: string, nomeFile: string)
{
var path = "";
......
......@@ -607,6 +607,11 @@ ion-menu{
margin: 5px 0px;
border-bottom: 1px solid $grigio-lite;
//overflow: hidden;
.check {
float: left;
margin-top: 12px;
margin-right: 15px;
}
.table-row {
.row-text {
font-size: 18px;
......@@ -983,9 +988,13 @@ ion-menu{
}
}
.search-date-border
{
border-bottom: 1px solid $grigio-superlite;
}
.search-date {
font-size: 13px;
border-bottom: 1px solid $grigio-superlite;
padding-bottom: 15px;
margin-bottom: 5px;
input[type=input] {
......
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