mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
merge
This commit is contained in:
@@ -183,7 +183,7 @@ export class HomePage implements OnInit {
|
||||
JSON.parse(req).forEach(element => {
|
||||
this.eventservice.editEvent(element, 2, 3).subscribe((res) => {
|
||||
this.storage.remove('eventEdit')
|
||||
this.sqliteservice.deleteEventTable();
|
||||
//this.sqliteservice.deleteeventsTable();
|
||||
console.log('eventEdit synchnize', res)
|
||||
})
|
||||
});
|
||||
@@ -198,7 +198,6 @@ export class HomePage implements OnInit {
|
||||
console.log('DELETE data SYNC', element)
|
||||
this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => {
|
||||
this.storage.remove('eventDelete')
|
||||
this.sqliteservice.deleteEventTable();
|
||||
console.log('eventDelete synchnize', res)
|
||||
})
|
||||
});
|
||||
@@ -213,7 +212,6 @@ export class HomePage implements OnInit {
|
||||
console.log('REVER data SYNC', element)
|
||||
this.processservice.PostTaskAction(element).subscribe((res) => {
|
||||
this.storage.remove('event-listRever')
|
||||
this.sqliteservice.deleteEventTable();
|
||||
console.log('event-listRever synchnize', res)
|
||||
})
|
||||
});
|
||||
@@ -221,6 +219,8 @@ export class HomePage implements OnInit {
|
||||
} catch (error) {
|
||||
console.log('error event-list rever synch')
|
||||
}
|
||||
|
||||
this.sqliteservice.deleteAllTables();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,66 +1,34 @@
|
||||
|
||||
<!-- <div class="Rectangle"> -->
|
||||
<ion-content fullscreen>
|
||||
<ion-header translucent>
|
||||
<ion-toolbar>
|
||||
<div class="title-content width-100 d-flex justify-space-between align-center">
|
||||
<div class= "btn-dismiss font-30 cursor-pointer" (click)="close()">
|
||||
<ion-icon style="margin-bottom:-8px" slot="end" src="assets/images/icons-arrow-arrow-left.svg" class="iconsarrowarrow-left"></ion-icon>
|
||||
</div>
|
||||
<div class="middle d-flex align-center flex-grow-1">
|
||||
<div><b><ion-label class="digitalizacao_001pd">{{name}} </ion-label></b><br>
|
||||
<ion-label class="place">{{_updatedAt | date}}</ion-label></div>
|
||||
|
||||
<ion-card class="cardconteudo" >
|
||||
|
||||
<ion-card-content >
|
||||
<ion-card-header >
|
||||
|
||||
|
||||
<ion-text color="dark" size="6">{{username}} <span>{{_updatedAt | date}}</span><div class="right" (click)="getIconGallery()"><ion-icon name="pencil-outline" ></ion-icon></div></ion-text>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- <ion-text > <span class="digitalizacao_001pd">{{username}} {{_updatedAt | date}}</span></ion-text> -->
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-card-content class="Bitmap" >
|
||||
|
||||
<img src="{{image}}" style="margin-top: 50%;"/>
|
||||
|
||||
|
||||
|
||||
</ion-card-header>
|
||||
|
||||
<img src="{{image}}" />
|
||||
|
||||
</ion-card-content>
|
||||
<!-- <image-cropper [imageBase64]="myimage"
|
||||
[maintainAspectRatio]="true"
|
||||
[aspectRatio]="4 / 3"
|
||||
outputType = "base64"
|
||||
format="png"
|
||||
[resizeToWidth]="true"
|
||||
(imageCropped)="imageCropped($event)"
|
||||
|
||||
></image-cropper> -->
|
||||
</ion-card-content>
|
||||
<!-- <ion-footer class="Rectangle-Copy-5">
|
||||
|
||||
</ion-footer> -->
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ion-footer color="light">
|
||||
<ion-row>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="close()" fill="clear" color="light">
|
||||
<!-- <ion-icon name="remove" slot="start"></ion-icon> -->
|
||||
<ion-icon src="assets/icon/chat/circle-xmark-solid 1.svg" ></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="deleteImage()" fill="clear" color="light">
|
||||
<ion-icon src="assets/icon/chat/Ellipse 8.svg" ></ion-icon>
|
||||
<!-- <ion-icon class="redla" name="flower-outline"></ion-icon> -->
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="getIconGallery()" fill="clear" color="light">
|
||||
|
||||
<ion-icon src="assets/icon/chat/Ellipselast.svg" ></ion-icon>
|
||||
|
||||
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="getIconShare()" fill="clear" color="light">
|
||||
|
||||
<ion-icon src="assets/icon/chat/Ellipse 9.svg" ></ion-icon>
|
||||
|
||||
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<!-- <ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="zoom(true)" fill="clear" color="light">
|
||||
<ion-icon class="redla" name="alert-circle"></ion-icon>
|
||||
|
||||
</ion-button>
|
||||
</ion-col> -->
|
||||
</ion-row>
|
||||
</ion-footer>
|
||||
</ion-card>
|
||||
|
||||
@@ -36,25 +36,76 @@ float: right;
|
||||
}
|
||||
|
||||
|
||||
circle-xmark-solid{
|
||||
|
||||
// position: relative;
|
||||
width: 512px;
|
||||
height: 515px;
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
right: 0%;
|
||||
top: 0%;
|
||||
bottom: 0%;
|
||||
|
||||
background: #FCD13A;
|
||||
|
||||
|
||||
ion-icon {
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.Rectangle {
|
||||
width: 400px;
|
||||
height: 666px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.49);
|
||||
background-color: var(--white);
|
||||
|
||||
}
|
||||
|
||||
/* Vector */
|
||||
|
||||
|
||||
.digitalizacao_001pd {
|
||||
width: 238px;
|
||||
height: 29px;
|
||||
margin: 3px 3px 3px 0;
|
||||
font-family: Roboto;
|
||||
font-size: 20px;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
line-height: normal;
|
||||
letter-spacing: normal;
|
||||
color: var(--black);
|
||||
|
||||
}
|
||||
.iconsarrowarrow-left {
|
||||
width: 36px;
|
||||
height: 35px;
|
||||
padding: 9px 14px 8px 13px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
|
||||
CSS
|
||||
.Rectangle-Copy-5 {
|
||||
width: 400px;
|
||||
height: 60px;
|
||||
margin: 43px 0 0;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
CSS
|
||||
.Bitmap {
|
||||
width: 358px;
|
||||
height: 506px;
|
||||
margin: 100px;
|
||||
}
|
||||
|
||||
.inside{
|
||||
background-color: var(--very-light-grey);
|
||||
}
|
||||
.place{
|
||||
float : left;
|
||||
font-size: 14px;
|
||||
|
||||
}
|
||||
.footer{
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
.distance{
|
||||
margin-left: 100px;
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import { ImageCroppedEvent } from 'ngx-image-cropper';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
||||
import { Share } from '@capacitor/share';
|
||||
import { Router } from '@angular/router';
|
||||
import { Directory, Filesystem } from '@capacitor/filesystem';
|
||||
|
||||
@Component({
|
||||
selector: 'app-preview-camera',
|
||||
@@ -14,12 +16,13 @@ export class PreviewCameraPage implements OnInit {
|
||||
|
||||
constructor( private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
public router: Router,
|
||||
private publicService: PublicationsService) { }
|
||||
|
||||
|
||||
@ViewChild(IonSlides) slides : IonSlides
|
||||
image: any;
|
||||
username: string
|
||||
name: string
|
||||
_updatedAt: string
|
||||
|
||||
|
||||
@@ -37,7 +40,7 @@ export class PreviewCameraPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.image = this.navParams.get('image')
|
||||
this.username = this.navParams.get('username')
|
||||
this.name = this.navParams.get('username')
|
||||
this._updatedAt = this.navParams.get('_updatedAt')
|
||||
console.log(this.image)
|
||||
// this.image = this.myimage
|
||||
@@ -94,27 +97,50 @@ async getIconGallery(){
|
||||
|
||||
}
|
||||
deleteImage(){
|
||||
window.onload = function(){
|
||||
const delmage = document.getElementById("img")
|
||||
delmage.onclick = function(){
|
||||
return window.localStorage.removeItem("img")
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', ()=>{
|
||||
document.querySelector('img').addEventListener('click',removeImage)
|
||||
})
|
||||
function removeImage(ev){
|
||||
console.log(ev.target, ev.currentTarget)
|
||||
let img = ev.currentTarget
|
||||
let src = ev.target.closest('.img')
|
||||
src?.parentElement.removeChild(src)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
async getIconShare(){
|
||||
|
||||
|
||||
await Share.share({
|
||||
title: 'See cool stuff',
|
||||
text: 'Really awesome thing you need to see right meow',
|
||||
url: this.image,
|
||||
url: "https://www.google.com/search?q=joao+louren%C3%A7o&rlz=1C1SQJL_pt-PTAO977AO977&sxsrf=AOaemvIEvXz_WiqNNapjaoE42Q8b71jtiA:1638355797910&source=lnms&tbm=isch&sa=X&sqi=2&ved=2ahUKEwjo9uX6tsL0AhXTlWoFHX1XAtcQ_AUoAXoECAMQAw&biw=1920&bih=937&dpr=1#imgrc=lH5UYZyhPKBhHM",
|
||||
dialogTitle: 'Share with buddies',
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
redirPage(){
|
||||
this.router.navigateByUrl('/chat')
|
||||
}
|
||||
|
||||
|
||||
|
||||
async deleteFile(entry){
|
||||
if(entry.isFile){
|
||||
await Filesystem.deleteFile({
|
||||
directory: Directory.Documents,
|
||||
path: this.image.src + '/' + entry.name
|
||||
})
|
||||
}else{
|
||||
await Filesystem.rmdir({
|
||||
directory: Directory.Documents,
|
||||
path: this.image.src + '/' + entry.name,
|
||||
recursive:true //remove all file as well
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.getFromDB();
|
||||
//this.getFromDB();
|
||||
|
||||
const pathname = window.location.pathname
|
||||
let realoadCounter = 0
|
||||
@@ -243,7 +243,7 @@ export class AgendaPage implements OnInit {
|
||||
this.segment = "Combinado";
|
||||
}
|
||||
if (realoadCounter != 0) {
|
||||
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
realoadCounter++;
|
||||
}
|
||||
@@ -515,6 +515,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
console.log('CALENDAR STORE', this.CalendarStore.eventSource)
|
||||
this.listToPresent = this.CalendarStore.eventSource
|
||||
this.trasnformData(response, 'md');
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
@@ -537,12 +538,15 @@ export class AgendaPage implements OnInit {
|
||||
else if (this.profile == "pr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||
this.addEventToDB(response, "pr");
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
// calendar
|
||||
this.CalendarStore.pushEvent(response, 'pr');
|
||||
|
||||
this.listToPresent = this.CalendarStore.eventSource
|
||||
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
@@ -555,9 +559,9 @@ export class AgendaPage implements OnInit {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
this.showLoader = false;
|
||||
})
|
||||
.finally(() => {
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
}
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
@@ -571,6 +575,7 @@ export class AgendaPage implements OnInit {
|
||||
// startTime = 1, endTime = 31
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
this.CalendarStore.pushEvent(response, 'pr');
|
||||
|
||||
this.listToPresent = this.CalendarStore.eventSource
|
||||
|
||||
|
||||
@@ -603,12 +608,14 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||
|
||||
this.addEventToDB(response, "md");
|
||||
let eventsList = response;
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||
|
||||
// loop
|
||||
this.CalendarStore.pushEvent(eventsList, 'md');
|
||||
|
||||
this.listToPresent = this.CalendarStore.eventSource
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
@@ -628,23 +635,26 @@ export class AgendaPage implements OnInit {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
counter++;
|
||||
if (counter == 2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
counter++;
|
||||
if (counter == 2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||
|
||||
this.addEventToDB(response, "pr");
|
||||
let eventsList = response;
|
||||
|
||||
// clear the current month only
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
|
||||
this.CalendarStore.pushEvent(eventsList, 'pr');
|
||||
this.listToPresent = this.CalendarStore.eventSource
|
||||
|
||||
|
||||
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
@@ -663,18 +673,19 @@ export class AgendaPage implements OnInit {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
counter++;
|
||||
if (counter == 2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
counter++;
|
||||
if (counter == 2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
// view PR calendar with PR profile
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||
|
||||
this.addEventToDB(response, "pr");
|
||||
let eventsList;
|
||||
if (this.segment == 'Oficial') {
|
||||
eventsList = response.filter(data => data.CalendarName == "Oficial");
|
||||
@@ -708,18 +719,19 @@ export class AgendaPage implements OnInit {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
if (counter == 1 || this.loggeduser.Profile == 'PR') {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (counter == 1 || this.loggeduser.Profile == 'PR') {
|
||||
this.showLoader = false;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
trasnformData(response,profile) {
|
||||
trasnformData(response, profile) {
|
||||
console.log('Transform ', response)
|
||||
response.forEach(element => {
|
||||
let event = {
|
||||
startTime: new Date(element.StartDate),
|
||||
@@ -736,6 +748,25 @@ export class AgendaPage implements OnInit {
|
||||
console.log('LIST TO PRESET', this.listToPresent)
|
||||
}
|
||||
|
||||
//Deve ser removido para ficar só um method transform
|
||||
trasnformDataDB(response) {
|
||||
console.log('Transform ', response)
|
||||
response.forEach(element => {
|
||||
let event = {
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
allDay: false,
|
||||
event: element,
|
||||
calendarName: element.CalendarName,
|
||||
profile: element.Profile,
|
||||
id: element.EventId,
|
||||
}
|
||||
this.array.push(event)
|
||||
});
|
||||
this.listToPresent = this.array;
|
||||
console.log('LIST TO PRESET', this.listToPresent)
|
||||
}
|
||||
|
||||
addEventToDB(response, profile) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
@@ -756,7 +787,7 @@ export class AgendaPage implements OnInit {
|
||||
Profile: profile
|
||||
}
|
||||
this.sqliteservice.addEvent(event)
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -767,7 +798,8 @@ export class AgendaPage implements OnInit {
|
||||
this.sqliteservice.getAllEvents().then((events: any[]) => {
|
||||
console.log('ALL EVENTS FROM DB', events)
|
||||
let eventArray = [];
|
||||
this.trasnformData(events,this.profile)
|
||||
|
||||
this.trasnformDataDB(events)
|
||||
this.updateEventListBox()
|
||||
|
||||
this.myCal.update();
|
||||
@@ -816,7 +848,7 @@ export class AgendaPage implements OnInit {
|
||||
case "Oficial":
|
||||
|
||||
if (this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, {})
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, {segment: this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
} else {
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
@@ -633,7 +633,7 @@ touchStart(card) {
|
||||
cssClass: 'transparent-modal',
|
||||
componentProps: {
|
||||
image: img.attachments[0].image_url,
|
||||
username: img.u.username,
|
||||
username: img.u.name,
|
||||
_updatedAt: img._updatedAt
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
|
||||
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
|
||||
// import { SocialSharing } from '@ionic-native/social-sharing/ngx';
|
||||
import { Share } from '@capacitor/share';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
@@ -91,7 +91,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private processes: ProcessesService,
|
||||
public ThemeService: ThemeService,
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
private socialSharing: SocialSharing
|
||||
// private socialSharing: SocialSharing
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
@@ -643,10 +643,10 @@ touchStart(card) {
|
||||
async openPreview(msg) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PreviewCameraPage,
|
||||
cssClass: 'transparent-modal',
|
||||
cssClass: 'modal modal-desktop',
|
||||
componentProps: {
|
||||
image: msg.attachments[0].image_url,
|
||||
username: msg.u.username,
|
||||
username: msg.u.name,
|
||||
_updatedAt: msg._updatedAt,
|
||||
}
|
||||
|
||||
@@ -675,15 +675,15 @@ getPicture(img){
|
||||
|
||||
}
|
||||
|
||||
async ShareEmail(msg){
|
||||
// Check if sharing via email is supported
|
||||
await Share.share({
|
||||
title: msg.u.username,
|
||||
text: msg._updatedAt,
|
||||
url: msg.attachments[0].image_url,
|
||||
dialogTitle: 'Share with buddies',
|
||||
});
|
||||
}
|
||||
// async ShareEmail(msg){
|
||||
// // Check if sharing via email is supported
|
||||
// await Share.share({
|
||||
// title: msg.u.username,
|
||||
// text: msg._updatedAt,
|
||||
// url: msg.attachments[0].image_url,
|
||||
// dialogTitle: 'Share with buddies',
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -197,10 +197,13 @@ export class EventsPage implements OnInit {
|
||||
this.showLoader = true;
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let start = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
let end = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " 23:59:59";
|
||||
let month = date.getMonth() + 1;
|
||||
//date.setMonth(date.getMonth() + 1);
|
||||
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
|
||||
|
||||
console.log('Data start yahaya', start)
|
||||
console.log('Data end yahaya', end)
|
||||
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
@@ -368,8 +371,9 @@ export class EventsPage implements OnInit {
|
||||
getEventsFromLocalDb() {
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let dateToday = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate();
|
||||
let month = date.getMonth() + 1;
|
||||
//date.setMonth(date.getMonth() + 1);
|
||||
let dateToday = date.getFullYear() + "-" + month + "-" + date.getDate();
|
||||
console.log('dateeeeee', dateToday)
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
@@ -420,16 +424,20 @@ export class EventsPage implements OnInit {
|
||||
|
||||
var expedientlist: any = new Array();
|
||||
process.forEach((element) => {
|
||||
let task = {
|
||||
activityInstanceName: element.activityInstanceName,
|
||||
deadline: null,
|
||||
serialNumber: element.serialNumber,
|
||||
taskStartDate: element.taskStartDate,
|
||||
totalDocuments: element.totalDocuments,
|
||||
workflowDisplayName: element.workflowDisplayName,
|
||||
workflowInstanceDataFields: JSON.parse(element.workflowInstanceDataFields)
|
||||
if(JSON.parse(element.workflowInstanceDataFields).TaskMessage || JSON.parse(element.workflowInstanceDataFields).Note) {
|
||||
|
||||
let task = {
|
||||
activityInstanceName: element.activityInstanceName,
|
||||
deadline: null,
|
||||
serialNumber: element.serialNumber,
|
||||
taskStartDate: element.taskStartDate,
|
||||
totalDocuments: element.totalDocuments,
|
||||
workflowDisplayName: element.workflowDisplayName,
|
||||
workflowInstanceDataFields: JSON.parse(element.workflowInstanceDataFields)
|
||||
}
|
||||
expedientlist.push(task);
|
||||
|
||||
}
|
||||
expedientlist.push(task);
|
||||
})
|
||||
|
||||
console.log('OFOFOFOOF22222', expedientlist)
|
||||
|
||||
+23
-5
@@ -148,6 +148,24 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"InstanceID": workflow.InstanceID
|
||||
}
|
||||
|
||||
this.fulltask = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
activityInstanceName: process[0].activityInstanceName,
|
||||
formURL: process[0].formURL,
|
||||
interveners: process[0].interveners,
|
||||
originator: JSON.parse(process[0].originator),
|
||||
serialNumber: process[0].serialNumber,
|
||||
taskStartDate: process[0].taskStartDate,
|
||||
totalDocuments: process[0].totalDocuments,
|
||||
workflowDisplayName: process[0].workflowDisplayName,
|
||||
workflowID: process[0].workflowID,
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName,
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -341,7 +359,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
})
|
||||
|
||||
console.log('this.task', this.task.InstanceID)
|
||||
console.log('this.task.DocumentURL', this.task.DocumentURL)
|
||||
console.log('this.task.DocumentURL', this.fulltask)
|
||||
|
||||
}, (error) => {
|
||||
|
||||
@@ -615,21 +633,21 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
openNewGroupPage(){
|
||||
openNewGroupPage() {
|
||||
this.router.navigate(['/home/chat']);
|
||||
this.dataService.set("newGroup", true);
|
||||
|
||||
if( window.innerWidth < 801){
|
||||
if (window.innerWidth < 801) {
|
||||
this.newGroup();
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.dataService.set("newGroup", true);
|
||||
/* this.closeAllDesktopComponents();
|
||||
this.showNewGroup=true; */
|
||||
}
|
||||
}
|
||||
|
||||
async newGroup(){
|
||||
async newGroup() {
|
||||
const modal = await this.modalController.create({
|
||||
component: NewGroupPage,
|
||||
cssClass: 'modal modal-desktop',
|
||||
|
||||
-1
@@ -126,7 +126,6 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async editPost(publicationType:any) {
|
||||
console.log(this.publication);
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
@@ -68,8 +68,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
if (typeof (this.folderId) == 'object') {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
this.getPublicationsIds()
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
this.getPublicationsIds();
|
||||
@@ -77,7 +76,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
this.getPublicationDetail();
|
||||
this.getPublicationsIds();
|
||||
this.testForkJoin()
|
||||
|
||||
})
|
||||
|
||||
@@ -94,14 +93,14 @@ export class ViewPublicationsPage implements OnInit {
|
||||
// }
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
this.getPublicationsIds();
|
||||
// this.getPublicationsIds();
|
||||
}
|
||||
|
||||
doRefresh = (event) => {
|
||||
setTimeout(() => {
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
this.getPublicationsIds();
|
||||
// this.getPublicationsIds();
|
||||
event.target.complete();
|
||||
}, 3000);
|
||||
|
||||
@@ -129,35 +128,35 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
// goes to fork
|
||||
getPublicationsIds() {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
|
||||
this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
|
||||
|
||||
console.log(this.id)
|
||||
|
||||
this.publicationList = new Array();
|
||||
|
||||
// getPublicationsIds() {
|
||||
|
||||
// this.showLoader = true;
|
||||
// const folderId = this.folderId
|
||||
|
||||
// this.publications.GetPublicationsID(this.folderId).subscribe(res => {
|
||||
// this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
|
||||
|
||||
// console.log(this.id)
|
||||
|
||||
// console.log('publications ids', res)
|
||||
// this.publicationList = new Array();
|
||||
|
||||
// for(let i of res) {
|
||||
// this.publications.GetPublicationById(i).subscribe(ress => {
|
||||
// console.log('publications by ids', ress)
|
||||
// let item: Publication = this.publicationPipe.itemList(ress)
|
||||
// console.log('publications by ids 2', item)
|
||||
// this.publicationList.push(item);
|
||||
// })
|
||||
// }
|
||||
getPublicationsIds() {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
|
||||
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
|
||||
|
||||
console.log('publications ids', res)
|
||||
this.publicationList = new Array();
|
||||
|
||||
for(let i of res) {
|
||||
this.publications.GetPublicationById(i).subscribe(ress => {
|
||||
console.log('publications by ids', ress)
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
console.log('publications by ids 2', item)
|
||||
this.publicationList.push(item);
|
||||
})
|
||||
}
|
||||
|
||||
/* res.forEach(element => {
|
||||
console.log('publications elements', element)
|
||||
|
||||
@@ -10,11 +10,15 @@ import { SearchList } from 'src/app/models/search-document';
|
||||
import { ProcessesService } from '../processes.service';
|
||||
import { ToastService } from '../toast.service';
|
||||
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
|
||||
|
||||
import {
|
||||
FileSharer} from '@byteowls/capacitor-filesharer';
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { Share } from '@capacitor/share';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
|
||||
interface LocalFile {
|
||||
name: string;
|
||||
path: string;
|
||||
@@ -45,7 +49,8 @@ export class FileService {
|
||||
private processesService: ProcessesService,
|
||||
private toastService: ToastService,
|
||||
private platform: Platform,
|
||||
private loadingCtrl: LoadingController
|
||||
private loadingCtrl: LoadingController,
|
||||
private http: HttpClient
|
||||
) { }
|
||||
|
||||
async takePicture() {
|
||||
@@ -230,15 +235,11 @@ export class FileService {
|
||||
if (image) {
|
||||
await this.saveImage(image,roomId)
|
||||
}
|
||||
/* const response = await fetch(capturedImage.webPath!);
|
||||
const blob = await response.blob();
|
||||
|
||||
this.photos.unshift({
|
||||
filepath: "soon...",
|
||||
webviewPath: capturedImage.webPath
|
||||
}); */
|
||||
|
||||
//this.capturedImage = this.capturedImage;
|
||||
await Share.share({
|
||||
title: 'Check my image',
|
||||
url: image.path
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
@@ -256,6 +257,13 @@ export class FileService {
|
||||
if (capturedImage) {
|
||||
await this.saveImage(capturedImage,roomId)
|
||||
}
|
||||
|
||||
await Share.share({
|
||||
title: 'Check my image',
|
||||
url: capturedImage.path
|
||||
})
|
||||
|
||||
|
||||
/* const response = await fetch(capturedImage.webPath!);
|
||||
const blob = await response.blob();
|
||||
|
||||
@@ -289,6 +297,24 @@ export class FileService {
|
||||
//loader.remove();
|
||||
});
|
||||
*/ }
|
||||
async shareLocalFile(){
|
||||
this.http.get('./assets/any.svg', {responseType: 'blob'}).subscribe(res=>{
|
||||
const reader = new FileReader()
|
||||
reader.onloadend=()=>{
|
||||
const result = reader.result as string
|
||||
const base64Data = result.split(',')[1]
|
||||
|
||||
FileSharer.share({
|
||||
filename:'any.pdf',
|
||||
base64Data,
|
||||
contentType: "application/pdf",
|
||||
})
|
||||
reader.readAsDataURL(res)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
addPictureToChat(roomId) {
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export class PublicationsService {
|
||||
return this.http.delete<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
GetPublicationsID(folder:any) {
|
||||
GetPublicationsImages(folder:any) {
|
||||
const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids';
|
||||
let params = new HttpParams();
|
||||
|
||||
|
||||
@@ -516,9 +516,36 @@ export class SqliteService {
|
||||
});
|
||||
}
|
||||
|
||||
deleteEventTable() {
|
||||
this.dbInstance.executeSql("delete from "+ this.events).then((res) => {
|
||||
deleteAllTables() {
|
||||
this.deleteeventsTable();
|
||||
this.deleteallprocessTable();
|
||||
this.deleteactionsTable();
|
||||
this.deletepublicationsTable();
|
||||
|
||||
console.log('All tables deleted')
|
||||
}
|
||||
|
||||
deleteeventsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.events).then((res) => {
|
||||
console.log('DELETE EVENT TABLE RESULT ', res)
|
||||
});
|
||||
}
|
||||
|
||||
deleteallprocessTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.allprocess).then((res) => {
|
||||
console.log('DELETE ALLPROCESS TABLE RESULT ', res)
|
||||
});
|
||||
}
|
||||
|
||||
deleteactionsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.actions).then((res) => {
|
||||
console.log('DELETE actions TABLE RESULT ', res)
|
||||
});
|
||||
}
|
||||
|
||||
deletepublicationsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.publications).then((res) => {
|
||||
console.log('DELETE publications TABLE RESULT ', res)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user