- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
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
::xowiki::IncludeletClass create ::xowiki::includelet::wf-todo \ -superclass ::xowiki::IncludeletMethods (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 ""} { # The workflow might be of one of the following forms: # name # <language prefix>:name # /path-in-package/<language prefix>:name # //package/<language prefix>:name # //package/path-in-package/<language prefix>:name # # To address all workflow of a package instance, use # //package/ # if {[regexp {^/(/.*)/$} $workflow _ package]} { # all workflows from this package ::xowf::Package initialize -url $package #:msg "using package_id=$package_id" append sql " and o.package_id = :package_id" } else { if {[regexp {^/(/[^/]+)(/.+)$} $workflow _ package path]} { ::xowf::Package initialize -url $package #:msg "using package_id=$package_id" } 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] } #:msg "page_template=$page_template pkg=$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] #:log "--ical sending $text" #ns_return 200 text/calendar $text ns_return 200 text/plain $text
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables