 |
Index: openacs-4/packages/photo-album/www/photos-edit-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit-2.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/photo-album/www/photos-edit-2.tcl 19 Nov 2003 00:16:32 -0000 1.6
+++ openacs-4/packages/photo-album/www/photos-edit-2.tcl 12 Dec 2003 23:03:01 -0000 1.7
@@ -9,6 +9,7 @@
photo_story:array
photo_description:array
photo_title:array
+ sequence:array,integer
} -validate {
valid_album -requires {album_id:integer} {
if [string equal [pa_is_album_p $album_id] "f"] {
@@ -34,11 +35,12 @@
} else {
lappend shows $id
}
-
+
set acaption $caption($id)
set aphoto_story $photo_story($id)
set aphoto_description $photo_description($id)
set aphoto_title $photo_title($id)
+ set asequence $sequence($id)
set aphoto_id $id
set arevision_id [db_string get_rev_id "select coalesce(live_revision,latest_revision) from cr_items where item_id = :id"]
set auser_id [ad_conn user_id]
@@ -54,6 +56,13 @@
where pa_photo_id = (select latest_revision from cr_items where item_id = :id)
}
+ db_dml update_sequence {
+ update cr_child_rels
+ set order_n = :asequence
+ where child_id = :id
+ and parent_id = :album_id
+ }
+
if {[llength $hides]} {
db_dml update_hides "update cr_items set live_revision = null where item_id in ([join $hides ,])"
}
Index: openacs-4/packages/photo-album/www/photos-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/photo-album/www/photos-edit.adp 18 Nov 2003 22:59:03 -0000 1.5
+++ openacs-4/packages/photo-album/www/photos-edit.adp 12 Dec 2003 23:03:01 -0000 1.6
@@ -4,10 +4,10 @@
#photo-album.Name#: @title@
-Description: @description@
+
#photo-album.lt_Description_descripti#
-Story: @story@
+
#photo-album.Story_story#
@@ -73,3 +74,4 @@
@page_nav;noquote@
+
Index: openacs-4/packages/photo-album/www/photos-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/photos-edit.tcl 18 Nov 2003 22:59:03 -0000 1.4
+++ openacs-4/packages/photo-album/www/photos-edit.tcl 12 Dec 2003 23:03:01 -0000 1.5
@@ -86,6 +86,7 @@
pp.caption,
pp.story as photo_story,
to_char(pp.date_taken, 'MM/DD/YYYY HH:MI') as datetaken,
+ ccra.order_n as sequence,
pp.camera_model,
pp.focal_length,
pp.aperture,
@@ -107,7 +108,8 @@
cr_child_rels ccrv,
images iv,
pa_photos pp,
- cr_revisions cr
+ cr_revisions cr,
+ cr_child_rels ccra
where
ccrt.relation_tag = 'thumb'
and cr.revision_id = ci.latest_revision
@@ -119,31 +121,34 @@
and ci.item_id = ccrv.parent_id
and ccrv.child_id = civ.item_id
and civ.latest_revision = iv.image_id
+ and ccra.parent_id = :album_id
+ and ccra.child_id = ci.item_id
and pp.pa_photo_id = ci.latest_revision
and ci.item_id in ([join $photos_on_page ","])"
db_foreach get_child_photos $photo_sql {
- set val(hide_p) $hide_p
+ set val(hide_p) $hide_p
set val(photo_id) $photo_id
- set val(caption) $caption
- set val(photo_story) $photo_story
- set val(photo_description) $photo_description
- set val(photo_title) $photo_title
- set val(datetaken) $datetaken
+ set val(sequence) $sequence
+ set val(caption) $caption
+ set val(photo_story) $photo_story
+ set val(photo_description) $photo_description
+ set val(photo_title) $photo_title
+ set val(datetaken) $datetaken
set val(camera_model) $camera_model
set val(focal_length) $focal_length
set val(aperture) $aperture
set val(flash) $flash
set val(exposure_time) $exposure_time
- set val(thumb_path) $thumb_path
- set val(thumb_height) $thumb_height
- set val(thumb_width) $thumb_width
- set val(viewer_path) $viewer_path
- set val(viewer_height) $viewer_height
- set val(viewer_width) $viewer_width
- set val(window_height) [expr $viewer_height + 28]
- set val(window_width) [expr $viewer_width + 24]
- set child($photo_id) [array get val]
+ set val(thumb_path) $thumb_path
+ set val(thumb_height) $thumb_height
+ set val(thumb_width) $thumb_width
+ set val(viewer_path) $viewer_path
+ set val(viewer_height) $viewer_height
+ set val(viewer_width) $viewer_width
+ set val(window_height) [expr $viewer_height + 28]
+ set val(window_width) [expr $viewer_width + 24]
+ set child($photo_id) [array get val]
}
# if the structure of the multirow datasource ever changes, this needs to be rewritten