Index: openacs-4/packages/categories/www/cadmin/one-object.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/one-object.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/categories/www/cadmin/one-object.tcl 8 Feb 2004 17:19:31 -0000 1.6 +++ openacs-4/packages/categories/www/cadmin/one-object.tcl 11 Feb 2004 09:35:31 -0000 1.7 @@ -37,7 +37,7 @@ $assign_single_p $require_category_p \ [export_vars -no_empty -base tree-view { tree_id locale object_id }] \ [export_vars -no_empty -base tree-unmap { tree_id locale object_id }] \ - [export_vars -no_empty -base tree-map { tree_id locale object_id {edit_p 1}}] + [export_vars -no_empty -base tree-map-2 { tree_id locale object_id {edit_p 1}}] } template::multirow sort mapped_trees -dictionary tree_name @@ -50,8 +50,8 @@ template::multirow append unmapped_trees $tree_id $tree_name $site_wide_p \ [export_vars -no_empty -base tree-view { tree_id locale object_id }] \ - [export_vars -no_empty -base tree-map { tree_id locale object_id }] \ - [export_vars -no_empty -base subtree-choose { tree_id locale object_id }] + [export_vars -no_empty -base tree-map-2 { tree_id locale object_id }] \ + [export_vars -no_empty -base tree-map { tree_id locale object_id }] } } @@ -98,7 +98,7 @@ label "Action" display_template { Map tree     - Choose subtree to map + Map a subtree } } } Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/categories/www/cadmin/subtree-choose.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/categories/www/cadmin/subtree-choose.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/categories/www/cadmin/tree-map-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/tree-map-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/categories/www/cadmin/tree-map-2.adp 11 Feb 2004 09:35:31 -0000 1.1 @@ -0,0 +1,9 @@ + +@page_title;noquote@ +@context_bar;noquote@ +f +tree_map_form.assign_single_p + +
+ +
Index: openacs-4/packages/categories/www/cadmin/tree-map-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/tree-map-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/categories/www/cadmin/tree-map-2.tcl 11 Feb 2004 09:35:31 -0000 1.1 @@ -0,0 +1,63 @@ +ad_page_contract { + + Asks whether users will be allowed to assign multiple + categories of this subtree to objects and if users + have to categorize an object in this subtree. + + Then assings this subtree to the passed object (usually a package_id). + + @author Timo Hentschel (timo@timohentschel.de) + @cvs-id $Id: +} { + tree_id:integer,notnull + {category_id:integer,optional ""} + {locale ""} + object_id:integer,notnull + {edit_p 0} +} + +set user_id [ad_maybe_redirect_for_registration] +permission::require_permission -object_id $object_id -privilege admin + +array set tree [category_tree::get_data $tree_id $locale] +set tree_name $tree(tree_name) +if {$tree(site_wide_p) == "f"} { + permission::require_permission -object_id $tree_id -privilege category_tree_read +} + +set context_bar [list [category::get_object_context $object_id] [list [export_vars -no_empty -base one-object {locale object_id}]" "Category Management"] "Mapping Parameters"] + +if {$edit_p} { + # parameters are edited, so get old data + db_1row get_mapped_subtree_id "" +} + +if {[empty_string_p $category_id]} { + set page_title "Parameters of mapping to tree \"$tree_name\"" +} else { + set category_name [category::get_name $category_id $locale] + set page_title "Parameters of mapping to subtree \"$tree_name :: $category_name\"" +} + +ad_form -name tree_map_form -action tree-map-2 -export { tree_id category_id locale object_id edit_p } -form { + {assign_single_p:text(radio) {label "Let users assign multiple categories?"} {options {{"Yes" f} {"No" t}}}} + {require_category_p:text(radio) {label "Require users to assign at least one category?"} {options {{"Yes" t} {"No" f}}}} +} -on_request { + if {$edit_p} { + db_1row get_mapping_parameters "" + } else { + set assign_single_p f + set require_category_p f + } +} -on_submit { + if {$edit_p} { + category_tree::edit_mapping -tree_id $tree_id -object_id $object_id -assign_single_p $assign_single_p -require_category_p $require_category_p + } else { + category_tree::map -tree_id $tree_id -subtree_category_id $category_id -object_id $object_id -assign_single_p $assign_single_p -require_category_p $require_category_p + } +} -after_submit { + ad_returnredirect [export_vars -no_empty -base one-object {locale object_id}] + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/categories/www/cadmin/tree-map-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/tree-map-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/categories/www/cadmin/tree-map-2.xql 11 Feb 2004 09:35:31 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + + select subtree_category_id as category_id + from category_tree_map + where tree_id = :tree_id + and object_id = :object_id + + + + + + + + + select assign_single_p, require_category_p + from category_tree_map + where tree_id = :tree_id + and object_id = :object_id + + + + + + Index: openacs-4/packages/categories/www/cadmin/tree-map.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/tree-map.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/categories/www/cadmin/tree-map.adp 3 Feb 2004 18:34:54 -0000 1.1 +++ openacs-4/packages/categories/www/cadmin/tree-map.adp 11 Feb 2004 09:35:31 -0000 1.2 @@ -1,9 +1,6 @@ @page_title;noquote@ @context_bar;noquote@ -f -tree_map_form.assign_single_p +@locale;noquote@ -
- -
+ Index: openacs-4/packages/categories/www/cadmin/tree-map.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/tree-map.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/categories/www/cadmin/tree-map.tcl 9 Feb 2004 19:48:44 -0000 1.4 +++ openacs-4/packages/categories/www/cadmin/tree-map.tcl 11 Feb 2004 09:35:31 -0000 1.5 @@ -1,61 +1,59 @@ ad_page_contract { - - Asks whether users will be allowed to assign multiple - categories of this subtree to objects and if users - have to categorize an object in this subtree. - Then assings this subtree to the passed object (usually a package_id). + Lets user select a category to map a subtree. @author Timo Hentschel (timo@timohentschel.de) @cvs-id $Id: } { - tree_id:integer,notnull - {category_id:integer,optional ""} + tree_id:integer {locale ""} object_id:integer,notnull - {edit_p 0} +} -properties { + page_title:onevalue + context_bar:onevalue + locale:onevalue + tree:multirow } set user_id [ad_maybe_redirect_for_registration] permission::require_permission -object_id $object_id -privilege admin -array set tree [category_tree::get_data $tree_id $locale] -if {$tree(site_wide_p) == "f"} { +array set tree_data [category_tree::get_data $tree_id $locale] +set tree_name $tree_data(tree_name) +if {$tree_data(site_wide_p) == "f"} { permission::require_permission -object_id $tree_id -privilege category_tree_read } -set context_bar [list [category::get_object_context $object_id] [list [export_vars -no_empty -base one-object {locale object_id}]" "Category Management"] "Mapping Parameters"] +set page_title "Select subtree of \"$tree_name\" to map" -if {$edit_p} { - # parameters are edited, so get old data - db_1row get_mapped_subtree_id "" -} +set context_bar [list [category::get_object_context $object_id] [list [export_vars -no_empty -base one-object {locale object_id}] "Category Management"] "Map subtree"] -if {[empty_string_p $category_id]} { - set page_title "Parameters of mapping to tree \"$tree(tree_name)\"" -} else { - set page_title "Parameters of mapping to subtree \"$tree(tree_name) :: [category::get_name $category_id $locale]\"" +template::multirow create tree category_id category_name level left_indent map_url + +foreach category [category_tree::get_tree -all $tree_id $locale] { + util_unlist $category category_id category_name deprecated_p level + + template::multirow append tree $category_id $category_name $level \ + [string repeat " " [expr ($level-1)*5]] \ + [export_vars -no_empty -base tree-map-2 { category_id tree_id locale object_id }] } -ad_form -name tree_map_form -action tree-map -export { tree_id category_id locale object_id edit_p } -form { - {assign_single_p:text(radio) {label "Let users assign multiple categories?"} {options {{"Yes" f} {"No" t}}}} - {require_category_p:text(radio) {label "Require users to assign at least one category?"} {options {{"Yes" t} {"No" f}}}} -} -on_request { - if {$edit_p} { - db_1row get_mapping_parameters "" - } else { - set assign_single_p f - set require_category_p f +template::list::create \ + -name tree \ + -no_data "None" \ + -elements { + category_name { + label "Name" + display_template { + @tree.left_indent;noquote@ @tree.category_name@ + } + } + map { + label "Action" + display_template { + Map this subtree + } + } } -} -on_submit { - if {$edit_p} { - category_tree::edit_mapping -tree_id $tree_id -object_id $object_id -assign_single_p $assign_single_p -require_category_p $require_category_p - } else { - category_tree::map -tree_id $tree_id -subtree_category_id $category_id -object_id $object_id -assign_single_p $assign_single_p -require_category_p $require_category_p - } -} -after_submit { - ad_returnredirect [export_vars -no_empty -base one-object {locale object_id}] - ad_script_abort -} ad_return_template Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/categories/www/cadmin/tree-map.xql'. Fisheye: No comparison available. Pass `N' to diff?