mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
save
This commit is contained in:
@@ -7,7 +7,6 @@ import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
||||
@@ -35,19 +34,18 @@ export class EditEventPage implements OnInit {
|
||||
profile:string;
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,
|
||||
private iab: InAppBrowser) {
|
||||
private iab: InAppBrowser) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -73,7 +71,7 @@ export class EditEventPage implements OnInit {
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
@@ -99,7 +97,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
@@ -142,20 +140,20 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
@@ -165,18 +163,18 @@ export class EditEventPage implements OnInit {
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
@@ -184,18 +182,14 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
{
|
||||
/* console.log(this.pageId); */
|
||||
|
||||
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
this.loadedEventAttachments = res;
|
||||
console.log(res);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
@@ -230,12 +224,12 @@ export class EditEventPage implements OnInit {
|
||||
cssClass: 'attachments',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||
@@ -32,15 +31,14 @@ export class EventDetailModalPage implements OnInit {
|
||||
profile:string;
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,) {
|
||||
private route: Router,) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
}
|
||||
@@ -75,7 +73,7 @@ export class EventDetailModalPage implements OnInit {
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
@@ -101,7 +99,7 @@ export class EventDetailModalPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
@@ -144,35 +142,35 @@ export class EventDetailModalPage implements OnInit {
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
{
|
||||
if (this.ionicForm.valid)
|
||||
if (this.ionicForm.valid)
|
||||
{
|
||||
|
||||
this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () =>
|
||||
this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
@@ -180,21 +178,17 @@ export class EventDetailModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
{
|
||||
/* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
}); */
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
console.log(res);
|
||||
|
||||
|
||||
},(error) => {
|
||||
console.log(error);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
@@ -234,7 +228,7 @@ export class EventDetailModalPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
||||
@@ -36,16 +35,15 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,
|
||||
private iab: InAppBrowser) {
|
||||
private iab: InAppBrowser) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
}
|
||||
@@ -73,7 +71,7 @@ export class EventDetailPage implements OnInit {
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
@@ -99,7 +97,7 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
@@ -142,18 +140,18 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
{
|
||||
/* const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
|
||||
await alert.present(); */
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
@@ -163,18 +161,18 @@ export class EventDetailPage implements OnInit {
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
@@ -182,18 +180,14 @@ export class EventDetailPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
{
|
||||
/* console.log(this.pageId); */
|
||||
|
||||
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
this.loadedEventAttachments = res;
|
||||
console.log(res);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
@@ -228,17 +222,17 @@ export class EventDetailPage implements OnInit {
|
||||
cssClass: 'attachments',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
await modal.present();
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Event } from '../../models/event.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd } from '@angular/router';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
@@ -78,7 +77,6 @@ export class EventsPage implements OnInit {
|
||||
private router: Router,
|
||||
private storageService:StorageService,
|
||||
public activatedRoute: ActivatedRoute,
|
||||
private alertController: AlertService,
|
||||
private authService: AuthService,
|
||||
private processes:ProcessesService,
|
||||
/* private gabineteService: GabineteDigitalPage, */
|
||||
|
||||
Reference in New Issue
Block a user