Class ::xowiki::includelet::wf-todo
::xowiki::includelet::wf-todo
create ... \
[ -__decoration (default "plain") ] \
[ -parameter_declaration (default "
{-workflow ""}
{-user_id}
{-ical 0}
{-max_entries}
") ]
Class Relations
- class: ::xowiki::IncludeletClass
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xowiki::Includelet
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xowiki::IncludeletClass create ::xowiki::includelet::wf-todo \
-superclass ::xowiki::Includelet
Methods (to be applied on instances)
__decoration (setter)
initialize (scripted)
:get_parameters
if {![info exists user_id]} {set user_id [::xo::cc user_id]}
set sql {
select assignee,xowiki_form_page_id,state,i.publish_status,page_template,
p.creation_date, p.last_modified, p,description,
i2.name as wf_name,p.title,i.name,i.parent_id,o.package_id as pid
from xowiki_form_pagei p,cr_items i, cr_items i2, acs_objects o
where (assignee = :user_id or acs_group__member_p(:user_id,assignee, 'f'))
and i.live_revision = xowiki_form_page_id
and p.page_template = i2.item_id
and o.object_id = xowiki_form_page_id
}
if {$workflow ne ""} {
if {[regexp {^/(/.*)/$} $workflow _ package]} {
::xowf::Package initialize -url $package
append sql " and o.package_id = :package_id"
} else {
if {[regexp {^/(/[^/]+)(/.+)$} $workflow _ package path]} {
::xowf::Package initialize -url $package
} else {
set path $workflow
}
set parent_id [${:__including_page} parent_id]
set wf_page [::$package_id get_page_from_item_ref -parent_id $parent_id $path]
if {$wf_page eq ""} {
:msg "cannot resolve page $workflow"
set package_id -1; set page_template -1
} else {
set page_template [$wf_page item_id]
set package_id [$wf_page package_id]
}
append sql " and o.package_id = :package_id and p.page_template = :page_template"
}
}
append sql " order by p.last_modified desc"
set :items [::xowiki::FormPage instantiate_objects -sql $sql]parameter_declaration (setter)
render (scripted)
:get_parameters
if {$ical} {
return [:render_ical]
}
set t [TableWidget new -volatile -columns {
Field create package -label Package
AnchorField create wf -label Workflow
AnchorField create title -label "Todo"
Field create state -label [::xowiki::FormPage::slot::state set pretty_name]
}]
foreach i [${:items} children] {
$i instvar wf_name name title state xowiki_form_page_id pid parent_id
::xowf::Package initialize -package_id $pid
$t add -wf $wf_name -wf.href [$pid pretty_link -parent_id $parent_id $wf_name] -title $title -title.href [$pid pretty_link -parent_id $parent_id $name] -state $state -package [$pid package_url]
}
return [$t asHTML]render_ical (scripted)
foreach i [${:items} children] {
$i instvar wf_name name title state xowiki_form_page_id pid description parent_id
::xowf::Package initialize -package_id $pid
$i class ::xo::ical::VTODO
$i configure -uid $pid-$xowiki_form_page_id -url [$pid pretty_link -absolute true $parent_id $name] -summary "$title ($state)" -description "Workflow instance of workflow $wf_name $description"
}
${:items} mixin ::xo::ical::VCALENDAR
${:items} configure -prodid "-//WU Wien//NONSGML XoWiki Content Flow//EN"
set text [${:items} as_ical]
ns_return 200 text/plain $text