123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- import { Component } from '@angular/core';
- import { NavController, NavParams, ActionSheetController, AlertController } from 'ionic-angular';
- import { BaseListView } from "../../base/base-list-view";
- import { Phonecall } from "../../odoo/models/crm.phonecall";
- import { PhonecallPage } from "../phonecall/phonecall"
- @Component({
- selector: 'page-phonecalls',
- templateUrl: 'phonecalls.html'
- })
- export class PhonecallsPage extends BaseListView<Phonecall> {
- constructor(
- public navCtrl: NavController,
- public navParams: NavParams,
- public actionSheetCtrl: ActionSheetController,
- public alertCtrl: AlertController
- ) {
- super(Phonecall);
- }
- /**
- *
- */
- ionViewDidLoad() {
- console.log('ionViewDidLoad PhonecallsPage');
- }
- /**
- *
- */
- ionViewDidEnter() {
- super.unselectItem();
- }
- /**
- *
- * @param item
- */
- openOptions(item: Phonecall): void {
- super.setSelectedItem(item);
-
- this.actionSheetCtrl.create({
- title: "Opciones",
- buttons: [
- {
- text: "Abrir",
- icon: "open",
- handler: () => {
- this.goToDetails();
- }
- },
- {
- text: "Eliminar",
- icon: "close",
- role: "destructive",
- handler: () => {
- this.askIfDelete();
- }
- },
- {
- text: "Cancelar",
- role: "cancel",
- handler: () => {
- super.unselectItem();
- }
- },
- ]
- }).present();
- }
- /**
- *
- */
- goToDetails(): void {
- this.navCtrl.push(PhonecallPage, super.getSelectedItem());
- }
- /**
- *
- */
- askIfDelete(): void {
- this.alertCtrl.create({
- title: "Confirmar",
- message: "Quieres eliminar esta llamada?",
- buttons: [
- {
- text: "Cancelar"
- },
- {
- text: "Aceptar",
- handler: () => {
- super.performDelete();
- }
- }
- ]
- }).present();
- }
- }
|