Index: openacs-4/contrib/obsolete-packages/postcard/www/confirm.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/confirm.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/confirm.tcl 20 Apr 2001 20:51:22 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/confirm.tcl 21 Aug 2001 22:22:29 -0000 1.2
@@ -7,6 +7,7 @@
@creation-date 2000-10-23
@cvs-id $Id$
} {
+ card_id:integer,notnull
image_id:integer,notnull
sender:notnull
recipient:notnull
@@ -22,5 +23,9 @@
}
# Insert a new postcard in the database, set card_id to the card id value
+ad_require_permission [ad_conn package_id] "postcard_create_card"
+set exported_vars [export_form_vars [list sender card_id recipient subject message card_id]]
+
ad_return_template
+
Index: openacs-4/contrib/obsolete-packages/postcard/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/index.tcl 20 Apr 2001 20:51:22 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/index.tcl 21 Aug 2001 22:22:29 -0000 1.2
@@ -4,13 +4,15 @@
send a post card
@author hqm@ai.mit.edu
+ @author k_vertigo@yahoo.com
@creation-date 2000-10-23
@cvs-id $Id$
} -properties {
message:onevalue
}
-db_multirow images images {
+
+db_multirow images get_all_images {
select card_image_id, mime_type, title, description
from postcard_images
order by card_image_id
Index: openacs-4/contrib/obsolete-packages/postcard/www/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/index.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/obsolete-packages/postcard/www/index.xql 21 Aug 2001 22:22:29 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ select card_image_id, mime_type, title, description
+ from postcard_images
+ order by card_image_id
+
+
+
+
+
Index: openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture-postgresql.xql 7 May 2001 19:19:59 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture-postgresql.xql 21 Aug 2001 22:22:29 -0000 1.2
@@ -3,13 +3,11 @@
postgresql7.1
-
+
--- FIX ME LOB
- select image
+ select lob
from postcard_images
- where card_image_id = $image_id
-
+ where card_image_id = :image_id
Index: openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl 20 Apr 2001 20:51:22 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/postcard-picture.tcl 21 Aug 2001 22:22:29 -0000 1.2
@@ -7,7 +7,7 @@
@creation-date 6 Nov 2000
@cvs-id $Id$
} {
- {image_id:notnull}
+ {image_id:integer,notnull}
}
@@ -16,10 +16,11 @@
from postcard_images
where card_image_id = :image_id}]
-db_write_blob select_image "
-select image
+
+db_write_blob retrieve_image "
+select lob
from postcard_images
- where card_image_id = $image_id
+ where card_image_id = :image_id
"
Index: openacs-4/contrib/obsolete-packages/postcard/www/send-card.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/send-card.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/send-card.tcl 20 Apr 2001 20:51:22 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/send-card.tcl 21 Aug 2001 22:22:29 -0000 1.2
@@ -7,6 +7,7 @@
@creation-date 2000-10-23
@cvs-id $Id$
} {
+ card_id:integer,notnull
image_id:integer,notnull
sender:notnull
recipient:notnull
@@ -18,19 +19,26 @@
url:onevalue
}
-set card_id [db_nextval postcard_seq]
+ad_require_permission [ad_conn package_id] "postcard_create_card"
set pickup_code [ns_crypt $card_id foobar]
-db_dml add_message {
- insert into postcards (card_id, pickup_code, card_picture, recipient, sender, message)
- values (:card_id, :pickup_code, :image_id, :recipient, :sender, :message)
-}
+db_transaction {
-db_0or1row select_card_id {
- select max(card_id) as card_id from postcards
+ db_dml add_message {
+ insert into postcards (card_id, pickup_code, card_picture, recipient, sender, message)
+ values (:card_id, :pickup_code, :image_id, :recipient, :sender, :message)
+ }
+
+ db_0or1row select_card_id {
+ select max(card_id) as card_id from postcards
+ }
+
+} on_error { # most likely a double click
+ ad_returnredirect "."
}
+
set url "[util_current_location][ad_conn package_url]show-card?pickup_code=$pickup_code"
@@ -50,3 +58,5 @@
"
ns_sendmail $recipient $sender $subject $message
+
+
Index: openacs-4/contrib/obsolete-packages/postcard/www/show-card-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/show-card-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/show-card-postgresql.xql 7 May 2001 19:19:59 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/show-card-postgresql.xql 21 Aug 2001 22:22:29 -0000 1.2
@@ -7,7 +7,7 @@
update postcards
- set picked_up = current_time
+ set picked_up = now()
where pickup_code = :pickup_code
Index: openacs-4/contrib/obsolete-packages/postcard/www/show-card.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/show-card.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/show-card.tcl 20 Apr 2001 20:51:22 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/show-card.tcl 21 Aug 2001 22:22:29 -0000 1.2
@@ -16,12 +16,15 @@
}
# Get Record
-db_0or1row select_card_id {
+if ![db_0or1row select_card_id {
select card_id, card_picture as image_id, recipient, sender, message, picked_up
from postcards
where pickup_code = :pickup_code
+}] {
+ ns_log NOTICE "\n\n\n*****\n**** houston we have a problem"
}
+
# Set picked_up date
if [empty_string_p $picked_up] {
db_dml set_date {
Index: openacs-4/contrib/obsolete-packages/postcard/www/write-card.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/postcard/www/write-card.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/obsolete-packages/postcard/www/write-card.adp 20 Apr 2001 20:51:22 -0000 1.1
+++ openacs-4/contrib/obsolete-packages/postcard/www/write-card.adp 21 Aug 2001 22:22:29 -0000 1.2
@@ -6,6 +6,7 @@
|