+@page_title;noquote@
+@context_bar;noquote@
+@locale;noquote@
+
+
+ Are you sure you want to delete these synonyms:
+
+
+
+
+
+ Delete
+
+ No, Cancel
+
Index: openacs-4/packages/categories/www/cadmin/synonym-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonym-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonym-delete.tcl 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,49 @@
+ad_page_contract {
+
+ Deletes a synonym
+
+ @author Timo Hentschel (timo@timohentschel.de)
+ @cvs-id $Id:
+} {
+ synonym_id:integer,multiple
+ category_id:integer,notnull
+ tree_id:integer,notnull
+ {locale ""}
+ object_id:integer,optional
+} -properties {
+ page_title:onevalue
+ context_bar:onevalue
+ locale:onevalue
+ delete_url:onevalue
+ cancel_url:onevalue
+}
+
+set user_id [ad_maybe_redirect_for_registration]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+
+set tree_name [category_tree::get_name $tree_id $locale]
+set category_name [category::get_name $category_id $locale]
+set page_title "Delete synonyms of category \"$tree_name :: $category_name\""
+
+set context_bar [category::context_bar $tree_id $locale [value_if_exists object_id]]
+lappend context_bar [list [export_vars -no_empty -base synonyms-view { category_id tree_id locale object_id }] "Synonyms of $category_name"] "Delete synonyms"
+
+set delete_url [export_vars -no_empty -base synonym-delete-2 { synonym_id:multiple category_id tree_id locale object_id }]
+set cancel_url [export_vars -no_empty -base synonyms-view { category_id tree_id locale object_id }]
+
+
+db_multirow synonyms get_synonyms_to_delete ""
+
+template::list::create \
+ -name synonyms \
+ -no_data "None" \
+ -elements {
+ synonym_name {
+ label "Name"
+ }
+ language {
+ label "Language"
+ }
+ }
+
+ad_return_template
Index: openacs-4/packages/categories/www/cadmin/synonym-delete.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonym-delete.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonym-delete.xql 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ select s.name as synonym_name, l.label as language
+ from category_synonyms s, ad_locales l
+ where s.locale = l.locale
+ and s.synonym_id in ([join $synonym_id ,])
+ order by lower(l.label), lower(s.name)
+
+
+
+
+
+
Index: openacs-4/packages/categories/www/cadmin/synonym-form.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonym-form.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonym-form.adp 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,9 @@
+
+@page_title;noquote@
+@context_bar;noquote@
+f
+synonym_form.name
+
+
+
+
Index: openacs-4/packages/categories/www/cadmin/synonym-form.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonym-form.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonym-form.tcl 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,59 @@
+ad_page_contract {
+
+ Form to add/edit a synonym.
+
+ @author Timo Hentschel (timo@timohentschel.de)
+ @cvs-id $Id:
+} {
+ synonym_id:integer,optional
+ category_id:integer,notnull
+ tree_id:integer,notnull
+ {locale ""}
+ object_id:integer,optional
+} -properties {
+ context_bar:onevalue
+ page_title:onevalue
+}
+
+set user_id [ad_maybe_redirect_for_registration]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+
+set tree_name [category_tree::get_name $tree_id $locale]
+set category_name [category::get_name $category_id $locale]
+
+if {[info exists synonym_id]} {
+ set action "Edit"
+} else {
+ set action "Add"
+}
+set page_title "$action category synonym of \"$tree_name :: $category_name\""
+
+set context_bar [category::context_bar $tree_id $locale [value_if_exists object_id]]
+lappend context_bar [list [export_vars -no_empty -base synonyms-view { category_id tree_id locale object_id }] "Synonyms of $category_name"] "$action synonym"
+
+
+set languages [lang::system::get_locale_options]
+
+ad_form -name synonym_form -action synonym-form -export { category_id tree_id locale object_id } -form {
+ {synonym_id:key(category_synonyms_id_seq)}
+ {name:text {label "Name"} {html {size 50 maxlength 200}}}
+ {language:text(select) {label "Language"} {options $languages}}
+} -new_request {
+ set name ""
+ if {![empty_string_p [ad_conn locale]]} {
+ set language [ad_conn locale]
+ } else {
+ set language [ad_parameter DefaultLocale acs-lang "en_US"]
+ }
+} -edit_request {
+ db_1row get_synonym ""
+} -new_data {
+ category_synonym::add -name $name -locale $language -category_id $category_id -synonym_id $synonym_id
+} -edit_data {
+ category_synonym::edit -name $name -locale $language -synonym_id $synonym_id
+} -after_submit {
+ ad_returnredirect [export_vars -no_empty -base synonyms-view {category_id tree_id locale object_id}]
+ ad_script_abort
+}
+
+ad_return_template
Index: openacs-4/packages/categories/www/cadmin/synonym-form.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonym-form.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonym-form.xql 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+ select name, locale as language
+ from category_synonyms
+ where synonym_id = :synonym_id
+ and synonym_p = 't'
+
+
+
+
+
+
Index: openacs-4/packages/categories/www/cadmin/synonyms-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonyms-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonyms-view.adp 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,6 @@
+
+@page_title;noquote@
+@context_bar;noquote@
+@locale;noquote@
+
+
Index: openacs-4/packages/categories/www/cadmin/synonyms-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonyms-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonyms-view.tcl 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,95 @@
+ad_page_contract {
+
+ Displays list of synonyms of a category.
+
+ @author Timo Hentschel (timo@timohentschel.de)
+ @cvs-id $Id:
+} {
+ category_id:integer,notnull
+ tree_id:integer,notnull
+ {locale ""}
+ object_id:integer,optional
+ orderby:optional
+} -properties {
+ page_title:onevalue
+ context_bar:onevalue
+ synonyms:multirow
+}
+
+set user_id [ad_maybe_redirect_for_registration]
+permission::require_permission -object_id $tree_id -privilege category_tree_write
+
+set tree_name [category_tree::get_name $tree_id $locale]
+set category_name [category::get_name $category_id $locale]
+set page_title "Synonyms for category \"$tree_name :: $category_name\""
+
+set context_bar [category::context_bar $tree_id $locale [value_if_exists object_id]]
+lappend context_bar "Synonyms of $category_name"
+
+
+#----------------------------------------------------------------------
+# List builder
+#----------------------------------------------------------------------
+
+template::list::create \
+ -name synonyms \
+ -no_data "None" \
+ -key synonym_id \
+ -actions [list "Add synonym" [export_vars -no_empty -base synonym-form { category_id tree_id locale object_id }] "Add new synonym"] \
+ -bulk_actions {
+ "Delete" "synonym-delete" "Delete checked synonyms"
+ } -bulk_action_export_vars { category_id tree_id locale object_id
+ } -orderby {
+ default_value language,asc
+ synonym_name {
+ label synonym_name
+ orderby_asc {lower(s.name) asc, lower(l.label) asc}
+ orderby_desc {lower(s.name) desc, lower(l.label) desc}
+ }
+ language {
+ label language
+ orderby_asc {lower(l.label) asc, lower(s.name) asc}
+ orderby_desc {lower(l.label) desc, lower(s.name) desc}
+ }
+ } -filters {
+ category_id {}
+ tree_id {}
+ locale {}
+ object_id {}
+ } -elements {
+ edit {
+ sub_class narrow
+ display_template {
+
+ }
+ link_url_col edit_url
+ link_html {title "Edit this synonym"}
+ }
+ synonym_name {
+ label "Synonym"
+ link_url_col edit_url
+ link_html {title "Edit this synonym"}
+ }
+ language {
+ label "Language"
+ }
+ delete {
+ sub_class narrow
+ display_template {
+
+ }
+ link_url_col delete_url
+ link_html { title "Delete synonym" }
+ }
+ }
+
+
+db_multirow synonyms get_synonyms ""
+
+multirow extend synonyms edit_url delete_url
+multirow foreach synonyms {
+ set edit_url [export_vars -no_empty -base synonym-form { synonym_id category_id tree_id locale object_id }]
+ set delete_url [export_vars -no_empty -base synonym-delete { synonym_id category_id tree_id locale object_id }]
+}
+
+ad_return_template
Index: openacs-4/packages/categories/www/cadmin/synonyms-view.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/synonyms-view.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/categories/www/cadmin/synonyms-view.xql 11 Feb 2004 13:25:28 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select s.synonym_id, s.name as synonym_name, l.label as language
+ from category_synonyms s, ad_locales l
+ where l.locale = s.locale
+ and s.category_id = :category_id
+ and s.synonym_p = 't'
+ [template::list::orderby_clause -orderby -name synonyms]
+
+
+
+
+
+
Index: openacs-4/packages/categories/www/cadmin/tree-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/www/cadmin/tree-view.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/categories/www/cadmin/tree-view.tcl 11 Feb 2004 11:44:00 -0000 1.9
+++ openacs-4/packages/categories/www/cadmin/tree-view.tcl 11 Feb 2004 13:25:28 -0000 1.10
@@ -56,7 +56,7 @@
# List builder
#----------------------------------------------------------------------
-multirow extend one_tree usage_url add_url edit_url delete_url parent_url phase_in_url phase_out_url links_view_url
+multirow extend one_tree usage_url add_url edit_url delete_url parent_url phase_in_url phase_out_url links_view_url synonyms_view_url
multirow foreach one_tree {
set usage_url [export_vars -no_empty -base category-usage { category_id tree_id locale object_id }]
if { $can_write_p } {
@@ -65,6 +65,7 @@
set delete_url [export_vars -no_empty -base category-delete { category_id tree_id locale object_id }]
set parent_url [export_vars -no_empty -base category-parent-change { category_id tree_id locale object_id }]
set links_view_url [export_vars -no_empty -base category-links-view { category_id tree_id locale object_id }]
+ set synonyms_view_url [export_vars -no_empty -base synonyms-view { category_id tree_id locale object_id }]
if { [template::util::is_true $deprecated_p] } {
set phase_in_url [export_vars -no_empty -base category-phase-in { category_id tree_id locale object_id }]
} else {
@@ -82,6 +83,7 @@
}
link_url_col edit_url
+ link_html {title "Edit this category"}
}
}
@@ -112,7 +114,8 @@
label "Actions"
display_template {
Change parent
- View links
+ View links
+ View synonyms
}
}