~click2dial-extension-devteam/click2dial-firefox-extension/2.0

« back to all changes in this revision

Viewing changes to chrome/content/history.xul

  • Committer: Jonathan SEMCZYK
  • Date: 2011-01-25 09:49:37 UTC
  • Revision ID: jsemczyk@acipia.fr-20110125094937-m0wb5ifg64t37dfb
new call history feature
- record all call into an SQLite database
- open an history window
- right click on history to call back

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 
3
<?xml-stylesheet href="chrome://asterisk-ext/skin/history.css" type="text/css"?>
 
4
<!DOCTYPE popupwindow [ 
 
5
<!ENTITY % asteriskextDTD SYSTEM "chrome://asterisk-ext/locale/asterisk-ext.dtd"> 
 
6
%asteriskextDTD; 
 
7
]> 
 
8
<dialog id="historyWindow" title="Calls History"
 
9
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 
10
        windowtype="asteriskext:history"
 
11
        buttons="cancel"
 
12
        persist="screenX,screenY,height,width"
 
13
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
 
14
        onload="AsteriskExtChrome.history.load();" >
 
15
  <script type="application/javascript" src="chrome://asterisk-ext/content/history.js"/>
 
16
 
 
17
        <stringbundleset id="stringbundleset"> 
 
18
                <stringbundle id="asterisk-ext-strings" src="chrome://asterisk-ext/locale/asterisk-ext.properties" />
 
19
        </stringbundleset>
 
20
 
 
21
  <popupset>
 
22
                <menupopup id="historyContextMenu"
 
23
                        onpopupshowing="return AsteriskExtChrome.history.onContextMenu(event);">
 
24
                        <menuitem image="chrome://asterisk-ext/skin/logo-20.png" 
 
25
                                class="menuitem-iconic" id="context-asterisk" label="&menu.call;"
 
26
                                accesskey="&menu.callKey;" oncommand="AsteriskExtChrome.history.dial(this.value);"
 
27
                                position="1" />
 
28
                        <menuitem image="chrome://asterisk-ext/skin/logo-20.png" 
 
29
                                class="menuitem-iconic" id="context-asterisk-edit" label="&menu.editcall;"
 
30
                                accesskey="&menu.editcallKey;" oncommand="AsteriskExtChrome.history.editConfirmDial(this.value);"
 
31
                                position="2" />
 
32
                </menupopup>
 
33
        </popupset>
 
34
 
 
35
  
 
36
  <vbox id="mainBox" flex="1">
 
37
                        <richlistbox id="history" datasources="profile:asterisk-ext.sqlite" ref="*" querytype="storage" flex="1"
 
38
                                context="historyContextMenu" >
 
39
                                <template>
 
40
                                        <query>
 
41
                                                select number, name, direction, 
 
42
                                                        case when not answertime=0 then time(hanguptime-answertime,'unixepoch') else time(0,'unixepoch') end duration,
 
43
                                                        case when answertime=0 then 'notanswered' else 'answered' end answered,
 
44
                                                        datetime(ringtime,'unixepoch') ringdate
 
45
                                                        from history 
 
46
                                                        order by id DESC
 
47
                                                        limit :limit;
 
48
                                                <param id="queryLimit" name="limit" type="integer">100</param>
 
49
                                        </query>
 
50
                                        <action>
 
51
                                                <richlistitem uri="?" value="?number">
 
52
                                                        <hbox flex="1">
 
53
                                                                <hbox align="left" pack="left" class="?direction">
 
54
                                                                        <image class="?answered" />
 
55
                                                                </hbox>
 
56
                                                                <vbox flex="1">
 
57
                                                                        <hbox>
 
58
                                                                                <label class="number" value="?number" flex="1"/>
 
59
                                                                                <label class="date" value="?ringdate"/>
 
60
                                                                        </hbox>
 
61
                                                                        <hbox>
 
62
                                                                                <label class="name" value="?name" flex="1"/>
 
63
                                                                                <label class="duration" value="?duration"/>
 
64
                                                                        </hbox>
 
65
                                                                </vbox>
 
66
                                                        </hbox>
 
67
                                                </richlistitem>
 
68
                                        </action>
 
69
                                </template>
 
70
                        </richlistbox>
 
71
  </vbox>
 
72
</dialog>