Index: openacs-4/packages/xowiki/tcl/syndicate-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/syndicate-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 23 Mar 2007 11:36:06 -0000 1.6 +++ openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 24 Mar 2007 15:25:22 -0000 1.7 @@ -13,7 +13,7 @@ set attsXML "" if {[info exists atts]} { foreach {attName attValue} $atts { - append attsXML " $attName='$attValue'" + append attsXML " $attName='[string map [list ' {'}] $attValue]'" } } return <$name$attsXML>[string map $xmlMap $value] @@ -241,7 +241,8 @@ return $content } - Class Timeline -superclass XMLSyndication + Class Timeline -superclass XMLSyndication \ + -parameter {user_id {limit 1000}} Timeline instproc reverse list { set result [list] @@ -254,17 +255,23 @@ Timeline instproc render {} { my instvar package_id set folder_id [::$package_id folder_id] + set where_clause "" + set limit_clause "" set last_user "" set last_item "" set last_clock "" + if {[my exists user_id]} { append where_clause " and creation_user = [my user_id] " } + if {[my exists limit]} { append limit_clause " limit [my limit] " } + ::xo::OrderedComposite items -destroy_on_cleanup - db_foreach get_pages { + db_foreach get_pages " select ci.name, o.creation_user, cr.publish_date, cr.item_id, ci.parent_id, cr.title from cr_items ci, cr_revisions cr, acs_objects o where cr.item_id = ci.item_id and o.object_id = cr.revision_id - and ci.parent_id = :folder_id and creation_user is not null order by revision_id desc - } { + and ci.parent_id = :folder_id and creation_user is not null + $where_clause order by revision_id desc $limit_clause + " { regexp {^([^.]+)[.][0-9]+(.*)$} $publish_date _ publish_date tz set clock [clock scan $publish_date] @@ -305,4 +312,4 @@ append result \n return $result } -} \ No newline at end of file +} Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 21 Mar 2007 16:24:36 -0000 1.31 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 24 Mar 2007 15:25:22 -0000 1.32 @@ -1178,7 +1178,7 @@ foreach {node label} $nodes { set link "$label" - append nodesHTML "
    $link
\n" + append nodesHTML "
    $link
\n" } set edgesHTML ""; set c 0 @@ -1189,6 +1189,7 @@ if {$weight < $cutoff} continue append edgesHTML "g.addEdge(\$('$a'), \$('$b'), $weight, 0, $width);\n" } + # [lsort -index 1 -decreasing -integer $edges]
[set cutoff] - [set c]
return [subst -novariables {
@@ -1197,11 +1198,15 @@ [set nodesHTML]
}] @@ -1245,13 +1251,14 @@ lappend i($item_id) $creation_user $count set user($creation_user) [::xo::get_user_name $creation_user] + if {![info exists activities($creation_user)]} {set activities($creation_user) 0} + incr activities($creation_user) $count } set result "

Collaboration Graph for [::xo::get_user_name $user_id] " if {[array size i] < 1} { append result "

No collaborations found

" } else { - append result "(max. [set max_edges] edges)

\n" foreach x [array names i] { foreach {u1 c1} $i($x) { @@ -1276,6 +1283,7 @@ lappend edges [list $x $collab($x) [expr {$collab($x)*5.0/$max}]] } + append result "($activities($user_id) contributions)

\n" append result [my graphHTML \ -nodes [array get user] -edges $edges \ -max_edges $max_edges -cutoff $cutoff \ @@ -1367,6 +1375,83 @@ return $result } + Class create timeline \ + -superclass ::xowiki::Portlet \ + -parameter {} + + timeline instproc render {} { + my initialize -parameter { -user_id {-data timeline-data} {-interval1 DAY} {-interval2 MONTH}} + my get_parameters + ::xowiki::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" + ::xowiki::Page requireJS "/resources/ajaxhelper/yui/event/event.js" + ::xowiki::Page requireJS "/resources/xowiki/timeline/api/timeline-api.js" + set stamp [clock format [clock seconds] -format "%b %d %Y %X %Z" -gmt true] + if {[info exists user_id]} {append data "?user_id=$user_id"} + + return [subst -nocommands -nobackslashes { +
+ + + }] + } + + Class create user-timeline \ + -superclass timeline \ + -parameter {} + + user-timeline instproc render {} { + my initialize -parameter { -user_id {-data timeline-data} {-interval1 DAY} {-interval2 MONTH}} + my get_parameters + if {![info exists user_id]} {set user_id [::xo::cc user_id]]} + ::xo::cc set_parameter user_id $user_id + next + } + +} Index: openacs-4/packages/xowiki/www/resources/collab-graph.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/collab-graph.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/resources/collab-graph.js 20 Mar 2007 18:13:22 -0000 1.3 +++ openacs-4/packages/xowiki/www/resources/collab-graph.js 24 Mar 2007 15:25:23 -0000 1.4 @@ -111,8 +111,17 @@ var point = this.translate([node.layoutPosX, node.layoutPosY]); node.value.style.position = 'absolute'; - node.value.style.top = document.getElementById("collab").offsetTop - 10 + point[1] + 'px'; - node.value.style.left = document.getElementById("collab").offsetLeft + point[0] + 'px'; + var collab = document.getElementById("collab") + var top, left; + if (/MSIE/.test(navigator.userAgent) && !window.opera) { + top = collab.offsetParent.offsetTop; + left = collab.offsetParent.offsetLeft; + } else { + top = collab.offsetTop; + left = collab.offsetLeft; + } + node.value.style.top = top - 10 + point[1] + 'px'; + node.value.style.left = left + point[0] + 'px'; this.ctx.strokeStyle = 'black' this.ctx.beginPath(); this.ctx.arc(point[0], point[1], this.radius, 0, Math.PI*2, true); Index: openacs-4/packages/xowiki/www/resources/excanvas.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/excanvas.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/resources/excanvas.js 21 Mar 2007 16:00:16 -0000 1.1 +++ openacs-4/packages/xowiki/www/resources/excanvas.js 24 Mar 2007 15:25:23 -0000 1.2 @@ -31,14 +31,15 @@ var doc = opt_doc || document; if (/MSIE/.test(navigator.userAgent) && !window.opera) { var self = this; - doc.attachEvent("onreadystatechange", function () { - self.init_(doc); - }); +// doc.attachEvent("onreadystatechange", function () { +// self.init_(doc); +// }); } }, init_: function (doc, e) { - if (doc.readyState == "complete") { +// alert(doc.readyState); + if (doc.readyState == "complete" || doc.readyState == "interactive" || 1) { // create xmlns if (!doc.namespaces["g_vml_"]) { doc.namespaces.add("g_vml_", "urn:schemas-microsoft-com:vml"); @@ -701,4 +702,4 @@ })(); -} // if \ No newline at end of file +} // if