Move Album to new folder:
-
\ No newline at end of file
+
#photo-album.lt_Move_Album_to_new_fol#
+
Index: openacs-4/packages/photo-album/www/album-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-move.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/album-move.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/album-move.tcl 18 Nov 2003 18:27:52 -0000 1.3
@@ -11,11 +11,11 @@
} -validate {
valid_album -requires {album_id:integer} {
if [string equal [pa_is_album_p $album_id] "f"] {
- ad_complain "The specified album is not valid."
+ ad_complain "[_ photo-album._The_1]"
}
}
}
-set context_list [pa_context_bar_list -final "Move Album" $album_id]
+set context_list [pa_context_bar_list -final "[_ photo-album._Move]" $album_id]
set user_id [ad_conn user_id]
# to move an album need write on album, and old parent folder
@@ -38,7 +38,7 @@
# options query retreive all folders in package that user can add an album to
set root_folder_id [pa_get_root_folder]
-template::element create move_album new_folder_id -label "Choose New Folder for Album" \
+template::element create move_album new_folder_id -label "[_ photo-album._Choose]" \
-datatype integer -widget select \
-options [db_list_of_lists get_folders "select
lpad (' ',((level - 1) * 18),' ') || content_folder.get_label(ci.item_id) as padded_name,
@@ -96,11 +96,9 @@
from cr_items
where name = :folder_name
and parent_id = :new_folder_id"] {
- ad_return_complaint 1 "Either there is already an album in the specified folder with the name \"$folder_name\" or you clicked on the button more than once. You can return to the new folder to see if your album is there."
+ ad_return_complaint 1 "[_ photo-album._Either_1]"
} else {
- ad_return_complaint 1 "We got an error that we couldn't readily identify. Please let the system owner know about this.
-
-
$errmsg
"
+ ad_return_complaint 1 "[_ photo-album._We]"
}
ad_script_abort
Index: openacs-4/packages/photo-album/www/album-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/photo-album/www/album-oracle.xql 12 Jun 2003 06:55:45 -0000 1.1
+++ openacs-4/packages/photo-album/www/album-oracle.xql 18 Nov 2003 18:27:52 -0000 1.2
@@ -8,6 +8,7 @@
select cr.title,
cr.description,
+ pa.photographer,
pa.story,
ci.parent_id as parent_folder_id,
case when acs_permission.permission_p(ci.item_id, :user_id, 'admin') = 't' then 1 else 0 end as admin_p,
Index: openacs-4/packages/photo-album/www/album-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/photo-album/www/album-postgresql.xql 12 Jun 2003 06:55:45 -0000 1.1
+++ openacs-4/packages/photo-album/www/album-postgresql.xql 18 Nov 2003 18:27:52 -0000 1.2
@@ -9,6 +9,7 @@
select cr.title,
cr.description,
pa.story,
+ pa.photographer,
ci.parent_id as parent_folder_id,
case when acs_permission__permission_p(ci.item_id, :user_id, 'admin') = 't' then 1 else 0 end as admin_p,
case when acs_permission__permission_p(ci.item_id, :user_id, 'pa_create_photo') = 't' then 1 else 0 end as photo_p,
Index: openacs-4/packages/photo-album/www/album.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/album.adp 9 Oct 2003 10:01:09 -0000 1.2
+++ openacs-4/packages/photo-album/www/album.adp 18 Nov 2003 18:27:52 -0000 1.3
@@ -3,8 +3,8 @@
@context@1
@page_nav;noquote@
-@message@
-
Click on the small photos to see a bigger
-version, the numbers to see different pages, or the Next or Previous
-page links to move back and forth. You can also pick photos for
-printing or emailing on the individual photo display page.
+
@@ -45,3 +45,4 @@
+
Index: openacs-4/packages/photo-album/www/clipboard-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboard-view.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/clipboard-view.tcl 26 Sep 2003 14:25:22 -0000 1.4
+++ openacs-4/packages/photo-album/www/clipboard-view.tcl 18 Nov 2003 18:27:53 -0000 1.5
@@ -20,7 +20,7 @@
set user_id [ad_conn user_id]
if {![db_0or1row collection {select first_names || ' ' || last_name as owner_name, owner_id, title from pa_collections, cc_users where collection_id = :collection_id and owner_id = user_id}] } {
- ad_return_complaint 1 "
invalid clipboard"
+ ad_return_complaint 1 "<#_
invalid clipboard#>"
ad_script_abort
}
Index: openacs-4/packages/photo-album/www/clipboards.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/clipboards.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/clipboards.adp 30 Jun 2003 07:50:59 -0000 1.2
+++ openacs-4/packages/photo-album/www/clipboards.adp 18 Nov 2003 18:27:53 -0000 1.3
@@ -1,25 +1,21 @@
- Your clipboards
- Clipboards
+ #photo-album.Your_clipboards#
+ #photo-album.Clipboards#
- You will have to log in or
- register
- in order to manage clipboards.
+ #photo-album.You_will_have_to# #photo-album.log_in# #photo-album.or#
+ #photo-album.register#
+ #photo-album.lt_in_order_to_manage_cl#
- You do not currently have any clipboards defined. You will
- need to browse the photos and add them to a clipboard to use
- this part of the site.
+ #photo-album.lt_You_do_not_currently_# #photo-album.photos# #photo-album.lt_and_add_them_to_a_cli#
Move folder to new folder:
-
\ No newline at end of file
+
#photo-album.lt_Move_folder_to_new_fo#
+
Index: openacs-4/packages/photo-album/www/folder-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-move.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/folder-move.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/folder-move.tcl 18 Nov 2003 18:27:53 -0000 1.3
@@ -11,18 +11,18 @@
} -validate {
valid_folder -requires {folder_id:integer} {
if [string equal [pa_is_folder_p $folder_id] "f"] {
- ad_complain "The specified folder is not valid."
+ ad_complain "[_ photo-album._The_3]"
}
}
not_root_folder -requires {folder_id} {
if { $folder_id == [pa_get_root_folder] } {
- ad_complain "You may not move the root folder."
+ ad_complain "[_ photo-album._You_2]"
}
}
}
-set context_list [pa_context_bar_list -final "Move Folder" $folder_id]
+set context_list [pa_context_bar_list -final "[_ photo-album._Move_1]" $folder_id]
set user_id [ad_conn user_id]
# to move an folder need write on folder, and old parent folder
@@ -45,7 +45,7 @@
# options query retreive all folders in package that user can add an folder to
set root_folder_id [pa_get_root_folder]
-template::element create move_folder new_folder_id -label "Choose New Folder for Folder" \
+template::element create move_folder new_folder_id -label "[_ photo-album._Choose_1]" \
-datatype integer -widget select \
-options [db_list_of_lists get_folders "select padded_name, folder_id from (select
ci.item_id,
@@ -104,11 +104,9 @@
from cr_items
where name = :folder_name
and parent_id = :new_folder_id"] {
- ad_return_complaint 1 "Either there is already an folder in the specified folder with the name \"$folder_name\" or you clicked on the button more than once. You can return to the new folder to see if your folder is there."
+ ad_return_complaint 1 "[_ photo-album._Either_3]"
} else {
- ad_return_complaint 1 "We got an error that we couldn't readily identify. Please let the system owner know about this.
-
-
- To order prints of these photos you will first need to add them
- to a clipboard (you can do this when viewing an individual
- photo). Once they are in a clipboard you can send them off to
- shutterfly.com for
- printing from a clipboard screen.
+ #photo-album.lt_To_order_prints_of_th#
+ #photo-album.shutterflycom# #photo-album.lt_for______printing_fro# #photo-album.clipboard# #photo-album.screen#
+
Index: openacs-4/packages/photo-album/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/index.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/photo-album/www/index.tcl 26 Sep 2003 14:25:22 -0000 1.4
+++ openacs-4/packages/photo-album/www/index.tcl 18 Nov 2003 18:27:53 -0000 1.5
@@ -11,7 +11,7 @@
} -validate {
valid_folder -requires {folder_id:integer} {
if [string equal [pa_is_folder_p $folder_id] "f"] {
- ad_complain "The specified folder is not valid."
+ ad_complain "[_ photo-album._The_3]"
}
}
} -properties {
@@ -40,6 +40,7 @@
db_1row get_folder_info {}
set root_folder_id [pa_get_root_folder]
+set parameter_url_vars [export_url_vars package_id=[ad_conn package_id] return_url=[ad_conn url]]
# to move an album need write on album and write on parent folder
set move_p [expr $write_p && !($folder_id == $root_folder_id) && $parent_folder_write_p]
Index: openacs-4/packages/photo-album/www/pa_master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/pa_master.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/photo-album/www/pa_master.adp 10 Jun 2003 10:07:11 -0000 1.1
+++ openacs-4/packages/photo-album/www/pa_master.adp 18 Nov 2003 18:27:53 -0000 1.2
@@ -1,5 +1,5 @@
-Photo Album System : @title@
+#photo-album.lt_Photo_Album_System__t#
@title@
@@ -8,3 +8,4 @@
+
Index: openacs-4/packages/photo-album/www/photo-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add-2.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-add-2.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-add-2.tcl 18 Nov 2003 18:27:53 -0000 1.3
@@ -21,6 +21,27 @@
ad_complain "The specified album is not valid."
}
}
+ valid_mime_type {
+
+ if ![parameter::get -parameter ConverttoJpgorPng -package_id [ad_conn package_id]] {
+
+ if { [catch {set photo_info [pa_file_info ${upload_file.tmpfile}]} errMsg] } {
+ ns_log Warning "Error parsing file data Error: $errMsg"
+ ad_complain "error"
+ }
+
+ foreach {base_bytes base_width base_height base_type base_mime base_colors base_quantum base_sha256} $photo_info { break }
+
+ if [empty_string_p $base_mime] {
+ set base_mime invalid
+ }
+
+ if ![regexp $base_mime [parameter::get -parameter AcceptableUploadMIMETypes -package_id [ad_conn package_id]]] {
+ ad_complain "The parameter AcceptableUploadMIMETypes is not satisfied"
+ ad_complain "The parameter ConverttoJpgorPng is not in automatic mode"
+ }
+ }
+ }
valid_photo_id -requires {photo_id:integer} {
# supplied photo_id must not already exist
if {[db_string check_photo_id {}]} {
Index: openacs-4/packages/photo-album/www/photo-add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-add.adp 30 Jun 2003 07:53:56 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-add.adp 18 Nov 2003 18:27:53 -0000 1.3
@@ -1,5 +1,5 @@
-Upload a Photo
+#photo-album.Upload_a_Photo#@context_list@
-
\ No newline at end of file
+
Index: openacs-4/packages/photo-album/www/photo-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-add.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-add.tcl 18 Nov 2003 18:27:53 -0000 1.3
@@ -12,7 +12,7 @@
} -validate {
valid_album -requires {album_id:integer} {
if [string equal [pa_is_album_p $album_id] "f"] {
- ad_complain "The specified album is not valid."
+ ad_complain "[_ photo-album._The_4]"
}
}
} -properties {
@@ -23,7 +23,7 @@
# check for read permission on folder
ad_require_permission $album_id pa_create_photo
-set context_list [pa_context_bar_list -final "Upload photos" $album_id]
+set context_list [pa_context_bar_list -final "[_ photo-album._Upload]" $album_id]
set photo_id [db_string get_next_object_id "select acs_object_id_seq.nextval from dual"]
@@ -36,16 +36,16 @@
-label "photo_id" -datatype integer -widget hidden
template::element create photo_upload upload_file \
- -label "Choose a Photo to Upload" -help_text "Use the \"Browse...\" button find a file" -datatype text -widget file
+ -label "[_ photo-album._Choose_2]" -help_text "[_ photo-album._Use]" -datatype text -widget file
template::element create photo_upload caption -html { size 30 } \
- -label "Caption" -optional -help_text "OPTIONAL, Displayed on the thumbnail page" -datatype text
+ -label "<#_Caption#>" -optional -help_text "[_ photo-album.lt_OPTIONAL_Displayed_on]" -datatype text
template::element create photo_upload description -html { size 50} \
- -label "Photo Description" -optional -help_text "OPTIONAL, Displayed when viewing the photo" -datatype text
+ -label "[_ photo-album._Photo]" -optional -help_text "[_ photo-album.lt_OPTIONAL_Displayed_wh]" -datatype text
template::element create photo_upload story -html { cols 50 rows 4 wrap soft } \
- -label "Photo Story" -optional -help_text "OPTIONAL" -datatype text -widget textarea
+ -label "[_ photo-album._Photo_1]" -optional -help_text "[_ photo-album.OPTIONAL]" -datatype text -widget textarea
template::element set_properties photo_upload album_id -value $album_id
template::element set_properties photo_upload photo_id -value $photo_id
Index: openacs-4/packages/photo-album/www/photo-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-delete.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-delete.adp 30 Jun 2003 07:53:56 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-delete.adp 18 Nov 2003 18:27:53 -0000 1.3
@@ -7,10 +7,11 @@
-
Are you sure you want to delete the photo "@title@"? This action cannot be undone.
+
#photo-album.lt_Are_you_sure_you_want_2#
-
+
+
Index: openacs-4/packages/photo-album/www/photo-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-delete.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/photo-album/www/photo-delete.tcl 30 Sep 2003 12:10:09 -0000 1.3
+++ openacs-4/packages/photo-album/www/photo-delete.tcl 18 Nov 2003 18:27:53 -0000 1.4
@@ -16,7 +16,7 @@
} -validate {
valid_photo -requires {photo_id:integer} {
if [string equal [pa_is_photo_p $photo_id] "f"] {
- ad_complain "The specified photo is not valid."
+ ad_complain "[_ photo-album._The_2]"
}
}
} -properties {
@@ -50,7 +50,7 @@
} else {
# they still need to confirm
- set context_list [pa_context_bar_list -final "Delete Photo" $photo_id]
+ set context_list [pa_context_bar_list -final "[_ photo-album._Delete_1]" $photo_id]
db_1row get_photo_info {select
cr.title,
i.height as height,
Index: openacs-4/packages/photo-album/www/photo-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-edit.adp 30 Jun 2003 07:53:56 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-edit.adp 18 Nov 2003 18:27:53 -0000 1.3
@@ -3,5 +3,70 @@
@context_list@
-
+
+
+
+
+
+
+
+
+
+
+
+
+ #photo-album.Hide#:
+
+
+
+
+ #photo-album.Title#:
+
+
+
+
+ #photo-album.Caption#:
+
+
+
+
+ #photo-album.Descriptio#:
+
+
+
+
+ #photo-album.Story#:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/photo-album/www/photo-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-edit.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-edit.tcl 18 Nov 2003 18:27:53 -0000 1.3
@@ -8,24 +8,37 @@
@creation-date 12/11/2000
@cvs-id $Id$
} {
- photo_id:integer,notnull
-} -validate {
- valid_photo -requires {photo_id:integer} {
- if [string equal [pa_is_photo_p $photo_id] "f"] {
- ad_complain "The specified photo is not valid."
- }
- }
+ {hide:integer 0}
+ {photo_id:integer 0}
+ d:array,integer,optional
} -properties {
path:onevalue
height:onevalue
width:onevalue
}
+# -validate {
+# valid_photo -requires {photo_id:integer} {
+# if [string equal [pa_is_photo_p $photo_id] "f"] {
+# ad_complain "[_ photo-album._The_2]"
+# }
+# }
+# }
+
ad_require_permission $photo_id "write"
set user_id [ad_conn user_id]
-set context_list [pa_context_bar_list -final "Edit Photo Attributes" $photo_id]
+set context_list [pa_context_bar_list -final "[_ photo-album._Edit_2]" $photo_id]
+#clear the cached value
+util_memoize_flush $photo_id
+
+foreach id [array names d] {
+ if { $d($id) > 0 } {
+ pa_rotate $photo_id $d($photo_id)
+ }
+}
+
template::form create edit_photo
template::element create edit_photo photo_id -label "photo ID" \
@@ -38,21 +51,32 @@
-datatype integer -widget hidden
template::element create edit_photo title -html { size 30 } \
- -label "Photo Title" -optional -datatype text
+ -label "<#_Title#>" -optional -datatype text
template::element create edit_photo caption -html { size 30 } \
- -label "Caption" -help_text "Displayed on the thumbnail page" -optional -datatype text
+ -label "<#_Caption#>" -help_text "Displayed on the thumbnail page" -optional -datatype text
template::element create edit_photo description -html { size 50} \
- -label "Photo Description" -help_text "Displayed when viewing the photo" -optional -datatype text
+ -label "<#_Description#>" -help_text "Displayed when viewing the photo" -optional -datatype text
template::element create edit_photo story -html { cols 50 rows 4 wrap soft } \
- -label "Photo Story" -optional -datatype text -help_text "Displayed when viewing the photo" -widget textarea
+ -label "<#_Story#>" -optional -datatype text -help_text "Displayed when viewing the photo" -widget textarea
+template::element create edit_photo submit_b -widget submit \
+ -label submit -optional -datatype text
+
# moved outside is_request_block so that vars exist during form error reply
-db_1row get_photo_info {}
+db_1row get_photo_info { *SQL* }
+db_1row get_thumbnail_info { *SQL* }
+
+if [empty_string_p $live_revision] {
+ set checked_string "checked"
+} else {
+ set checked_string ""
+}
+#ad_return_error $checked_string "$live_revision"
set path $image_id
if { [template::form is_request edit_photo] } {
@@ -78,26 +102,35 @@
db_transaction {
db_exec_plsql update_photo_attributes {}
+ db_dml insert_photo_attributes { *SQL* }
- db_dml insert_photo_attributes {}
-
# for now all the attributes about the specific binary file stay the same
# not allowing users to modify the binary yet
# will need to modify thumb and view binaries when photo binary is changed
# db_dml update_photo_user_filename {}
db_exec_plsql set_live_revision {}
-
+
+ if $hide {
+ db_dml update_hides { *SQL* }
+ }
} on_error {
- ad_return_complaint 1 "An error occurred while processing your input. Please let the system owner know about this.
+ ad_return_complaint 1 "[_ photo-album._An_1]
$errmsg
"
ad_script_abort
}
-
+
ad_returnredirect "photo?photo_id=$photo_id"
ad_script_abort
}
+# These lines are to uncache the image in Netscape, Mozilla.
+# IE6 & Safari (mac) have a bug with the images cache
+ns_set put [ns_conn outputheaders] "Expires" "-"
+ns_set put [ns_conn outputheaders] "Last-Modified" "-"
+ns_set put [ns_conn outputheaders] "Pragma" "no-cache"
+ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache"
+
ad_return_template
Index: openacs-4/packages/photo-album/www/photo-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo-edit.xql 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo-edit.xql 18 Nov 2003 18:27:53 -0000 1.3
@@ -1,10 +1,31 @@
+
+
+ select
+ i.image_id as thumb_path,
+ i.height as thumb_height,
+ i.width as thumb_width
+ from cr_items ci,
+ cr_items ci2,
+ cr_child_rels ccr2,
+ images i
+ where ccr2.relation_tag = 'thumb'
+ and ci.item_id = ccr2.parent_id
+ and ccr2.child_id = ci2.item_id
+ and ci2.latest_revision = i.image_id
+ and ci.latest_revision is not null
+ and ci.item_id = :photo_id
+
+
+
select
- ci.live_revision as previous_revision,
+ ci.item_id,
+ ci.live_revision,
+ ci.latest_revision as previous_revision,
pp.caption,
pp.story,
cr.title,
@@ -18,17 +39,24 @@
cr_items ci2,
cr_child_rels ccr2,
images i
- where ci.live_revision = pp.pa_photo_id
- and ci.live_revision = cr.revision_id
+ where ci.latest_revision = pp.pa_photo_id
+ and ci.latest_revision = cr.revision_id
and ci.item_id = ccr2.parent_id
and ccr2.child_id = ci2.item_id
and ccr2.relation_tag = 'viewer'
- and ci2.live_revision = i.image_id
+ and ci2.latest_revision = i.image_id
and ci.item_id = :photo_id
+
+
+
+ update cr_items set live_revision = null where item_id = :photo_id
+
+
+
insert into pa_photos
Index: openacs-4/packages/photo-album/www/photo-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/photo-album/www/photo-postgresql.xql 12 Jun 2003 06:55:45 -0000 1.1
+++ openacs-4/packages/photo-album/www/photo-postgresql.xql 18 Nov 2003 18:27:53 -0000 1.2
@@ -34,5 +34,20 @@
+
+
+
+ select r.title as name, i.item_id
+ from cr_items i, cr_revisions r, cr_items i2
+ where i.live_revision = r.revision_id
+ and acs_permission__permission_p(i.item_id, :user_id, 'pa_create_photo') = 't'
+ and i.content_type = 'pa_album'
+ and i.item_id != :old_album_id
+ and i.tree_sortkey between i2.tree_sortkey and tree_right(i2.tree_sortkey)
+ and i2.item_id = :root_folder_id
+ order by i.tree_sortkey
+
+
+
Index: openacs-4/packages/photo-album/www/photo.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo.adp 9 Oct 2003 10:01:09 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo.adp 18 Nov 2003 18:27:53 -0000 1.3
@@ -10,6 +10,12 @@
+
+
- Save this photo to print or view later
+ #photo-album.lt_Save_this_photo_to_pr#
- This photo clipped to:
+ #photo-album.lt_This_photo_clipped_to#
- @clipped.title@ [remove]
+ @clipped.title@ [#photo-album.remove#]
- View all your clipboards
+ #photo-album.lt_View_all_your_clipboa#
+
Index: openacs-4/packages/photo-album/www/photo.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/photo-album/www/photo.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photo.tcl 18 Nov 2003 18:27:53 -0000 1.3
@@ -2,20 +2,16 @@
ad_page_contract {
- Photo display page.
+ Photo display page and allows user to move a photo from one album to another album in the same folder
@author Tom Baginski (bags@arsdigita.com)
@creation-date 12/10/2000
@cvs-id $Id$
} {
- photo_id:integer,notnull
+ {latest_revision 0}
+ {photo_id:integer 0}
{collection_id:integer,optional {}}
-} -validate {
- valid_photo -requires {photo_id:integer} {
- if [string equal [pa_is_photo_p $photo_id] "f"] {
- ad_complain "The specified photo is not valid."
- }
- }
+ {show_html_p 0"}
} -properties {
context:onevalue
title:onevalue
@@ -32,30 +28,135 @@
page_num:onevalue
show_base_link:onevalue
clipboards:multirow
+} -validate {
+ valid_photo -requires {photo_id:integer} {
+ if { [string equal $photo_id 0] && ![string equal $latest_revision 0] } {
+ set photo_id $latest_revision
+ }
+ if [string equal [pa_is_photo_p $photo_id] "f"] {
+ ad_complain "The specified photo is not valid."
+ }
+ }
}
ad_require_permission $photo_id "read"
-
set user_id [ad_conn user_id]
set context [pa_context_bar_list $photo_id]
+set root_folder_id [pa_get_root_folder]
+# to move a photo need write on photo, and old parent album
+# and pa_create_photo on new parent album (which is check in the is_valid block)
+
+
+set old_album_id [db_string get_parent_album {}]
+
+ad_require_permission $photo_id write
+ad_require_permission $old_album_id write
+
+
+# These lines are to uncache the image in Netscape, Mozilla.
+# IE6 & Safari (mac) have a bug with the images cache
+ns_set put [ns_conn outputheaders] "Expires" "-"
+ns_set put [ns_conn outputheaders] "Last-Modified" "-"
+ns_set put [ns_conn outputheaders] "Pragma" "no-cache"
+ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache"
+
+
# this is handled with a parameter rather than a permission on the
# individual photo so admin can turn access on and off for entire
# subsite at once. A permission would allow greater flexability, but
# to shut down access to base photos an admin would need to search through
# database and revoke all such permissions.
+
set show_base_link [ad_parameter AllowBasePhotoAccessP]
# query all the photo and permission info with a single trip to database
-if {![db_0or1row get_photo_info {}]} {
- ad_return_complaint 1 "
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.2 -r1.3
--- openacs-4/packages/photo-album/www/photos-edit.tcl 12 Jun 2003 06:55:45 -0000 1.2
+++ openacs-4/packages/photo-album/www/photos-edit.tcl 18 Nov 2003 18:27:53 -0000 1.3
@@ -30,13 +30,20 @@
delete_p:onevalue
}
+# These lines are to uncache the image in Netscape, Mozilla.
+# IE6 & Safari (mac) have a bug with the images cache
+ns_set put [ns_conn outputheaders] "Expires" "-"
+ns_set put [ns_conn outputheaders] "Last-Modified" "-"
+ns_set put [ns_conn outputheaders] "Cache-Control" "no-cache"
+
set user_id [ad_conn user_id]
# check for read permission on album
ad_require_permission $album_id read
set context_list [pa_context_bar_list -final "Edit page $page" $album_id]
+
db_1row get_album_info {
select cr.title,
cr.description,
@@ -71,10 +78,13 @@
# query tuning showed that the order by doubled the query time while sorting a few rows in tcl was fast
# wtem@olywa.net, 2001-09-24
+
+
set photo_sql "
- select ci.item_id as photo_id,
+ select coalesce(ci.live_revision,0) as hide_p,
+ ci.item_id as photo_id,
pp.caption,
- pp.story,
+ pp.story as photo_story,
to_char(pp.date_taken, 'MM/DD/YYYY HH:MI') as datetaken,
pp.camera_model,
pp.focal_length,
@@ -86,31 +96,39 @@
it.width as thumb_width,
iv.image_id as viewer_path,
iv.height as viewer_height,
- iv.width as viewer_width
+ iv.width as viewer_width,
+ cr.title as photo_title,
+ cr.description as photo_description
from cr_items ci,
cr_items cit,
cr_child_rels ccrt,
images it,
cr_items civ,
cr_child_rels ccrv,
images iv,
- pa_photos pp
+ pa_photos pp,
+ cr_revisions cr
where
ccrt.relation_tag = 'thumb'
+ and cr.revision_id = ci.latest_revision
+ and cr.item_id = ci.item_id
and ci.item_id = ccrt.parent_id
and ccrt.child_id = cit.item_id
- and cit.live_revision = it.image_id
+ and cit.latest_revision = it.image_id
and ccrv.relation_tag = 'viewer'
and ci.item_id = ccrv.parent_id
and ccrv.child_id = civ.item_id
- and civ.live_revision = iv.image_id
- and pp.pa_photo_id = ci.live_revision
+ and civ.latest_revision = iv.image_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(photo_id) $photo_id
+ set val(hide_p) $hide_p
+ set val(photo_id) $photo_id
set val(caption) $caption
- set val(story) $story
+ 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