From 14da4be11fe13d4fcd55143c39b73c0d086b901b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 25 Jun 2013 13:09:07 +0200 Subject: Show transfer buttons only for switchable incoming calls. --- public/js/app.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'public') diff --git a/public/js/app.js b/public/js/app.js index efc0752..1dee270 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -51,6 +51,7 @@ DS.RESTAdapter.reopen({ App.Switchboard = DS.Model.extend({ switchboardEntrys: DS.hasMany('App.SwitchboardEntry'), activeCalls: DS.hasMany('App.ActiveCall'), + dispatchableIncomingCalls: DS.hasMany('App.DispatchableIncomingCall'), name: DS.attr('string') }); @@ -87,6 +88,30 @@ App.ActiveCall = DS.Model.extend({ }.property('b_callstate') }); +App.DispatchableIncomingCall = DS.Model.extend({ + start_stamp: DS.attr('number'), + callstate: DS.attr('string'), + b_callstate: DS.attr('string'), + destination: DS.attr('string'), + b_caller_id_number: DS.attr('string'), + + isActive: function() { + if (this.get('b_callstate') == 'ACTIVE') { + return true + } else { + return false + } + }.property('b_callstate'), + + isRinging: function() { + if (this.get('b_callstate') == 'RINGING') { + return true + } else { + return false + } + }.property('b_callstate') +}); + App.Adapter = DS.RESTAdapter.extend(); App.store = App.Store.create({ -- cgit v1.2.3