55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
+
|
int nLimit = atoi(PD("n","20"));
int nTagId;
const char zSQL1[] =
@ SELECT
@ blob.rid,
@ uuid,
@ event.mtime,
@ event.type,
@ coalesce(ecomment,comment),
@ coalesce(euser,user),
@ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim),
@ (SELECT count(*) FROM plink WHERE cid=blob.rid),
@ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
@ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
@ AND tagxref.rid=blob.rid AND tagxref.tagtype>0) AS tags
|
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
|
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
|
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
-
-
-
-
+
+
-
-
+
+
|
blob_zero(&bSQL);
blob_append( &bSQL, zSQL1, -1 );
if( zType[0]!='a' ){
if( zType[0]=='c' && !g.perm.Read ) zType = "x";
if( zType[0]=='w' && !g.perm.RdWiki ) zType = "x";
if( zType[0]=='t' && !g.perm.RdTkt ) zType = "x";
if( zType[0]=='f' && !g.perm.RdForum ) zType = "x";
blob_append_sql(&bSQL, " AND event.type=%Q", zType);
}else{
if( !g.perm.Read ){
if( g.perm.RdTkt && g.perm.RdWiki ){
blob_append(&bSQL, " AND event.type!='ci'", -1);
}else if( g.perm.RdTkt ){
blob_append(&bSQL, " AND event.type=='t'", -1);
blob_append(&bSQL, " AND event.type in (", -1);
if( g.perm.Read ){
blob_append(&bSQL, "'ci',", 4);
}
}else{
blob_append(&bSQL, " AND event.type=='w'", -1);
}
if( g.perm.RdTkt ){
blob_append(&bSQL, "'t',", 4);
}
}else if( !g.perm.RdWiki ){
if( g.perm.RdTkt ){
blob_append(&bSQL, " AND event.type!='w'", -1);
if( g.perm.RdWiki ){
blob_append(&bSQL, "'w',", 4);
}else{
blob_append(&bSQL, " AND event.type=='ci'", -1);
}
}else if( !g.perm.RdTkt ){
}
if( g.perm.RdForum ){
assert( !g.perm.RdTkt && g.perm.Read && g.perm.RdWiki );
blob_append(&bSQL, " AND event.type!='t'", -1);
blob_append(&bSQL, "'f',", -1);
}
blob_append(&bSQL, "'x')", 4);
}
if( zTicketUuid ){
nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
zTicketUuid);
if ( nTagId==0 ){
nTagId = -1;
|
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
+
-
-
+
+
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
@ <pubDate>%s(zPubDate)</pubDate>
@ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
free(zPubDate);
db_prepare(&q, "%s", blob_sql_text(&bSQL));
blob_reset( &bSQL );
while( db_step(&q)==SQLITE_ROW && nLine<nLimit ){
const char *zId = db_column_text(&q, 1);
const char *zType = db_column_text(&q, 3);
const char *zCom = db_column_text(&q, 3);
const char *zAuthor = db_column_text(&q, 4);
const char *zCom = db_column_text(&q, 4);
const char *zAuthor = db_column_text(&q, 5);
char *zPrefix = "";
char *zSuffix = 0;
char *zDate;
int nChild = db_column_int(&q, 5);
int nParent = db_column_int(&q, 6);
const char *zTagList = db_column_text(&q, 7);
int nParent = db_column_int(&q, 7);
const char *zTagList = db_column_text(&q, 8);
time_t ts;
if( zTagList && zTagList[0]==0 ) zTagList = 0;
ts = (time_t)((db_column_double(&q,2) - 2440587.5)*86400.0);
zDate = cgi_rfc822_datestamp(ts);
if('c'==zType[0]){
if( nParent>1 && nChild>1 ){
zPrefix = "*MERGE/FORK* ";
}else if( nParent>1 ){
zPrefix = "*MERGE* ";
}else if( nChild>1 ){
zPrefix = "*FORK* ";
if( nParent>1 && nChild>1 ){
zPrefix = "*MERGE/FORK* ";
}else if( nParent>1 ){
zPrefix = "*MERGE* ";
}else if( nChild>1 ){
zPrefix = "*FORK* ";
}
}else if('w'==zType[0]){
switch(zCom ? zCom[0] : 0){
case ':': zPrefix = "Edit wiki page: "; break;
case '+': zPrefix = "Add wiki page: "; break;
case '-': zPrefix = "Delete wiki page: "; break;
}
if(*zPrefix) ++zCom;
}
if( zTagList ){
zSuffix = mprintf(" (tags: %s)", zTagList);
}
@ <item>
|