Index: openacs-4/contrib/packages/cop-base/lib/install.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/lib/install.xml,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/cop-base/lib/install.xml 31 Mar 2004 22:31:52 -0000 1.2 +++ openacs-4/contrib/packages/cop-base/lib/install.xml 1 Apr 2004 12:09:43 -0000 1.3 @@ -25,6 +25,7 @@ + Index: openacs-4/contrib/packages/cop-base/sql/postgresql/views-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/sql/postgresql/Attic/views-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-base/sql/postgresql/views-drop.sql 28 Mar 2004 21:17:14 -0000 1.1 +++ openacs-4/contrib/packages/cop-base/sql/postgresql/views-drop.sql 1 Apr 2004 12:09:44 -0000 1.2 @@ -11,8 +11,8 @@ -- http://www.fsf.org/copyleft/gpl.html drop function cop_object_record_view (integer, integer); -drop function cop_object_views_upd_tr(); -drop function cop_object_views_ins_tr(); +drop function cop_object_views_upd_tr() cascade; +drop function cop_object_views_ins_tr() cascade; drop table cop_object_view_agg; drop table cop_object_views; Index: openacs-4/contrib/packages/cop-base/tcl/cop-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/tcl/cop-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/cop-base/tcl/cop-procs.tcl 31 Mar 2004 22:31:54 -0000 1.3 +++ openacs-4/contrib/packages/cop-base/tcl/cop-procs.tcl 1 Apr 2004 12:09:44 -0000 1.4 @@ -171,7 +171,7 @@ set mount_point [apm_required_attribute_value $action mount-point] regexp {(.*)/([^/]*)$} $mount_point match parent_url mount_point - if {$parent_url eq ""} { + if {[string eq $parent_url ""]} { set parent_url / } set parent_id [site_node::get_node_id -url $parent_url] Index: openacs-4/contrib/packages/cop-base/www/admin/community-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/www/admin/community-new.adp,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-base/www/admin/community-new.adp 31 Mar 2004 21:15:23 -0000 1.1 +++ openacs-4/contrib/packages/cop-base/www/admin/community-new.adp 1 Apr 2004 12:09:45 -0000 1.2 @@ -3,4 +3,4 @@ copnew.name -@foo@ \ No newline at end of file +@category_ids@ \ No newline at end of file Index: openacs-4/contrib/packages/cop-base/www/admin/community-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-base/www/admin/community-new.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-base/www/admin/community-new.tcl 31 Mar 2004 21:15:23 -0000 1.1 +++ openacs-4/contrib/packages/cop-base/www/admin/community-new.tcl 1 Apr 2004 12:09:45 -0000 1.2 @@ -6,18 +6,26 @@ {stub:text {label {URL stub}} {html {size 60 maxlength 60}} - {help_text "This is the last part of the url. It should not have any spaces or characters
other than -,_,a-z, and 0-9. -Your community will be created at [ad_url][ad_conn package_url]url_stub/"} + {help_text "This is the last part of the url. It should not have any spaces or characters other
   than -, _, a-z, A-Z, and 0-9. +Your community will be created at [ad_url]/url_stub/"} } {description:richtext(richtext),optional {html {cols 60 rows 10}} {label "Description"} - {help_text "A summary of the Community's purpose."} + {help_text "Provide a charter for the community."} } } -category::ad_form::add_widgets -container_object_id [subsite::main_site_id] -form_name copnew -set foo [subsite::main_site_id] + +set category_ids {} + +category::ad_form::add_widgets -help_text { + Choose a root category for the community. If you do not choose one an empty
   + category tree will be created which you can add to later +} \ + -container_object_id [subsite::main_site_id] \ + -form_name copnew + ad_form -extend -name copnew -validate { { name {![string is space $name]} {You must enter a name.} } { stub {![string is space $stub]} {You must enter a URL stub.} } @@ -34,6 +42,22 @@ Description $Description \ DescriptionFormat $DescriptionFormat \ ] ] + + set category_ids [category::ad_form::get_categories -container_object_id [subsite::main_site_id]] + set cop_subsite_id [site_node::get_element -url /$stub -element package_id] + if {![empty_string_p $category_ids]} { + # map a subtree to the CoP... + category_tree::map -tree_id [category::get_tree [lindex $category_ids 0]] \ + -object_id $cop_subsite_id \ + -subtree_category_id [lindex $category_ids 0] + } else { + # create a new tree... + set tree_id [category_tree::add -name Categories \ + -description "$name Categories" \ + -context_id $cop_subsite_id] + category::add -name "$name" -description "$name root" -tree_id $tree_id -parent_id {} + category_tree::map -tree_id $tree_id -object_id $cop_subsite_id + } } -after_submit { - ad_returnredirect -message "Created \"$name\"" "/$stub" + ad_returnredirect -message "Created community \"$name\"" "/$stub" } Index: openacs-4/contrib/packages/cop-ui/lib/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/lib/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-ui/lib/index.adp 31 Mar 2004 21:12:16 -0000 1.1 +++ openacs-4/contrib/packages/cop-ui/lib/index.adp 1 Apr 2004 12:09:45 -0000 1.2 @@ -1,7 +1,8 @@ @subsite_name;noquote@ -@description;noquote@ +
Charter» 
@description;noquote@
+
  • your clipboards
  • ratings
  • Index: openacs-4/contrib/packages/cop-ui/www/categories/acl.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/www/categories/acl.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-ui/www/categories/acl.tcl 31 Mar 2004 21:12:17 -0000 1.1 +++ openacs-4/contrib/packages/cop-ui/www/categories/acl.tcl 1 Apr 2004 12:09:46 -0000 1.2 @@ -1,3 +1,5 @@ +return -code return + set cats {1 {advice, benefits and emergencies} 2 @@ -697,7 +699,7 @@ 3 {food hygiene} 4 - {devlivery vehicles} + {delivery vehicles} 3 {hygiene inspections} 3 @@ -1547,10 +1549,12 @@ } -set tree_id [category_tree::add -name Categories -description "CoP Categories" -context_id [subsite::main_site_id]] +set tree_id [category_tree::add -name APLAWS -description "APLAWS Categories" -context_id [subsite::main_site_id]] set parent(1) {} foreach {cat key} $cats { set parent([expr $cat + 1]) [category::add -name $key -description $key -tree_id $tree_id -parent_id $parent($cat)] } + +category_tree::map -tree_id $tree_id -object_id [subsite::main_site_id] \ No newline at end of file Index: openacs-4/contrib/packages/cop-ui/www/clipboards/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/www/clipboards/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-ui/www/clipboards/index.adp 28 Mar 2004 21:17:10 -0000 1.1 +++ openacs-4/contrib/packages/cop-ui/www/clipboards/index.adp 1 Apr 2004 12:09:46 -0000 1.2 @@ -13,7 +13,7 @@
  • @clipboards.title@ (@clipboards.clipped@ items, last used @clipboards.last_clip@) - [ edit | delete ] + edit delete
Index: openacs-4/contrib/packages/cop-ui/www/clipboards/remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/www/clipboards/remove.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-ui/www/clipboards/remove.tcl 28 Mar 2004 21:17:10 -0000 1.1 +++ openacs-4/contrib/packages/cop-ui/www/clipboards/remove.tcl 1 Apr 2004 12:09:46 -0000 1.2 @@ -18,3 +18,4 @@ } cop::clipboard::remove -user_id $user_id -clipboard_id $clipboard_id -object_id $object_id +ad_returnredirect [get_referrer] Index: openacs-4/contrib/packages/cop-ui/www/clipboards/view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/www/clipboards/view.adp,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-ui/www/clipboards/view.adp 28 Mar 2004 21:17:10 -0000 1.1 +++ openacs-4/contrib/packages/cop-ui/www/clipboards/view.adp 1 Apr 2004 12:09:46 -0000 1.2 @@ -3,19 +3,20 @@ @context@ - Clipboard @title@ (@items:rowcount@ items) owned by @owner_name@ [Edit] +

Clipboard @title@ (@items:rowcount@ items attached) Edit title + All clipboards

Items in this clipboard:

There are no items in this clipboard.

- + +

Delete this clipboard

+ Index: openacs-4/contrib/packages/cop-ui/www/clipboards/view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/cop-ui/www/clipboards/view.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/cop-ui/www/clipboards/view.tcl 28 Mar 2004 21:17:10 -0000 1.1 +++ openacs-4/contrib/packages/cop-ui/www/clipboards/view.tcl 1 Apr 2004 12:09:46 -0000 1.2 @@ -27,11 +27,13 @@ set context [list [list ./ Clipboards] $title] +# TODO: Yuck! should fix this query. maybe stick it in a cop_object_type view... db_multirow -extend {clipped} items get_items { - SELECT o.object_id, o.object_type, coalesce(o.title,'object '||o.object_id) as item_title, to_char(m.clipped_on,'YYYY-MM-DD HH24:MI:SS') as clipped_ansi - FROM cop_clipboard_object_map m, acs_objects o + SELECT o.object_id, t.pretty_name as object_type, coalesce(o.title,'object '||o.object_id) as item_title, to_char(m.clipped_on,'YYYY-MM-DD HH24:MI:SS') as clipped_ansi + FROM cop_clipboard_object_map m, acs_objects o, acs_object_types t WHERE clipboard_id = :clipboard_id and o.object_id = m.object_id + and t.object_type = (case when o.object_type = 'content_item' then (select case when i.content_type = 'content_extlink' then 'content_extlink' else r.object_type end from acs_objects r, cr_items i where r.object_id = coalesce(i.live_revision, i.latest_revision, i.item_id) and i.item_id = o.object_id) else o.object_type end) } { set clipped [util::age_pretty -timestamp_ansi $clipped_ansi -sysdate_ansi [clock_to_ansi [clock seconds]]] }