Index: openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl,v
diff -u -N -r1.12 -r1.13
--- openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl 21 Jan 2018 00:35:30 -0000 1.12
+++ openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.tcl 29 May 2018 09:30:48 -0000 1.13
@@ -23,18 +23,29 @@
permission::require_permission -object_id $user_id -privilege "write"
-if {![db_0or1row user_info {}]} {
+if {![person::person_p -party_id $user_id]} {
ad_return_error \
"Account Unavailable" \
"We can't find you (user #$user_id) in the users table. Probably your account was deleted for some reason."
ad_script_abort
}
-if {![db_0or1row portrait_info {}]} {
+set user [acs_user::get -user_id $user_id]
+set first_names [dict get $user first_names]
+set last_name [dict get $user last_name]
+
+set portrait_id [acs_user::get_portrait_id -user_id $user_id]
+
+if {$portrait_id == 0} {
ad_return_complaint 1 "
You shouldn't have gotten here; we don't have a portrait on file for you."
return
}
+set description [db_string portrait_info {
+ select description from cr_revisions
+ where revision_id = (select live_revision from cr_items
+ where item_id = :portrait_id)}]
+
set doc(title) [_ acs-subsite.Edit_caption]
set context [list \
[list [ad_pvt_home] [ad_pvt_home_name]] \
@@ -58,7 +69,13 @@
return
}
- db_dml comment_update {}
+ db_dml comment_update {
+ update cr_revisions set
+ description = :description
+ where revision_id = (select live_revision
+ from cr_items
+ where item_id = :portrait_id)
+ }
ad_returnredirect $return_url
ad_script_abort
Index: openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/Attic/comment-edit.xql,v
diff -u -N
--- openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.xql 27 Nov 2007 18:02:10 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- select first_names, last_name
- from persons
- where person_id = :user_id
-
-
-
-
-
-
- select description
- from cr_revisions
- where revision_id = (select live_revision
- from cr_items c, acs_rels a
- where c.item_id = a.object_id_two
- and a.object_id_one = :user_id
- and a.rel_type = 'user_portrait_rel')
-
-
-
-
-
- update cr_revisions
- set description=:description
- where revision_id = (select live_revision
- from acs_rels a, cr_items c
- where a.object_id_two = c.item_id
- and a.object_id_one = :user_id
- and a.rel_type = 'user_portrait_rel')
-
-
-
-
\ No newline at end of file