This commit is contained in:
Peter Maquiran
2021-08-13 16:39:28 +01:00
parent 9653efd983
commit 8e2209ac72
12 changed files with 206 additions and 174 deletions
+12 -1
View File
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ProcessesService } from '../services/processes.service';
import { ProcessDocumentService } from './process-document.service';
@Injectable({
@@ -9,11 +10,21 @@ export class ExpedientesService {
constructor(
private iab: InAppBrowser,
private processDocumentService: ProcessDocumentService
private processDocumentService: ProcessDocumentService,
private processes: ProcessesService,
) { }
viewDocument({DocId, ApplicationId}) {
this.processDocumentService.viewDocument({DocId, ApplicationId})
}
CompleteTask({body}) {
return this.processes.CompleteTask(body)
}
UpdateTaskStatus({FolderId}){
return this.processes.UpdateTaskStatus(FolderId)
}
}
@@ -50,6 +50,7 @@ export class CreateProcessPage implements OnInit {
];
taskType:string;
task: any;
fulltask: any
taskParticipants: any = [];
taskParticipantsCc: any = [];
@@ -117,7 +118,7 @@ export class CreateProcessPage implements OnInit {
SourceId: this.task.workflowInstanceDataFields.SourceID, //FolderId
DeadlineType: '',
SubjectTypes: this.selectedTypes,
NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber,
NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber || this.fulltask.workflowInstanceDataFields.DispatchNumber,
};
this.postData.DispatchFolder = this.dispatchFolder;
@@ -403,6 +403,7 @@ export class DespachoPrPage implements OnInit {
taskAction: taskAction,
task: task,
profile: this.profile,
fulltak: this.fulltask
},
cssClass: classs,
});
@@ -343,6 +343,7 @@ export class DespachoPage implements OnInit {
taskAction: taskAction,
task: task,
profile: this.profile,
fulltask: this.fulltask
},
cssClass: classs,
});
@@ -399,7 +399,7 @@ export class ExpedienteDetailPage implements OnInit {
});
}
async distartExpedientModal(body:any){
async distartExpedientModal(body:any) {
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -441,11 +441,11 @@ export class ExpedienteDetailPage implements OnInit {
}
}
else{
if(res['data']== 'Yes'){
if(res['data']== 'Yes') {
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise();
await this.expedientesService.CompleteTask(body).toPromise();
//this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
@@ -455,7 +455,7 @@ export class ExpedienteDetailPage implements OnInit {
}
}
else if(res['data'] == 'No'){
else if(res['data'] == 'No') {
console.log('Update');
const loader = this.toastService.loading()
try {
@@ -310,6 +310,7 @@ export class PedidoPage implements OnInit {
componentProps: {
taskAction: taskAction,
task: this.fulltask,
fulltask: this.fulltask
},
cssClass: classs,
});
-1
View File
@@ -15,7 +15,6 @@ export class SearchDocumentPipe implements PipeTransform {
transformToAttachment(document: SearchDocument): Attachments[] {
const attachments = []
console.log('document', document)
if(document.ApplicationType == 361) {
attachments.push({
ApplicationId: 361,
+119 -110
View File
@@ -50,50 +50,54 @@ export class NotificationsService {
const geturl = environment.apiURL + 'notifications/token';
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
window['MFPPush'].initialize(
function (successResponse) {
console.log("Push notification Successfully Service intialized: " + successResponse);
},
function (failureResponse) {
console.log("Push notification failure Service intialized: " + failureResponse);
}
);
window['MFPPush'].registerDevice(null, (successResponse) => {
console.log("Successfully registered: " + JSON.stringify(successResponse));
console.log('token: ', successResponse.deviceId)
this.storageService.store(username, successResponse.deviceId);
this.storageService.get(username).then(value => {
console.log('STORAGE TOKEN', value)
this.storageService.get(AuthConnstants.USER).then(res => {
console.log('USERID', res);
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
const body = {
UserId: res.UserId,
TokenId: successResponse.deviceId,
Status: 1,
Service: 1
};
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
console.log('TOKEN USER MIDLE', data);
})
if(window['WLAuthorizationManager'].obtainAccessToken) {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
window['MFPPush'].initialize(
function (successResponse) {
console.log("Push notification Successfully Service intialized: " + successResponse);
},
function (failureResponse) {
console.log("Push notification failure Service intialized: " + failureResponse);
}
);
window['MFPPush'].registerDevice(null, (successResponse) => {
console.log("Successfully registered: " + JSON.stringify(successResponse));
console.log('token: ', successResponse.deviceId)
this.storageService.store(username, successResponse.deviceId);
this.storageService.get(username).then(value => {
console.log('STORAGE TOKEN', value)
this.storageService.get(AuthConnstants.USER).then(res => {
console.log('USERID', res);
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
const body = {
UserId: res.UserId,
TokenId: successResponse.deviceId,
Status: 1,
Service: 1
};
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
console.log('TOKEN USER MIDLE', data);
})
});
});
},
function (failureResponse) {
console.log("Successfully failue: " + JSON.stringify(failureResponse));
}
);
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
);
}
});
},
function (failureResponse) {
console.log("Successfully failue: " + JSON.stringify(failureResponse));
}
);
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
);
}
}
@@ -105,46 +109,90 @@ export class NotificationsService {
} else {
const geturl = environment.apiURL + 'notifications/token';
if(window['WLAuthorizationManager'].obtainAccessToken) {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
window['MFPPush'].initialize(
function (successResponse) {
console.log("Push notification Successfully Service intialized: " + successResponse);
},
function (failureResponse) {
console.log("Push notification failure Service intialized: " + failureResponse);
}
);
window['MFPPush'].registerDevice(null, (successResponse) => {
console.log("Successfully registered: " + JSON.stringify(successResponse));
console.log('token: ', successResponse.deviceId)
/* this.storageService.store(username, successResponse.deviceId);
this.storageService.get(username).then(value => {
console.log('STORAGE TOKEN', value)
this.storageService.get(AuthConnstants.USER).then(res => {
console.log('USERID', res);
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
const body = {
UserId: res.UserId,
TokenId: successResponse.deviceId,
Status: 1,
Service: 1
};
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
console.log('TOKEN USER MIDLE', data);
})
});
}); */
},
function (failureResponse) {
console.log("Successfully failue: " + JSON.stringify(failureResponse));
}
);
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
);
}
}
}
async onReceviNotification() {
if(window['WLAuthorizationManager'].obtainAccessToken) {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
window['MFPPush'].initialize(
function (successResponse) {
console.log("Push notification Successfully Service intialized: " + successResponse);
console.log("Push notification Successfully intialized: " + successResponse);
window['MFPPush'].registerNotificationsCallback(notificationReceived);
},
function (failureResponse) {
console.log("Push notification failure Service intialized: " + failureResponse);
console.log("Push notification failure intialized: " + failureResponse);
}
);
window['MFPPush'].registerDevice(null, (successResponse) => {
console.log("Successfully registered: " + JSON.stringify(successResponse));
console.log('token: ', successResponse.deviceId)
/* this.storageService.store(username, successResponse.deviceId);
this.storageService.get(username).then(value => {
console.log('STORAGE TOKEN', value)
this.storageService.get(AuthConnstants.USER).then(res => {
console.log('USERID', res);
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
const body = {
UserId: res.UserId,
TokenId: successResponse.deviceId,
Status: 1,
Service: 1
};
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
console.log('TOKEN USER MIDLE', data);
})
});
}); */
},
function (failureResponse) {
console.log("Successfully failue: " + JSON.stringify(failureResponse));
var notificationReceived = (message) => {
//this.jsonstore.createCollection('Notifications',message);
this.DataArray.push(message)
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
console.log(message);
var data = JSON.parse(message.payload);
console.log(data.Service);
console.log(data.IdObject);
console.log(data.Object);
if(message.actionName){
this.notificatinsRoutes(data);
} else {
this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
}
);
}
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
@@ -154,45 +202,6 @@ export class NotificationsService {
}
async onReceviNotification() {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
window['MFPPush'].initialize(
function (successResponse) {
console.log("Push notification Successfully intialized: " + successResponse);
window['MFPPush'].registerNotificationsCallback(notificationReceived);
},
function (failureResponse) {
console.log("Push notification failure intialized: " + failureResponse);
}
);
var notificationReceived = (message) => {
//this.jsonstore.createCollection('Notifications',message);
this.DataArray.push(message)
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
console.log(message);
var data = JSON.parse(message.payload);
console.log(data.Service);
console.log(data.IdObject);
console.log(data.Object);
if(message.actionName){
this.notificatinsRoutes(data);
} else {
this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
}
}
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
);
}
notificatinsRoutes = (data) => {
if (data.Service === "agenda") {
this.zone.run(() => this.router.navigate(['/home/agenda', data.IdObject, 'agenda']));
+33 -30
View File
@@ -47,38 +47,41 @@ export class WebNotificationsService {
}
async onReceviNotificationWeb() {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
MFPPush.initialize(
function (successResponse) {
console.log("Push notification Successfully intialized: " + successResponse);
MFPPush.registerNotificationsCallback(notificationReceived);
},
function (failureResponse) {
console.log("Push notification failure intialized: " + failureResponse);
if(window['WLAuthorizationManager'].obtainAccessToken) {
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
(token) => {
console.log('Push Notification: Success ' + token);
MFPPush.initialize(
function (successResponse) {
console.log("Push notification Successfully intialized: " + successResponse);
MFPPush.registerNotificationsCallback(notificationReceived);
},
function (failureResponse) {
console.log("Push notification failure intialized: " + failureResponse);
}
);
var notificationReceived = (message) => {
console.log(message);
var data = JSON.parse(message.payload);
console.log(data.Service);
console.log(data.IdObject);
console.log(data.Object);
if(message.actionName){
//this.notificatinsRoutes(data);
} else {
//this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
}
}
);
var notificationReceived = (message) => {
console.log(message);
var data = JSON.parse(message.payload);
console.log(data.Service);
console.log(data.IdObject);
console.log(data.Object);
if(message.actionName){
//this.notificatinsRoutes(data);
} else {
//this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
}
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
}, (error) => {
console.log('Push notification recived: failure ' + error.responseText);
console.log(JSON.stringify(error));
}
);
);
}
}
/* getTokenByUserIdAndId(user, userID) {
@@ -53,6 +53,7 @@ export class DespachosOptionsPage implements OnInit {
componentProps: {
taskAction: taskAction,
task: task,
fulltask: this.fulltask
},
cssClass: classs,
});
@@ -78,6 +78,7 @@ export class DespachosPrOptionsPage implements OnInit {
taskAction: taskAction,
task: task,
profile: this.profile,
fulltask: this.fulltask
},
cssClass: classs,
});
+31 -27
View File
@@ -1,33 +1,37 @@
function wlCommonInit() {
if(window['WLAuthorizationManager'].obtainAccessToken) {
window['WLAuthorizationManager'].obtainAccessToken("").then(
(token) => {
console.log('MobileFirst Server connect: Success ' + token);
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
WLResourceRequest.GET
);
resourceRequest.setQueryParameter("name", "world");
resourceRequest.send().then(
(response) => {
// Will display "Hello world" in an alert dialog.
console.log("Connect with JavaAdapter Success: " + response.responseText);
//this.MFPushNotification();
},
(error) => {
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
}
);
}, (error) => {
console.log('MobileFirst Server connect: failure ' + error.responseText);
console.log(JSON.stringify(error))
/* this.zone.run(() => {
alert("Bummer...");
alert("Failed to connect to MobileFirst Server");
}); */
}
);
}
window['WLAuthorizationManager'].obtainAccessToken("").then(
(token) => {
console.log('MobileFirst Server connect: Success ' + token);
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
WLResourceRequest.GET
);
resourceRequest.setQueryParameter("name", "world");
resourceRequest.send().then(
(response) => {
// Will display "Hello world" in an alert dialog.
console.log("Connect with JavaAdapter Success: " + response.responseText);
//this.MFPushNotification();
},
(error) => {
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
}
);
}, (error) => {
console.log('MobileFirst Server connect: failure ' + error.responseText);
console.log(JSON.stringify(error))
/* this.zone.run(() => {
alert("Bummer...");
alert("Failed to connect to MobileFirst Server");
}); */
}
);