Index: openacs-4/packages/static-pages/sql/postgresql/static-page-pb.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/sql/postgresql/static-page-pb.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/static-pages/sql/postgresql/static-page-pb.sql 16 Jan 2003 14:00:21 -0000 1.2
+++ openacs-4/packages/static-pages/sql/postgresql/static-page-pb.sql 17 May 2003 12:25:00 -0000 1.3
@@ -14,7 +14,7 @@
varchar, -- title in cr_revisions.title%TYPE default null,
text, -- content in cr_revisions.content%TYPE default null,
boolean, -- show_comments_p in static_pages.show_comments_p%TYPE default 't',
- timestamp, -- creation_date in acs_objects.creation_date%TYPE
+ timestamptz, -- creation_date in acs_objects.creation_date%TYPE
-- default sysdate,
integer, -- creation_user in acs_objects.creation_user%TYPE
-- default null,
@@ -256,7 +256,7 @@
varchar, -- label in cr_folders.label%TYPE,
text, -- description in cr_folders.description%TYPE default null,
integer, -- parent_id in cr_items.parent_id%TYPE default null,
- timestamp, -- creation_date in acs_objects.creation_date%TYPE
+ timestamptz, -- creation_date in acs_objects.creation_date%TYPE
-- default sysdate,
integer, -- creation_user in acs_objects.creation_user%TYPE
-- default null,
Index: openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql,v
diff -u -N -r1.18 -r1.19
--- openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql 16 Jan 2003 14:01:59 -0000 1.18
+++ openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql 17 May 2003 12:26:29 -0000 1.19
@@ -42,7 +42,7 @@
update cr_revisions set content = :sp_filename
- where revision_id = content_item__get_live_revisions(:static_page_id)
+ where revision_id = content_item__get_live_revision(:static_page_id)
@@ -71,7 +71,8 @@
update cr_revisions set content = :sp_filename
- where revision_id = content_item__get_live_revisions(:static_page_id)
+ where revision_id = content_item__get_live_revision(:static_page_id)
+
Index: openacs-4/packages/static-pages/tcl/static-pages-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs.tcl,v
diff -u -N -r1.12 -r1.13
--- openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 16 Jan 2003 14:01:59 -0000 1.12
+++ openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 17 May 2003 12:26:29 -0000 1.13
@@ -4,7 +4,7 @@
@author Brandoch Calef (bcalef@arsdigita.com)
@creation-date 2001-01-22
- @cvs-id $Id$
+ @cvs-id static-pages-procs.tcl,v 1.11.2.13 2003/02/06 13:05:51 jeffd Exp
}
@@ -246,10 +246,7 @@
ns_mutex lock $mutex
- if { ![nsv_array exists $nsv] } {
- ns_mutex unlock $mutex
- error "nsv array '$nsv' does not exist!"
- } elseif { ![nsv_exists $nsv $package_id] } {
+ if { ![nsv_exists $nsv $package_id] } {
# The package_id isn't in the array yet at all, so another copy
# is not running.
set other_start_time {}
@@ -266,7 +263,6 @@
}
ns_mutex unlock $mutex
- ns_log Notice "atp: $proc_name: other_start_time: '$other_start_time'"
if { ! $run_p } {
# Another copy is running, must abort:
@@ -379,7 +375,6 @@
set mesg "$proc_name: Error reading file: '$file': [ns_quotehtml $errmsg]"
ns_log Error $mesg
if { ![empty_string_p $file_read_error_proc] } {
- ns_log Notice "$proc_name: about to run file_read_error_proc:"
uplevel $stack_depth [list $file_read_error_proc $file $static_page_id $mesg]
}
continue
@@ -434,6 +429,7 @@
}
} else {
# The file is NOT in the db yet at all:
+ set static_page_id {}
# Try to extract a title:
if { [catch {
@@ -450,7 +446,6 @@
set mesg "$proc_name: Error reading file: '$file': [ns_quotehtml $errmsg]"
ns_log Error $mesg
if { ![empty_string_p $file_read_error_proc] } {
- ns_log Notice "$proc_name: about to run file_read_error_proc:"
uplevel $stack_depth [list $file_read_error_proc $file $static_page_id $mesg]
}
continue
@@ -475,18 +470,34 @@
# calling static_page.new - thus the addition of mutex
# locking. --atp@piskorski.com, 2001/08/27 01:20 EDT
- set mime_type [sp_maybe_create_new_mime_type $sp_filename]
- set static_page_id [db_exec_plsql do_sp_new {}]
- # Check if -blobs [list $file_contents] would be faster:
- db_dml insert_file_contents {} -blob_files [list $file]
+ set mime_type [cr_filename_to_mime_type -create $sp_filename]
- if { [string length $file_add_proc] > 0 } {
- uplevel $stack_depth "$file_add_proc $file $static_page_id"
- }
- db_dml insert_file {
- insert into sp_extant_files (session_id,static_page_id)
- values (:sync_session_id,:static_page_id)
- }
+ if { [catch {
+ set static_page_id [db_exec_plsql do_sp_new {}]
+ } errmsg] } {
+ # Something failed:
+
+ set mesg "$proc_name: do_sp_new failed for file '$file' with error: [ns_quotehtml $errmsg]"
+ ns_log Error $mesg
+ if { ![empty_string_p $file_read_error_proc] } {
+ uplevel $stack_depth [list $file_read_error_proc $file $static_page_id $mesg]
+ }
+ continue
+
+ } else {
+ # Everything is ok:
+
+ # Check if -blobs [list $file_contents] would be faster:
+ db_dml insert_file_contents {} -blob_files [list $file]
+
+ if { [string length $file_add_proc] > 0 } {
+ uplevel $stack_depth "$file_add_proc $file $static_page_id"
+ }
+ db_dml insert_file {
+ insert into sp_extant_files (session_id,static_page_id)
+ values (:sync_session_id,:static_page_id)
+ }
+ }
}
}
}
@@ -684,73 +695,6 @@
}
-ad_proc sp_maybe_create_new_mime_type {
- file_name
-} {
- This proc should be identical to fs_maybe_create_new_mime_type
- from the file-storage package. However, we don't want to depend
- on file-storage being loaded, so if it isn't, define our own
- implementation here. --atp@piskorski.com, 2002/12/15 19:34 EST
-
-
- The content repository expects the MIME type to already be defined
- when you upload content. We use this procedure to add a new type
- when we encounter something we haven't seen before.
-
- @author Andrew Piskorski (atp@piskorski.com)
- @creation-date 2002-12-15
-} {
- set func {fs_maybe_create_new_mime_type}
-
- if { [nsv_exists api_proc_doc $func] ||
- ![empty_string_p [namespace eval :: [list info procs $func]]]
- } {
- # The file-storage version of this proc exists, use it:
- return [list $func $file_name]
-
- } else {
- # Fall back to local implementation:
-
- set file_extension [string trimleft [file extension $file_name] "."]
- if {[empty_string_p $file_extension]} {
- return "*/*"
- }
-
- # TODO: This insert may fail due to a race condition. Should be
- # locking the cr_mime_types table first:
- # --atp@piskorski.com, 2001/08/23 20:20 EDT
-
- if {![db_0or1row select_mime_type {
- select mime_type
- from cr_mime_types
- where file_extension = :file_extension
- }]} {
- # A mime type for this file extension does not exist
- # in the database. Check to see AOLServer can
- # generate a mime type.
-
- set mime_type [ns_guesstype $file_name]
-
- # Note: If AOLServer can't determine a mime type,
- # ns_guesstype will return */*. We still record
- # a mime type for this file extension. At a later
- # date, the mime type for the file extension may be
- # updated and, as a result, the files with that
- # file extension will be associated with the
- # proper mime types.
-
- db_dml new_mime_type {
- insert into cr_mime_types
- (mime_type, file_extension)
- values
- (:mime_type, :file_extension)
- }
- }
- return $mime_type
- }
-}
-
-
ad_proc -public sp_package_key_is {} {
Simply returns the package key string for this package.
@author Andrew Piskorski (atp@piskorski.com)
Index: openacs-4/packages/survey/survey.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/survey.info,v
diff -u -N -r1.7 -r1.8
--- openacs-4/packages/survey/survey.info 16 Jan 2003 14:03:37 -0000 1.7
+++ openacs-4/packages/survey/survey.info 17 May 2003 12:27:18 -0000 1.8
@@ -35,7 +35,9 @@
-
+
+
+
Index: openacs-4/packages/survey/sql/postgresql/survey-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/sql/postgresql/survey-create.sql,v
diff -u -N -r1.7 -r1.8
--- openacs-4/packages/survey/sql/postgresql/survey-create.sql 23 Feb 2003 18:23:26 -0000 1.7
+++ openacs-4/packages/survey/sql/postgresql/survey-create.sql 17 May 2003 12:29:17 -0000 1.8
@@ -272,7 +272,7 @@
clob_answer text,
number_answer numeric,
varchar_answer text,
- date_answer timestamp,
+ date_answer timestamptz,
attachment_answer integer
constraint survey_q_response_item_id_fk
references cr_revisions(revision_id)
Index: openacs-4/packages/survey/tcl/survey-notification-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/tcl/survey-notification-procs.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/survey/tcl/survey-notification-procs.tcl 17 May 2003 12:30:25 -0000 1.2
@@ -0,0 +1,26 @@
+ad_library {
+ Notification procs for Survey
+
+ Currently this is a place holder file. These procs are not currently needeed and have not been implemented.
+
+ At some point the notification procs in survey-procs should be moved into this file.
+
+ @creation-date 2002-10-29
+
+}
+
+namespace eval survey::notification {}
+
+ad_proc -public survey::notification::get_url {
+ object_id
+} {
+ set package_id [db_string get_package_id {}]
+ set package_url [site_node::get_url_from_object_id -object_id $package_id]
+ return "${package_url}admin/one?survey_id=$object_id"
+}
+
+ad_proc -public survey::notification::process_reply {
+ reply_id
+} {
+
+}
\ No newline at end of file
Index: openacs-4/packages/survey/tcl/survey-notification-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/tcl/survey-notification-procs.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/survey/tcl/survey-notification-procs.xql 17 May 2003 12:30:26 -0000 1.2
@@ -0,0 +1,10 @@
+
+
+
+
+
+ select package_id from surveys
+ where survey_id=:object_id
+
+
+
\ No newline at end of file
Index: openacs-4/packages/survey/tcl/survey-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/tcl/survey-procs-postgresql.xql,v
diff -u -N -r1.6 -r1.7
--- openacs-4/packages/survey/tcl/survey-procs-postgresql.xql 12 Mar 2003 01:05:25 -0000 1.6
+++ openacs-4/packages/survey/tcl/survey-procs-postgresql.xql 17 May 2003 12:30:26 -0000 1.7
@@ -28,6 +28,16 @@
+
+
+ select count(distinct survey_response__initial_user_id(response_id))
+ from
+ survey_responses
+ where survey_id=:survey_id
+
+
+
+
select r.initial_response_id, r.responding_user_id, r.response_id,
Index: openacs-4/packages/survey/www/admin/respondents.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/respondents.tcl,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/survey/www/admin/respondents.tcl 12 Mar 2003 01:05:52 -0000 1.4
+++ openacs-4/packages/survey/www/admin/respondents.tcl 17 May 2003 12:31:13 -0000 1.5
@@ -28,17 +28,10 @@
set context_bar [ad_context_bar [list "one?[export_url_vars survey_id]" $survey_info(name)] "[_ survey.Respondents]"]
set table_def {
-<<<<<<< respondents.tcl
{first_names "[_ survey.First_Name]" {upper(first_names) $order} {$first_names | }}
{last_name "[_ survey.Last_Name]" "" {$last_name | }}
{email "[_ survey.Email_Address]" "" {$email | }}
{actions "[_ survey.Actions]" no_sort { | }}
-=======
- {first_names "First Name" {upper(first_names) $order} {$first_names | }}
- {last_name "Last Name" "" {$last_name | }}
- {email "Email Address" "" {$email | }}
- {actions "Actions" no_sort { | }}
->>>>>>> 1.3
}
set respondents_table [ad_table -Torderby $orderby -Textra_vars {survey_id} -Tmissing_text "[_ survey.No_data_found]" select_respondents {} $table_def]
Index: openacs-4/packages/survey/www/admin/response-delete-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/response-delete-postgresql.xql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/survey/www/admin/response-delete-postgresql.xql 12 Mar 2003 01:05:52 -0000 1.4
+++ openacs-4/packages/survey/www/admin/response-delete-postgresql.xql 17 May 2003 12:31:13 -0000 1.5
@@ -5,13 +5,9 @@
-<<<<<<< response-delete-postgresql.xql
- select survey_response__remove(:response_id);
-=======
begin
perform survey_response__remove(:response_id);
end;
->>>>>>> 1.3
Index: openacs-4/packages/survey/www/admin/responses-export-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/responses-export-oracle.xql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/survey/www/admin/responses-export-oracle.xql 16 Jan 2003 14:04:53 -0000 1.3
+++ openacs-4/packages/survey/www/admin/responses-export-oracle.xql 17 May 2003 12:31:13 -0000 1.4
@@ -23,7 +23,7 @@
sq.first_names,
sq.last_name,
sq.user_id,
- sq.creation_date,
+ to_char(sq.creation_date,'YYYY-MM-DD HH24:MI:SS') as creation_date,
resp.boolean_answer,
resp.number_answer,
resp.date_answer,
Index: openacs-4/packages/survey/www/admin/responses-export-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/responses-export-postgresql.xql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/survey/www/admin/responses-export-postgresql.xql 16 Jan 2003 14:04:53 -0000 1.2
+++ openacs-4/packages/survey/www/admin/responses-export-postgresql.xql 17 May 2003 12:31:13 -0000 1.3
@@ -12,7 +12,7 @@
sq.first_names,
sq.last_name,
sq.user_id,
- sq.creation_date,
+ to_char(sq.creation_date,'YYYY-MM-DD HH24:MI:SS') as creation_date,
resp.boolean_answer,
resp.number_answer,
resp.date_answer,
Index: openacs-4/packages/survey/www/admin/responses-export.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/responses-export.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/survey/www/admin/responses-export.tcl 12 Mar 2003 01:05:52 -0000 1.5
+++ openacs-4/packages/survey/www/admin/responses-export.tcl 17 May 2003 12:31:13 -0000 1.6
@@ -124,9 +124,9 @@
incr r
if {$r>99} {
- ns_write "${csv_export} "
+ ns_write "${csv_export}"
set csv_export ""
- set rows 0
+ set r 0
}
}