/
FrameJrl.xxm
116 lines (111 loc) · 4.27 KB
/
FrameJrl.xxm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[[@txSession,txDefs,txFilter,txFilterSql,txCache,txNodes,DataLank,Variants]][[!var
b:boolean;
qr:TQueryResult;
i,id:integer;
]][[
Context.Include('dFrameHead.xxmi',['Journal',false]);
<<script><!--
function listitem_select(e,id)
{
if(window.parent.frames["MainFrame"].window.catchTreeClick)
window.parent.frames["MainFrame"].window.catchTreeClick(id,$("#jrllink_"+id)[0]);
else
window.parent.frames["MainFrame"].location.replace("Item.xxm?x=i"+id);
return (e||window.event||this).shiftKey;
}
//--></script>>
if Length(Session.Journals)=0 then
begin
<<p class="information">No journals available to you.</p>>
end
else if not Session.JournalsUsed then
begin
<<p>
<a class="linkbutton" href="#" onclick="top.document.location.reload();return false;">full refresh to close frame</a>
<a class="linkbutton" href="aFrmJrlSus.xxm?resume=1">resume</a>
</p>>
end
else
begin
b:=true;
<<table cellspacing="2" cellpadding="2" border="0" class="listtable">>
for i:=0 to Length(Session.Journals)-1 do
begin
<<tr>>
qr:=TQueryResult.Create(Session.DbCon,
'select Obj.id, Obj.objtype_id, Obj.name, Obj.'+sqlDesc+', ObjType.icon, ObjType.name as typename,'+
' Jrx.ts, Jrt.icon as jrt_icon, Jrt.name as jrt_name'+
//', ObjTokRefCache.tokHTML, ObjTokRefCache.refHTML'+
' from Jrx inner join Jrt on Jrt.id=Jrx.jrt_id'+
' inner join Obj on Obj.id=Jrx.obj_id'+
' inner join ObjType on ObjType.id=Obj.objtype_id'+
//' left outer join ObjTokRefCache on ObjTokRefCache.id=Obj.id'+
' where Jrx.uid=? and Jrt.jrl_id=?',
[Session.UserID,Session.Journals[i].jrl_id]);
try
if qr.Read then id:=qr.GetInt('id') else id:=0;
if id<>0 then
begin
b:=false;
<<td style="white-space:nowrap;">>#txImg(qr.GetInt('jrt_icon'),Session.Journals[i].jrl_name+': '+qr.GetStr('jrt_name'))<</td>
<td style="white-space:nowrap;text-align:right;">
<span class="jrl">>=JournalTime(qr.GetDate('ts'),Session.Journals[i].granularity)<</span>
<a href="iJre.xxm[[?'id',Session.Journals[i].jrl_id,'r',3]][[#txCallProtect]]" class="linkbutton">•</a>
</td>
<td style="white-space:nowrap;">>
//Context.Include('dObjLink.xxmi',[],[qr]);
<<a href="Item.xxm?x=i[[.id]]" target="MainFrame" title="[[.typename]]" id="jrllink_[[=id]]" onclick="return listitem_select(event,[[=id]]);">>#txImg(qr.GetInt('icon'))]] [[.name<</a>>
//Context.Include('dObjTokRef.xxmi',[id,#13#10' ',' '],[qr]);
//Context.Include('d_cmw.xxmi',[],[qr]);
<</td>>
end;
finally
qr.Free;
end;
if id=0 then
begin
<<td colspan="3" style="white-space:nowrap;">
<a class="linkbutton" target="MainFrame" href="Journal.xxm?id=[[=Session.Journals[i].jrl_id]]" title="[[=Session.Journals[i].jrl_name]]">...</a>
[[
qr:=TQueryResult.Create(Session.DbCon,'select Obj.id, Obj.name, ObjType.icon'
+' from Jre'
+' inner join Jrt on Jrt.id=Jre.jrt_id'
+' inner join Obj on Obj.id=Jre.obj_id'
+' inner join ObjType on ObjType.id=Obj.objtype_id'
+' where Jrt.jrl_id=? and Jre.ts>?'
+' group by Obj.id, Obj.name, ObjType.icon'
+' order by sum(Jre.minutes) desc'
+' limit 5',[Session.Journals[i].jrl_id,Now-3.0]);
try
while qr.Read do
begin
<<a target="MainFrame" href="Item.xxm?x=i[[.id]]" class="jiOption" title="[[.name]]">>#txImg(qr.GetInt('icon'))<</a>>
end;
finally
qr.Free;
end;
if Session.Journals[i].fDisplay<>'' then
begin
<<span class="small" style="color:silver;"> ›[[=Session.Journals[i].fDisplay<</span>>
Session.Journals[i].fDisplay:='';
end;
]]
<span id="jiTitle" class="highlight1"></span>
<script><!--
$(".jiOption")
.mouseenter(function(){$("#jiTitle").text(this.title);})
.mouseleave(function(){$("#jiTitle").text("");});
//--></script>>
<</td>>
end;
<</tr>>
end;
<</table>
<script>window.setTimeout(function(){document.location.reload();},60000);</script>>
if b then
begin
<<p><a href="aFrmJrlSus.xxm" class="linkbutton">hide</p>>
end;
end;
Context.Include('dFrameFoot.xxmi');