Index: openacs-4/contrib/packages/simulation/www/citybuild/object-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-edit.adp,v
diff -u -r1.8 -r1.9
--- openacs-4/contrib/packages/simulation/www/citybuild/object-edit.adp 12 Jan 2004 11:35:33 -0000 1.8
+++ openacs-4/contrib/packages/simulation/www/citybuild/object-edit.adp 16 Jan 2004 16:03:44 -0000 1.9
@@ -4,15 +4,13 @@
TODO: (2h) Lars, modify content field to allow uploading of non-text documents (word, etc), after which point content field should display as a hyperlink and a delete button (applies to all types)
TODO: (0.1h) suppress HTML cut-paste text for stylesheet field in other types -
TODO: (0.1h) default Show in Directory to No +
TODO: (0.1h) default Show in Directory to No (it's defaulted in the acs_attributes table, but the value doesn't show in the form ...)
TODO: (0.1h) "Associated with 1" should say "Associated With"
TODO: (0.1h) OK button should say "Done" or "Finished" ?
TODO: (0.1h) help text for any image: "To make this image appear when the object is viewed, put the html snippet in the Content field." -
TODO: (0.1h) if a URI is submitted, filter it the same way as implicit URI from title. ie, replace spaces with dashes. \ No newline at end of file +
TODO: (0.1h) if a URI is submitted, filter it the same way as implicit URI from title. ie, replace spaces with dashes.
Index: openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-edit.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 12 Jan 2004 16:04:22 -0000 1.13
+++ openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 16 Jan 2004 16:03:44 -0000 1.14
@@ -132,9 +132,12 @@
is_located_in {
label "Located inside (optional)"
}
-
}
-
+ attributes {
+ on_map_p {
+ write_privileges "sim_set_map_p"
+ }
+ }
}
sim_prop {
content_method richtext
@@ -158,6 +161,11 @@
label "Letterhead"
}
}
+ attributes {
+ on_map_p {
+ write_privileges "sim_set_map_p"
+ }
+ }
}
sim_stylesheet {
content_method textarea
@@ -400,6 +408,12 @@
-property widget \
-default $form_widget($datatype)]
+ set elm_write_privileges [get_metadata_property \
+ -content_type $content_type \
+ -entry_type attributes \
+ -entry $attribute_name \
+ -property write_privileges \
+ -default {}]
set elm_required_p [get_metadata_property \
-content_type $content_type \
-entry_type attributes \
@@ -415,6 +429,20 @@
lappend extra { options \$options }
}
+ if { [llength $elm_write_privileges] > 0 } {
+ set mode display
+ foreach privilege $elm_write_privileges {
+ # HACK: we only check permission on the package
+ if { [permission::permission_p -object_id [ad_conn package_id] -privilege $privilege] } {
+ set mode edit
+ break
+ }
+ }
+ if { [string equal $mode "display"] } {
+ lappend extra { mode display }
+ }
+ }
+
set elm_decl "${elm_name}:${elm_datatype}($elm_widget)"
if { !$elm_required_p } {
append elm_decl ",optional"
Index: openacs-4/packages/simulation/www/citybuild/object-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/object-edit.adp,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/simulation/www/citybuild/object-edit.adp 12 Jan 2004 11:35:33 -0000 1.8
+++ openacs-4/packages/simulation/www/citybuild/object-edit.adp 16 Jan 2004 16:03:44 -0000 1.9
@@ -4,15 +4,13 @@
TODO: (2h) Lars, modify content field to allow uploading of non-text documents (word, etc), after which point content field should display as a hyperlink and a delete button (applies to all types)
TODO: (0.1h) suppress HTML cut-paste text for stylesheet field in other types -
TODO: (0.1h) default Show in Directory to No +
TODO: (0.1h) default Show in Directory to No (it's defaulted in the acs_attributes table, but the value doesn't show in the form ...)
TODO: (0.1h) "Associated with 1" should say "Associated With"
TODO: (0.1h) OK button should say "Done" or "Finished" ?
TODO: (0.1h) help text for any image: "To make this image appear when the object is viewed, put the html snippet in the Content field." -
TODO: (0.1h) if a URI is submitted, filter it the same way as implicit URI from title. ie, replace spaces with dashes. \ No newline at end of file +
TODO: (0.1h) if a URI is submitted, filter it the same way as implicit URI from title. ie, replace spaces with dashes. Index: openacs-4/packages/simulation/www/citybuild/object-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/object-edit.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/simulation/www/citybuild/object-edit.tcl 12 Jan 2004 16:04:22 -0000 1.13 +++ openacs-4/packages/simulation/www/citybuild/object-edit.tcl 16 Jan 2004 16:03:44 -0000 1.14 @@ -132,9 +132,12 @@ is_located_in { label "Located inside (optional)" } - } - + attributes { + on_map_p { + write_privileges "sim_set_map_p" + } + } } sim_prop { content_method richtext @@ -158,6 +161,11 @@ label "Letterhead" } } + attributes { + on_map_p { + write_privileges "sim_set_map_p" + } + } } sim_stylesheet { content_method textarea @@ -400,6 +408,12 @@ -property widget \ -default $form_widget($datatype)] + set elm_write_privileges [get_metadata_property \ + -content_type $content_type \ + -entry_type attributes \ + -entry $attribute_name \ + -property write_privileges \ + -default {}] set elm_required_p [get_metadata_property \ -content_type $content_type \ -entry_type attributes \ @@ -415,6 +429,20 @@ lappend extra { options \$options } } + if { [llength $elm_write_privileges] > 0 } { + set mode display + foreach privilege $elm_write_privileges { + # HACK: we only check permission on the package + if { [permission::permission_p -object_id [ad_conn package_id] -privilege $privilege] } { + set mode edit + break + } + } + if { [string equal $mode "display"] } { + lappend extra { mode display } + } + } + set elm_decl "${elm_name}:${elm_datatype}($elm_widget)" if { !$elm_required_p } { append elm_decl ",optional"