Inhaltsverzeichnis
keine Gliederung
/* User Variables */
var srcpath = ($0 ?? args.path ..'/*');
var showcomplete = ($1 ?? args.showcomplete ?? 'true');
var onlymine = ($2 ?? args.onlymine ?? 'true');
var excludepages = ($3 ?? args.exclude ?? [""]);
/* System Variables DO NOT EDIT below this line! */
if(srcpath == '/*') {let srcpath = 'type: wiki AND title: "Assigned Tasks"'} else { let srcpath = 'type: wiki AND title: "Assigned Tasks" AND path: ' ..string.replace(srcpath, 'User:','User\\:')}
var IsLate='false';
var BackColor = 'white';
var todaysdate = date.format(date.changetimezone(date.now, user.timezone), "yyyy/MM/dd");
var listpage = 'true';
var globalexcludepages = ["/","User:no"];
<table width="100%" class="sortable"><tbody>
<th>
<b>'Parent Page'</b>
</th>
<th>
<b>'User Name'</b>
</th>
<th>
<b>'Task Title'</b>
</th>
<th>
<b>'Summary'</b>
</th>
<th>
<b>'Start Date'</b>
</th>
<th>
<b>'End Date'</b>
</th>
<th>
<b>'Priority'</b>
</th>
<th>
<b>'Status'</b>
</th>
foreach(var t in wiki.getsearch('Assigned_Tasks', 100, 'title', srcpath )) {
let listpage = 'true';
foreach(var e in excludepages) {
if(e == t.path) {
let listpage = 'false';
}
}
foreach(var e in globalexcludepages) {
if(e == t.path) {
let listpage = 'false';
}
}
if(listpage == 'true') {
if(#t.subpages > 0) {
foreach(var p in t.subpages) {
var utext = xml.text(wiki.page(p.path),"//*[@class='username']");
var stext = xml.text(wiki.page(p.path),"//*[@class='summary']");
var sdtext = xml.text(wiki.page(p.path),"//*[@class='startdate']");
var edtext = xml.text(wiki.page(p.path),"//*[@class='enddate']");
var prtext = xml.text(wiki.page(p.path),"//*[@class='priority']");
var sttext = xml.text(wiki.page(p.path),"//*[@class='status']");
if(date.IsAfter(todaysdate,edtext)) {
let IsLate = 'true';
let BackColor = 'red';
} else {
if(date.IsSameDay(todaysdate,edtext)) {
let IsLate = 'false';
let BackColor = 'yellow';
} else {
let IsLate = 'false';
let BackColor = 'white';
}
}
let listitem = 'true';
if(onlymine == 'true') {
if(!string.contains(string.tolower(utext),user.name)) {
let listitem = 'false'
}
}
if(listitem == 'true') {
if(string.toupper(string.trim(sttext)) == 'C') {
if(showcomplete == 'true') {
<tr BGCOLOR="Mediumspringgreen">
<td>
<strike>
web.link(p.parent.parent.uri,p.parent.parent.title);
</strike>
</td>
<td>
<strike>
utext;
</strike>
</td>
<td>
<strike>
web.link(p.uri, p.title);
</strike>
</td>
<td>
<strike>
stext;
</strike>
</td>
<td>
<strike>
sdtext;
</strike>
</td>
<td>
<strike>
edtext;
</strike>
</td>
<td>
<strike>
prtext;
</strike>
</td>
<td>
<strike>
sttext;
</strike>
</td>
</tr>
}
} else {
<tr BGCOLOR=(BackColor)>
<td>
web.link(p.parent.parent.uri,p.parent.parent.title);
</td>
<td>
utext;
</td>
<td>
wiki.edit{label: p.title, path: p.path, button: 'false'};
</td>
<td>
stext;
</td>
<td>
sdtext;
</td>
<td>
edtext;
</td>
<td>
prtext;
</td>
<td>
sttext;
</td>
</tr>
}
}
}
}
}
}
</tbody></table>