+@page_title@
+@context@
+
+Form for: @view_info.pretty_name@
+
+
+Preview Form
Index: openacs-4/packages/acs-object-management/www/admin/form.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/form.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/form.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,58 @@
+ad_page_contract {
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date 2009-08-07
+ @cvs-id $Id: form.tcl,v 1.1 2009/11/27 00:38:50 donb Exp $
+
+} {
+ object_view:notnull,sql_identifier
+}
+
+object_view::get -object_view $object_view -array view_info
+object_type::get -object_type $view_info(object_type) -array type_info
+
+set page_title $view_info(pretty_name)
+set context [list [list . "Types"] \
+ [list [export_vars -base object-type \
+ {{object_type $view_info(object_type)}}] $type_info(pretty_name)] \
+ [list [export_vars -base view {object_view}] "Form For $view_info(pretty_name)"] \
+ $page_title]
+set return_url [ad_conn url]?[ad_conn query]
+
+list::create \
+ -name form_elements \
+ -caption [_ acs-object-management.form_elements] \
+ -multirow form_elements \
+ -key attribute_id \
+ -pass_properties {
+ object_view
+ } \
+ -elements {
+ pretty_name {
+ label "[_ acs-object-management.pretty_name]"
+ }
+ datatype {
+ label "[_ acs-object-management.datatype]"
+ }
+ widget {
+ label "[_ acs-object-management.widget]"
+ }
+ action {
+ label "[_ acs-object-management.Action]"
+ display_template "
+
+ [_ acs-object-management.customize_widget]
+
+ "
+ }
+ }
+
+db_multirow -extend {add_edit_widget_url} \
+ form_elements get_form_elements {} {
+ set add_edit_widget_url [export_vars -base widget-add-edit \
+ {object_view attribute_id widget}]
+}
+
+set form_preview_url [export_vars -base form-preview {object_view}]
+ad_return_template
Index: openacs-4/packages/acs-object-management/www/admin/form.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/form.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/form.xql 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select aova.attribute_id, aova.view_attribute, aova.pretty_name, aova.sort_order,
+ aova.col_expr, aa.datatype, aa.object_type,
+ coalesce(aovaw.widget,
+ (select widget from acs_form_default_widgets where datatype = aa.datatype)) as widget
+ from acs_attributes aa join acs_view_attributes aova using (attribute_id)
+ left join acs_view_attribute_widgets aovaw using (object_view, attribute_id)
+ where aova.object_view = :object_view
+ order by aova.sort_order
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/index.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/index.adp 28 Jul 2009 23:35:09 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/index.adp 27 Nov 2009 00:38:50 -0000 1.2
@@ -2,4 +2,4 @@
@page_title@
@context@
-
+
Index: openacs-4/packages/acs-object-management/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/index.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-object-management/www/admin/index.tcl 14 Aug 2009 22:15:42 -0000 1.3
+++ openacs-4/packages/acs-object-management/www/admin/index.tcl 27 Nov 2009 00:38:50 -0000 1.4
@@ -14,17 +14,16 @@
set context [list $page_title]
list::create \
- -name dtypes \
+ -name object_types \
-caption $page_title \
- -multirow dtypes \
+ -multirow object_types \
-key object_type \
- -actions [list "[_ acs-object-management.add_type]" [export_vars -base dtype-add] "[_ acs-object-management.add_type]"] \
+ -actions [list "[_ acs-object-management.add_type]" [export_vars -base object-type-add] "[_ acs-object-management.add_type]"] \
-row_pretty_plural "[_ acs-object-management.dynamic_types]" \
- -bulk_actions [list "[_ acs-object-management.export]" dtypes-code "[_ acs-object-management.code_export]"] \
-elements {
pretty_name {
label "[_ acs-object-management.pretty_name]"
- link_url_eval $dtype_url
+ link_url_eval $object_type_url
orderby "lower(pretty_name)"
}
object_type {
@@ -33,14 +32,17 @@
}
action {
label "[_ acs-object-management.Action]"
- display_template "delete"
+ display_template "
+
+ [_ acs-object-management.delete]
+ "
}
}
-set orderby_clause [list::orderby_clause -orderby -name dtypes]
+set orderby_clause [list::orderby_clause -orderby -name object_types]
-db_multirow -extend { dtype_url delete_url } dtypes select_dtypes {} {
- set dtype_url [export_vars -base dtype {object_type}]
- set delete_url [export_vars -base dtype-delete {object_type}]
+db_multirow -extend { object_type_url delete_url } object_types select_object_types {} {
+ set object_type_url [export_vars -base object-type {object_type}]
+ set delete_url [export_vars -base object-type-delete {object_type}]
}
Index: openacs-4/packages/acs-object-management/www/admin/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/index.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/index.xql 28 Jul 2009 23:35:09 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/index.xql 27 Nov 2009 00:38:50 -0000 1.2
@@ -2,7 +2,7 @@
-
+
select object_type, pretty_name
Index: openacs-4/packages/acs-object-management/www/admin/object-type-add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type-add.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type-add.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,5 @@
+
+@page_title@
+@context@
+
+
Index: openacs-4/packages/acs-object-management/www/admin/object-type-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type-add.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type-add.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,42 @@
+ad_page_contract {
+
+ @author Vinod Kurup (vinod@kurup.com)
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date 2009-07-20
+
+ Modified from dynamic types.
+}
+
+set page_title [_ acs-object-management.create_type]
+set context [list $page_title]
+
+
+ad_form -name dtype-add -form {
+ {object_type:keyword
+ {label {[_ acs-object-management.object_type]}}
+ {html {size 30 maxlength 100}}
+ }
+ {pretty_name:text
+ {label {[_ acs-object-management.pretty_name]}}
+ {html {size 30 maxlength 100}}
+ }
+ {pretty_plural:text
+ {label {[_ acs-object-management.pretty_plural]}}
+ {html {size 30 maxlength 100}}
+ }
+ {supertype:keyword(select)
+ {label {[_ acs-object-management.supertype]}}
+ {options {[lang::util::localize [db_list_of_lists select_object_types {}]]}}
+ }
+} -on_submit {
+ object_type::new \
+ -object_type $object_type \
+ -supertype $supertype \
+ -pretty_name $pretty_name \
+ -pretty_plural $pretty_plural \
+ -create_table_p t
+} -after_submit {
+ ad_returnredirect ./
+ ad_script_abort
+}
+
Index: openacs-4/packages/acs-object-management/www/admin/object-type-add.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type-add.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type-add.xql 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select repeat(' ', tree_level(tree_sortkey)-1) || pretty_name, object_type
+ from acs_object_types
+ order by tree_sortkey
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/object-type-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type-delete.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type-delete.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,7 @@
+
+
+
+
+Really delete type "@type.pretty_name@"?
+
+
Index: openacs-4/packages/acs-object-management/www/admin/object-type-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type-delete.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,15 @@
+ad_page_contract {
+
+} {
+ object_type:sql_identifier,notnull
+}
+
+object_type::get -object_type $object_type -array type
+
+ad_form -name delete -export {object_type} -form {
+} -on_submit {
+
+ object_type::delete -object_type $object_type -drop_table_p t -drop_children_p t
+ ad_returnredirect ./[export_vars -base .]
+ ad_script_abort
+}
Index: openacs-4/packages/acs-object-management/www/admin/object-type-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type-postgresql.xql 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ select a.attribute_id, a.attribute_name, a.pretty_name, a.pretty_plural,
+ a.datatype, t.pretty_name as object_pretty_name
+ from acs_attributes a, acs_object_types t
+ where t.object_type in (select ot1.object_type
+ from acs_object_types ot1, acs_object_types ot2
+ where ot2.tree_sortkey between
+ tree_left(ot1.tree_sortkey) and tree_right(ot1.tree_sortkey)
+ and ot2.object_type = :object_type)
+ and a.object_type = t.object_type
+ order by t.tree_sortkey desc, a.sort_order asc;
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/object-type.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,11 @@
+
+@page_title@
+@context@
+
+#acs-object-management.object_type#: @type_info.pretty_name@
+
+
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/object-type.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,117 @@
+ad_page_contract {
+
+ @author Timo Hentschel (timo@timohentschel.de)
+ @creation-date 2005-05-02
+ @cvs-id $Id: object-type.tcl,v 1.1 2009/11/27 00:38:50 donb Exp $
+
+} {
+ object_type:notnull,sql_identifier
+}
+
+object_type::get -object_type $object_type -array type_info
+
+set page_title $type_info(pretty_name)
+set context [list [list . "Object Types"] $page_title]
+set return_url [ad_conn url]?[ad_conn query]
+
+list::create \
+ -name attributes \
+ -caption [_ acs-object-management.attributes] \
+ -multirow attributes \
+ -key attribute_id \
+ -pass_properties {
+ object_type
+ } -actions [list "[_ acs-object-management.add_attribute]" [export_vars -base attribute {object_type}] "[_ acs-object-management.add_attribute]"] \
+ -elements {
+ pretty_name {
+ label "[_ acs-object-management.attribute]"
+ link_url_eval $attribute_url
+ }
+ datatype {
+ label "[_ acs-object-management.datatype]"
+ }
+ action {
+ label "[_ acs-object-management.Action]"
+ display_template "
+
+ [_ acs-object-management.delete]
+ "
+ }
+ } -filters {
+ object_type {}
+ }
+
+db_multirow -cache_pool acs_metadata -cache_key t::${object_type}::get_attributes \
+ -extend { attribute_url delete_url} attributes get_attributes {} {
+ set attribute_url [export_vars -base attribute {attribute_id object_type}]
+ set delete_url [export_vars -base attribute-delete {object_type attribute_name}]
+}
+
+list::create \
+ -name inherited_attributes \
+ -caption [_ acs-object-management.inherited_attributes] \
+ -multirow inherited_attributes \
+ -key attribute_id \
+ -elements {
+ pretty_name {
+ label "[_ acs-object-management.attribute]"
+ }
+ object_pretty_name {
+ label "[_ acs-object-management.object_type]"
+ }
+ datatype {
+ label "[_ acs-object-management.datatype]"
+ }
+ } -filters {
+ object_type {}
+ }
+
+db_multirow -cache_pool acs_metadata -cache_key t::${object_type}::get_inherited_attributes \
+ inherited_attributes get_inherited_attributes {}
+
+list::create \
+ -name views \
+ -caption [_ acs-object-management.views] \
+ -multirow views \
+ -key object_view \
+ -actions [list "[_ acs-object-management.add_view]" [export_vars -base view-add {object_type}] "[_ acs-object-management.add_view]"] \
+ -elements {
+ pretty_name {
+ label "[_ acs-object-management.pretty_name]"
+ display_template "
+
+ @views.pretty_name@
+
+
+
+ @views.pretty_name@
+
+ "
+ }
+ object_view {
+ label "[_ acs-object-management.view]"
+ }
+ actions {
+ label "[_ acs-object-management.Action]"
+ display_template "
+
+
+ [_ acs-object-management.manage_form]
+
+
+ [_ acs-object-management.delete]
+
+ "
+ }
+ } -filters {
+ object_type {}
+ }
+
+db_multirow -cache_pool acs_metadata -cache_key t::${object_type}::get_views \
+ -extend { view_url delete_url manage_form_url } views get_views {} {
+ set delete_url [export_vars -base view-delete {return_url object_view}]
+ set manage_form_url [export_vars -base form {object_view}]
+ set view_url [export_vars -base view {object_view}]
+}
+
+ad_return_template
Index: openacs-4/packages/acs-object-management/www/admin/object-type.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/object-type.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/object-type.xql 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ select a.attribute_id, a.attribute_name, a.pretty_name, a.pretty_plural,
+ a.datatype
+ from acs_attributes a
+ where a.object_type = :object_type
+ order by a.sort_order asc;
+
+
+
+
+
+ select object_view, pretty_name, root_view_p
+ from acs_views
+ where object_type = :object_type
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/view-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view-add.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/view-add.tcl 28 Jul 2009 23:35:09 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/view-add.tcl 27 Nov 2009 00:38:50 -0000 1.2
@@ -12,20 +12,20 @@
ad_form -name view-add -export {object_type} -form {
{object_view:keyword
- {label {[_ acs-object-management.object_view]}}
+ {label {[_ acs-object-management.view]}}
{html {size 30 maxlength 100}}
}
{pretty_name:text
{label {[_ acs-object-management.pretty_name]}}
{html {size 30 maxlength 100}}
}
} -on_submit {
- object_type::view::new \
+ object_view::new \
-object_type $object_type \
-object_view $object_view \
-pretty_name $pretty_name
} -after_submit {
- ad_returnredirect ./[export_vars -base dtype {object_type}]
+ ad_returnredirect ./[export_vars -base object-type {object_type}]
ad_script_abort
}
Index: openacs-4/packages/acs-object-management/www/admin/view-attributes-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view-attributes-add.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/view-attributes-add.tcl 13 Aug 2009 00:15:05 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/view-attributes-add.tcl 27 Nov 2009 00:38:50 -0000 1.2
@@ -10,7 +10,7 @@
}
foreach one_attribute_id $attribute_id {
- object_type::view::attribute::copy -to_object_view $object_view -attribute_id $one_attribute_id
+ object_view::attribute::copy -to_object_view $object_view -attribute_id $one_attribute_id
}
ad_returnredirect $return_url
Index: openacs-4/packages/acs-object-management/www/admin/view-attributes-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view-attributes-delete.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/view-attributes-delete.tcl 13 Aug 2009 00:15:05 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/view-attributes-delete.tcl 27 Nov 2009 00:38:50 -0000 1.2
@@ -10,7 +10,7 @@
}
foreach one_attribute_id $attribute_id {
- object_type::view::attribute::delete \
+ object_view::attribute::delete \
-object_view $object_view \
-attribute_id $one_attribute_id
}
Index: openacs-4/packages/acs-object-management/www/admin/view-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view-delete.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/view-delete.tcl 13 Aug 2009 00:15:05 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/view-delete.tcl 27 Nov 2009 00:38:50 -0000 1.2
@@ -2,16 +2,14 @@
} {
object_view:sql_identifier,notnull
- object_type:sql_identifier,notnull
}
-object_type::view::get \
- -object_view $object_view \
- -array view
+object_view::get -object_view $object_view -array view
+set object_type $view(object_type)
ad_form -name delete -export {object_view object_type} -form {
} -on_submit {
- object_type::view::delete -object_view $object_view
- ad_returnredirect ./[export_vars -base dtype {object_type}]
+ object_view::delete -object_view $object_view
+ ad_returnredirect ./[export_vars -base object-type {object_type}]
ad_script_abort
}
Index: openacs-4/packages/acs-object-management/www/admin/view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-object-management/www/admin/view.adp 14 Aug 2009 22:15:42 -0000 1.2
+++ openacs-4/packages/acs-object-management/www/admin/view.adp 27 Nov 2009 00:38:50 -0000 1.3
@@ -2,7 +2,7 @@
@page_title@
@context@
-#acs-object-management.object_view#: @view_info.pretty_name@
+#acs-object-management.view#: @view_info.pretty_name@
Index: openacs-4/packages/acs-object-management/www/admin/view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-object-management/www/admin/view.tcl 14 Aug 2009 22:15:42 -0000 1.2
+++ openacs-4/packages/acs-object-management/www/admin/view.tcl 27 Nov 2009 00:38:50 -0000 1.3
@@ -8,13 +8,12 @@
object_view:notnull,sql_identifier
}
-object_type::view::get -object_view $object_view -array view_info
+object_view::get -object_view $object_view -array view_info
set object_type $view_info(object_type)
set page_title $view_info(pretty_name)
set context [list [list . "Dynamic Types"] \
- [list [export_vars -base dtype \
- {{object_type $view_info(object_type)}}] $view_info(object_type)] \
+ [list [export_vars -base object-type {object_type $view_info(object_type)}] $view_info(object_type)] \
$page_title]
set return_url [ad_conn url]?[ad_conn query]
@@ -25,15 +24,15 @@
-key attribute_id \
-pass_properties {
object_view
- } \
+ } -actions [list [_ acs-object-management.manage_form] [export_vars -base form {object_view}] [_ acs-object-management.manage_form]] \
-bulk_actions [list [_ acs-object-management.delete_checked_attributes] view-attributes-delete [_ acs-object-management.delete_checked_attributes]] \
-bulk_action_export_vars {return_url object_view} \
-elements {
pretty_name {
label "[_ acs-object-management.pretty_name]"
link_url_eval $attribute_url
}
- col_name {
+ view_attribute {
label "[_ acs-object-management.attribute]"
}
object_type {
@@ -45,14 +44,16 @@
action {
label "[_ acs-object-management.Action]"
display_template "
-
+
[_ acs-object-management.delete]
- "
+
+ "
}
}
db_multirow -cache_pool acs_metadata -cache_key v::${object_view}::get_view_attributes \
- -extend {attribute_url delete_url} view_attributes get_view_attributes {} {
+ -extend {attribute_url delete_url manage_form_url} \
+ view_attributes get_view_attributes {} {
set delete_url [export_vars -base view-attributes-delete {object_view return_url attribute_id}]
}
@@ -67,7 +68,7 @@
pretty_name {
label "[_ acs-object-management.pretty_name]"
}
- col_name {
+ view_attribute {
label "[_ acs-object-management.attribute]"
}
object_type {
@@ -79,17 +80,16 @@
action {
label "[_ acs-object-management.Action]"
display_template "
-
+
[_ acs-object-management.add]
"
}
}
+set object_type $view_info(object_type)
db_multirow -cache_pool acs_metadata -cache_key v::${object_view}::get_available_attributes \
-extend {add_url} available_attributes get_available_attributes {} {
set add_url [export_vars -base view-attributes-add {object_view attribute_id return_url}]
}
-set add_form_url [export_vars -base form-ae {object_type}]
-set return_url [ad_return_url]
ad_return_template
Index: openacs-4/packages/acs-object-management/www/admin/view.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/view.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-object-management/www/admin/view.xql 13 Aug 2009 00:15:05 -0000 1.1
+++ openacs-4/packages/acs-object-management/www/admin/view.xql 27 Nov 2009 00:38:50 -0000 1.2
@@ -4,28 +4,26 @@
- select aova.attribute_id, aova.col_name, aova.pretty_name, aova.sort_order,
+ select aova.attribute_id, aova.view_attribute, aova.pretty_name, aova.sort_order,
aova.col_expr, aa.datatype, aa.object_type
- from acs_attributes aa, acs_object_view_attributes aova
+ from acs_attributes aa join acs_view_attributes aova using (attribute_id)
where aova.object_view = :object_view
- and aa.attribute_id = aova.attribute_id
+ order by aova.sort_order
- select aova.attribute_id, aova.col_name, aova.pretty_name, aova.sort_order,
+ select aova.attribute_id, aova.view_attribute, aova.pretty_name, aova.sort_order,
aova.col_expr, aa.datatype, aa.object_type
- from acs_object_views aov, acs_object_view_attributes aova,
- acs_attributes aa
+ from acs_attributes aa join acs_view_attributes aova using (attribute_id)
+ join acs_views aov using (object_view)
where aov.object_type = :object_type
and aov.root_view_p
- and aov.object_view = aova.object_view
- and aova.attribute_id = aa.attribute_id
and not exists (select 1
- from acs_object_view_attributes aova2
+ from acs_view_attributes aova2
where aova2.object_view = :object_view
- and aova2.col_name = aova.col_name)
+ and aova2.view_attribute = aova.view_attribute)
order by aova.sort_order
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,5 @@
+Register Attribute Widget
+
+Register Attribute Widget
+
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,69 @@
+ad_page_contract {
+
+ Register a widget to an attribute
+} {
+ attribute_id:naturalnum
+ object_view:sql_identifier,notnull
+ widget:sql_identifier,notnull
+}
+
+set form_widgets [db_list_of_lists get_form_widgets "" ]
+
+ad_form -name widget_register -export {attribute_id object_view} -form {
+ {object_view_pretty:text(inform)
+ {label "[_ acs-object-management.view]"}
+ }
+ {attribute_name_pretty:text(inform)
+ {label "[_ acs-object-management.attribute]"}
+ }
+ {widget:keyword(select)
+ {label "[_ acs-object-management.form_widget]"}
+ {options $form_widgets}
+ }
+ {required_p:boolean(radio)
+ {label "[_ acs-object-management.required_p]"}
+ {options {{"[_ acs-object-management.Yes]" t}
+ {"[_ acs-object-management.No]" f}}}
+ }
+ {help_text:text,optional
+ {label "[_ acs-object-management.help_text]"}
+ }
+} -on_request {
+ db_1row get_attr_info {}
+ set object_view_pretty [lang::util::localize $object_view_pretty]
+ set attribute_name_pretty [lang::util::localize $attribute_name_pretty]
+ ad_set_form_values object_view_pretty attribute_name_pretty
+
+ if { [object_view::attribute::widget::exists_p \
+ -object_view $object_view \
+ -attribute_id $attribute_id] } {
+ object_view::attribute::widget::get \
+ -object_view $object_view \
+ -attribute_id $attribute_id \
+ -array current
+ ad_set_form_values {widget $widget} {required_p $current(required_p)} \
+ {help_text $current(help_text)}
+ } else {
+ ad_set_form_values {widget $widget} {required_p f}
+ }
+
+ wizard submit widget_register -buttons { next }
+} -on_submit {
+ db_transaction {
+ if { [db_0or1row get_reg_widget {}] && $registered_widget ne $widget } {
+ object_view::attribute::widget::unregister \
+ -object_view $object_view \
+ -attribute_id $attribute_id
+ }
+ object_view::attribute::widget::register \
+ -object_view $object_view \
+ -attribute_id $attribute_id \
+ -widget $widget \
+ -required_p $required_p \
+ -help_text $help_text
+ }
+ wizard set_param widget $widget
+ wizard forward
+ ad_script_abort
+}
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-1.xql 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,31 @@
+
+
+
+
+
+ select widget, widget
+ from acs_form_widgets
+
+
+
+
+
+ select widget as registered_widget
+ from acs_view_attribute_widgets
+ where attribute_id = :attribute_id
+ and object_view = :object_view
+
+
+
+
+
+ select aova.pretty_name as attribute_name_pretty,
+ aov.pretty_name as object_view_pretty
+ from acs_view_attributes aova, acs_views aov
+ where aov.object_view = :object_view
+ and aova.attribute_id = :attribute_id
+ and aova.object_view = :object_view
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,3 @@
+Set Attribute Widget Params
+
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,64 @@
+ad_page_contract {
+
+ Set widget parameter values.
+
+} {
+ attribute_id:naturalnum
+ object_view:sql_identifier
+ widget:sql_identifier
+}
+
+ad_form -name widget_register -export {attribute_id object_view} -form {
+ {object_view_pretty:text(inform)
+ {label "Object View"}
+ }
+ {attribute_name_pretty:text(inform)
+ {label "Attribute"}
+ }
+ {widget:keyword(inform)
+ {label "Widget"}
+ }
+ {-section "Widget Parameters" {legendtext "Widget Parameters"}}
+}
+
+db_multirow params get_params {} {
+ set optional_flag [expr { $required_p ? "" : ",optional" }]
+ set param [lang::util::localize $param]
+ ad_form -extend -name widget_register -form {
+ {${param}:text(textarea)$optional_flag}
+ }
+}
+
+ad_form -extend -name widget_register -on_request {
+ db_1row get_attr_info ""
+ set object_view_pretty [lang::util::localize $object_view_pretty]
+ set attribute_name_pretty [lang::util::localize $attribute_name_pretty]
+ ad_set_form_values object_view_pretty attribute_name_pretty widget
+
+ for { set i 1 } { $i <= [template::multirow size params] } { incr i } {
+ ad_set_element_value -element [template::multirow get params $i param] \
+ [template::multirow get params $i value]
+ }
+
+ wizard submit widget_register -buttons { back next }
+} -on_submit {
+ for { set i 1 } { $i <= [template::multirow size params] } { incr i } {
+ set value [template::element::get_value widget_register [template::multirow get params $i param]]
+ set param_id [template::multirow get params $i param_id]
+ if { $value eq "" } {
+ object_view::attribute::widget::param::delete \
+ -object_view $object_view \
+ -attribute_id $attribute_id \
+ -param_id $param_id
+ } else {
+ object_view::attribute::widget::param::set \
+ -object_view $object_view \
+ -attribute_id $attribute_id \
+ -param_id $param_id \
+ -value $value
+ }
+ }
+ wizard forward
+ ad_script_abort
+}
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-2.xql 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,32 @@
+
+
+
+
+
+ select aova.pretty_name as attribute_name_pretty,
+ aov.pretty_name as object_view_pretty
+ from acs_view_attributes aova, acs_views aov
+ where aov.object_view = :object_view
+ and aova.attribute_id = :attribute_id
+ and aova.object_view = :object_view
+
+
+
+
+
+ select
+ afwp.param_id, afwp.param, afwp.required_p, afwp.html_p,
+ coalesce(aovawp.value, afwp.default_value) as value,
+ coalesce(aovawp.param_source,'literal') as param_source
+ from
+ acs_form_widget_params afwp
+ left join acs_view_attribute_widgets aovaw using (widget)
+ left join acs_view_attribute_widget_params aovawp
+ using (param_id, attribute_id, object_view)
+ where aovaw.attribute_id = :attribute_id
+ and aovaw.object_view = :object_view
+ order by afwp.html_p, afwp.param_id
+
+
+
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-3.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-3.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-3.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,3 @@
+Preview Attribute Widget
+
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit-3.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit-3.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,26 @@
+ad_page_contract {
+
+ Preview a widget that's been registered to an attribute.
+
+} {
+ object_view:sql_identifier,notnull
+ attribute_id:naturalnum
+}
+
+set step [wizard current_step]
+set last_step [expr $step-1]
+set back_url [wizard get_forward_url $last_step]
+
+ad_form -name widget_preview -has_submit 1 -form \
+ [list [form::element \
+ -object_view $object_view \
+ -attribute_id $attribute_id]]
+
+ad_form -name widget_buttons -form {
+} -on_request {
+ wizard submit widget_buttons -buttons { back finish }
+} -on_submit {
+ wizard forward
+ ad_script_abort
+}
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit.adp 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,13 @@
+
+#acs-object-management.widget_add_edit#
+
+
+
+ @wizard.rownum@. @wizard.label@
+
+
+ @wizard.rownum@. @wizard.label@
+
+ §
+
+
Index: openacs-4/packages/acs-object-management/www/admin/widget-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-add-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-add-edit.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,24 @@
+ad_page_contract {
+
+ wizard for adding/editing widgets registered to object views.
+
+} {
+ attribute_id:naturalnum
+ object_view:sql_identifier,notnull
+ widget:sql_identifier
+}
+
+wizard set_param attribute_id $attribute_id
+wizard set_param object_view $object_view
+wizard set_param widget $widget
+
+wizard create -action widget-add-edit -params {
+ attribute_id object_view widget
+} -steps {
+ 1 -label "[_ acs-object-management.choose_a_widget]" -url widget-add-edit-1
+ 2 -label "[_ acs-object-management.edit_widget_params]" -url widget-add-edit-2
+ 3 -label "[_ acs-object-management.preview_widget]" -url "widget-add-edit-3"
+}
+wizard set_finish_url [export_vars -base form {object_view}]
+
+wizard get_current_step
Index: openacs-4/packages/acs-object-management/www/admin/widget-remove.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/www/admin/widget-remove.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-object-management/www/admin/widget-remove.tcl 27 Nov 2009 00:38:50 -0000 1.1
@@ -0,0 +1,15 @@
+ad_page_contract {
+
+ Remove the widget registered to a view attribute.
+
+} {
+ attribute_id:naturalnum
+ object_view:sql_identifier
+ return_url:notnull
+}
+
+ object_view::attribute::widget::unregister \
+ -object_view $object_view \
+ -attribute_id $attribute_id
+
+ad_returnredirect $return_url