Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit-oracle.xql 16 May 2001 00:43:15 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit-oracle.xql 30 Nov 2002 17:25:29 -0000 1.2 @@ -1,6 +1,6 @@ - postgresql7.1 + oracle8.1.6 Index: openacs-4/packages/acs-subsite/tcl/package-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/package-procs.xql 3 Aug 2001 21:09:20 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/package-procs.xql 30 Nov 2002 17:22:03 -0000 1.4 @@ -1,103 +1,111 @@ - - + + - select t.table_name as table, t.id_column as column - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name as table, t.id_column as column + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.package_name - from acs_object_types t - where t.object_type = :object_type - - - + select t.package_name + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name, t.id_column, lower(t.package_name) as package_name, t.supertype + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.package_name - from acs_object_types t - where t.object_type = :object_type - - - + select t.package_name + from acs_object_types t + where t.object_type = :object_type + + + - - - + + + - select t.table_name, t.id_column - from acs_object_types t - where t.object_type = :object_type - - - + select t.table_name, t.id_column + from acs_object_types t + where t.object_type = :object_type + + + - + + + select t.package_name + from acs_object_types t + where t.object_type = :object_type + + + + Index: openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs-postgres.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/plpgsql-utility-procs-postgres.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs-postgres.xql 30 Nov 2002 17:22:03 -0000 1.2 @@ -0,0 +1,24 @@ + + + + postgresql7.1 + + + + select arg_name, arg_default + from acs_function_args + where function = upper(:function_name) + order by arg_seq + + + + + + select data_type + from user_tab_columns + where table_name = upper(:table) + and column_name = upper(:column) + + + + Index: openacs-4/packages/acs-subsite/www/admin/relations/remove-dependants-exist.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/remove-dependants-exist.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/relations/remove-dependants-exist.adp 6 Sep 2002 21:50:04 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/relations/remove-dependants-exist.adp 30 Nov 2002 17:22:17 -0000 1.3 @@ -1,8 +1,8 @@ @context@ -Dependant relations exist +Dependent relations exist -You must remove the following dependant relations before you can +You must remove the following dependent relations before you can remove the @rel.rel_type_pretty_name@ between @rel.object_id_one_name@ and @rel.object_id_two_name@. Index: openacs-4/packages/acs-subsite/www/permissions/revoke-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/Attic/revoke-2-oracle.xql,v diff -u -N --- openacs-4/packages/acs-subsite/www/permissions/revoke-2-oracle.xql 30 Apr 2001 22:02:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ - - - - oracle8.1.6 - - - - - begin - acs_permission.revoke_permission(:object_id, :party_id, :privilege); - end; - - - - - - Index: openacs-4/packages/acs-subsite/www/permissions/revoke-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/Attic/revoke-2-postgresql.xql,v diff -u -N --- openacs-4/packages/acs-subsite/www/permissions/revoke-2-postgresql.xql 30 Apr 2001 22:02:48 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ - - - - postgresql7.1 - - - - - select acs_permission__revoke_permission(:object_id, :party_id, :privilege) - - - - - - Index: openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl 22 Apr 2001 16:13:15 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl 30 Nov 2002 17:22:35 -0000 1.3 @@ -11,18 +11,14 @@ { operation "" } } -ad_require_permission $object_id admin +permission::require_permission -object_id $object_id -privilege admin if { [string eq $operation "Yes"] } { db_transaction { foreach item $revoke_list { set party_id [lindex $item 0] set privilege [lindex $item 1] - db_exec_plsql revoke { - begin - acs_permission.revoke_permission(:object_id, :party_id, :privilege); - end; - } + permission::revoke -party_id $party_id -object_id $object_id -privilege $privilege } } } Index: openacs-4/packages/acs-subsite/www/pvt/home.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/Attic/home.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/pvt/home.xql 15 May 2001 16:59:01 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/pvt/home.xql 30 Nov 2002 17:22:53 -0000 1.3 @@ -5,7 +5,7 @@ select first_names, last_name, email, url, - coalesce(screen_name,'< none set up >') as screen_name + coalesce(screen_name,'< none set up >') as screen_name from cc_users where user_id=:user_id Index: openacs-4/packages/acs-subsite/www/shared/iso-codes-no-exist.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/iso-codes-no-exist.adp,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/shared/iso-codes-no-exist.adp 26 Sep 2002 03:46:54 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/shared/iso-codes-no-exist.adp 30 Nov 2002 17:23:29 -0000 1.5 @@ -5,6 +5,6 @@

ISO Codes not loaded


-

The iso codes were not loaded on this server. +

The ISO codes were not loaded on this server.

If you need this functionality, please load acs-reference and ref-countries. Index: openacs-4/packages/acs-subsite/www/shared/send-email.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/send-email.adp,v diff -u -N --- openacs-4/packages/acs-subsite/www/shared/send-email.adp 6 Sep 2002 21:50:11 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,7 +0,0 @@ - -Sent: @sent_subject@ - -@sent_message@ -

-You may return. - Index: openacs-4/packages/acs-subsite/www/shared/send-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/send-email.tcl,v diff -u -N --- openacs-4/packages/acs-subsite/www/shared/send-email.tcl 18 Sep 2002 12:16:50 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -ad_page_contract { - email sending page - - @author Hiro Iwashima - @creation-date 23 Aug 2000 - @cvs-id $Id: send-email.tcl,v 1.3 2002/09/18 12:16:50 jeffd Exp $ -} { - email - email_from - subject - message - return_url - {show_sent_message_p "f"} - {sent_title "Email sent"} - {sent_subject "Email sent"} - {sent_message "Email was successfully sent"} - {error_subject "Error sending email"} - {error_message "There was an error sending email:"} -} -properties { - sent_title:onevalue - sent_subject:onevalue - sent_message:onevalue - return_url:onevalue -} - -if [catch {ns_sendmail $email $email_from $subject $message} errmsg] { - ad_return_error $error_subject "$error_message: -

[ad_quotehtml $errmsg]
" - ad_script_abort -} - -if { $show_sent_message_p != "t" } { - # Do not show any message. Just go to return url - ad_returnredirect $return_url - ad_script_abort -} Index: openacs-4/packages/acs-subsite/www/shared/whos-online.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/whos-online.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/shared/whos-online.adp 6 Sep 2002 21:50:11 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/shared/whos-online.adp 30 Nov 2002 17:23:29 -0000 1.4 @@ -3,7 +3,7 @@ @context@ - This page is mostly useful in conjuction with + This page is mostly useful in conjunction with @chat_system_name@. Index: openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp 6 Sep 2002 21:50:14 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/user/portrait/comment-edit.adp 30 Nov 2002 17:23:44 -0000 1.4 @@ -4,7 +4,7 @@
@export_vars@ -Story Behing Photo:
+Story Behind Photo:
Index: openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql-postgresql.xql 30 Nov 2002 17:23:54 -0000 1.2 @@ -0,0 +1,21 @@ + + + postgresql7.1 + + + + select nextval(:sequence) as nextval + where (select relkind + from pg_class + where relname = :sequence) = 'S' + + + + + + select nextval + from ${sequence} + + + + Index: openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl,v diff -u -N -r1.35 -r1.36 --- openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 10 Sep 2002 22:22:14 -0000 1.35 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 30 Nov 2002 17:23:54 -0000 1.36 @@ -21,7 +21,7 @@ return $nextval } else { ns_log debug "db_nextval: sequence($sequence) is not a real sequence. perhaps it uses the view hack." - db_0or1row nextval_view "select ${sequence}.nextval as nextval" + db_0or1row nextval_view "select nextval from ${sequence}" return $nextval } } Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 23 Sep 2002 11:21:34 -0000 1.19 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 30 Nov 2002 17:23:55 -0000 1.20 @@ -520,6 +520,7 @@ set user_url [acs_community_member_url -user_id $user_id] } + @see template::multirow } { # Query Dispatcher (OpenACS - ben) set full_statement_name [db_qd_get_fullname $statement_name] Index: openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql 14 Sep 2002 16:29:30 -0000 1.9 +++ openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql 30 Nov 2002 17:23:55 -0000 1.10 @@ -122,6 +122,13 @@ + + + select apm_package__delete(:package_id); + + + + Index: openacs-4/packages/acs-tcl/tcl/apm-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/apm-procs.xql 27 Jul 2002 00:13:17 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.xql 30 Nov 2002 17:23:55 -0000 1.6 @@ -1,223 +1,184 @@ - - + + + select case when count(*) = 0 then 0 else 1 end from apm_package_versions + where version_id = :version_id + and enabled_p = 't' + + - select case when count(*) = 0 then 0 else 1 end from apm_package_versions - where version_id = :version_id - and enabled_p = 't' - - + + + select package_key + from apm_package_version_info + where version_id = :version_id + + + + + + select file_id, path + from apm_package_files + where version_id = :version_id + and file_type in ('tcl_procs', 'query_file') + and (db_type is null or db_type = '[db_type]') + order by path + + - - - select package_key from apm_package_version_info where version_id = :version_id - - + + + select package_key + from apm_package_version_info + where version_id = :version_id + + - - - - - select file_id, path - from apm_package_files - where version_id = :version_id - and file_type in ('tcl_procs', 'query_file') - and (db_type is null or db_type = '[db_type]') - order by path - - - + + + select package_key + from apm_package_version_info + where version_id = :version_id + + - - - - - select package_key - from apm_package_version_info - where version_id = :version_id - - - + + + select v.package_id, p.parameter_name, + case when v.value_id is null then p.default_value else v.attr_value end as attr_value + from apm_parameters p left outer join apm_parameter_values v + using (parameter_id) + where p.package_key = :package_key + + - - - - select v.package_id, p.parameter_name, - case when v.value_id is null then p.default_value else v.attr_value end as attr_value - from apm_parameters p left outer join apm_parameter_values v - using (parameter_id) - where p.package_key = :package_key - - - - - - - - select distinct package_key - from apm_package_versions - where enabled_p='t' - - - - - - - - - select distinct package_key - from apm_package_versions - where enabled_p='t' - - - - - - - - + + select distinct package_key - from apm_package_versions - where enabled_p='t' - - + from apm_package_versions + where enabled_p='t' + + + + + + select distinct package_key + from apm_package_versions + where enabled_p='t' + + + + + + select distinct package_key + from apm_package_versions + where enabled_p='t' + + + + + + select pretty_name + from apm_package_file_types + where file_type_key = :type + + - - - - - select pretty_name - from apm_package_file_types - where file_type_key = :type - - - + + + select pretty_db_name + from apm_package_db_types + where db_type_key = :db_type + + - - - - - select pretty_db_name - from apm_package_db_types - where db_type_key = :db_type - - - - - - - - - select parameter_name from apm_parameters - where package_key = :package_key - - - - - - - - - select 1 from apm_package_types - where package_key = :package_key - - - - - - - - - select 1 from apm_package_versions - where package_key = :package_key - and installed_p = 't' - - - - - - - - - select 1 from apm_package_versions - where version_id = :version_id - and installed_p = 't' - - - - - - - - - update apm_parameters - set parameter_name = :parameter_name, - default_value = :default_value, - datatype = :datatype, - description = :description, - section_name = :section_name, - min_n_values = :min_n_values, - max_n_values = :max_n_values + + + select parameter_name from apm_parameters + where package_key = :package_key + + + + + + select 1 from apm_package_types + where package_key = :package_key + + + + + + select 1 from apm_package_versions + where package_key = :package_key + and installed_p = 't' + + + + + + select 1 from apm_package_versions + where version_id = :version_id + and installed_p = 't' + + + + + + update apm_parameters + set parameter_name = :parameter_name, + default_value = :default_value, + datatype = :datatype, + description = :description, + section_name = :section_name, + min_n_values = :min_n_values, + max_n_values = :max_n_values where parameter_id = :parameter_id - - - - - - - - - select package_id, parameter_id, parameter_name - from apm_packages p, apm_parameters ap - where p.package_key = ap.package_key - and ap.parameter_id = :parameter_id - - - - - + + - - - - select package_key from apm_packages where package_id = :package_id - - - - - - - - - select package_id from apm_packages where package_key = :package_key - - - - - - - - - select pretty_name, version_name, package_key, installed_p, distribution_uri, tagged_p - from apm_package_version_info where version_id = :version_id - - - - - - - - - select parameter_name, attr_value - from apm_parameters p, apm_parameter_values v, apm_packages a - where p.parameter_id = v.parameter_id - and a.package_id = v.package_id - and a.package_id = :package_id - - - - - + + + select package_id, parameter_id, parameter_name + from apm_packages p, apm_parameters ap + where p.package_key = ap.package_key + and ap.parameter_id = :parameter_id + + + + + + select package_key + from apm_packages + where package_id = :package_id + + + + + + select package_id + from apm_packages + where package_key = :package_key + + + + + + select pretty_name, version_name, package_key, installed_p, distribution_uri, tagged_p + apm_package_version_info + where version_id = :version_id + + + + + + select parameter_name, attr_value + from apm_parameters p, apm_parameter_values v, apm_packages a + where p.parameter_id = v.parameter_id + and a.package_id = v.package_id + and a.package_id = :package_id + + + Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 18 Nov 2002 18:02:06 -0000 1.21 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 30 Nov 2002 17:23:55 -0000 1.22 @@ -423,11 +423,22 @@ @param title Title to be used for the error (will be shown to user) @param explanation Explanation for the exception. } { - doc_return $status text/html "[ad_header_with_extra_stuff $title "" ""] -

$title

-
-$explanation -[ad_footer]"; #"emacs + set page "[ad_header_with_extra_stuff $title "" ""] +

$title

\n
$explanation\n[ad_footer]" + + # JCD: IE 5 and 6 have a "friendly HTTP errors" setting which + # prevent display of short error return pages so here we pad them + # out to circumvent it. Unfortunately quite a few pages use + # ad_return_error with links to other pages (download for + # example among others + if {$status > 399 + && [string match {*; MSIE *} [ns_set iget [ad_conn headers] User-Agent]] + && [string length $page] < 512 } { + append page [string repeat " " [expr 513 - [string length $page]]] + } + + doc_return $status text/html $page + # raise abortion flag, e.g., for templating global request_aborted set request_aborted [list $status $title] Index: openacs-4/packages/acs-tcl/tcl/defs-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/defs-procs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/defs-procs.xql 24 Apr 2001 06:02:27 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.xql 30 Nov 2002 17:23:55 -0000 1.2 @@ -1,27 +1,31 @@ - - - - select first_names, last_name, email - from persons, parties - where person_id = :user_id - and person_id = party_id - - - + + + select first_names, last_name, email + from persons, parties + where person_id = :user_id + and person_id = party_id + + - - - - - select v.package_id, p.parameter_name, v.attr_value - from apm_parameters p, apm_parameter_values v - where p.parameter_id = v.parameter_id - - - + + + select apm_parameter_values.attr_value + from apm_parameters, apm_parameter_values + where apm_parameter_values.package_id = :package_id + and apm_parameter_values.parameter_id = apm_parameters.parameter_id + and apm_parameters.parameter_name = :parameter_name + + - + + + select v.package_id, p.parameter_name, v.attr_value + from apm_parameters p, apm_parameter_values v + where p.parameter_id = v.parameter_id + + + Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 9 Oct 2002 13:34:33 -0000 1.17 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 30 Nov 2002 17:23:55 -0000 1.18 @@ -522,7 +522,9 @@ foreach value $export { set name [lindex $value 0] if { [llength $value] == 1 } { - template::element create $form_name $name -datatype text -widget hidden -value [uplevel [list set $name]] + if { [uplevel [list info exists $name]] } { + template::element create $form_name $name -datatype text -widget hidden -value [uplevel [list set $name]] + } } else { template::element create $form_name $name -datatype text -widget hidden -value [uplevel [list subst [lindex $value 1]]] } @@ -581,10 +583,11 @@ return -code error "element $element_name: \"$flag\" attribute must have a parameter" } set name af_$flag - append name "($element_name)" + append name "(${form_name}__$element_name)" if { [info exists $name] } { return -code error "element $element_name: \"$flag\" appears twice" } + global $name set $name $af_element_parameters($element_name:$flag) } @@ -639,10 +642,6 @@ # Check that any acquire and get_property attributes are supported by their element's datatype # These are needed at submission and fill-the-form-with-db-values time - global af_from_sql - global af_to_sql - global af_to_html - foreach element_name $af_element_names($form_name) { if { [llength $element_name] == 1 } { if { [info exists af_from_sql(${form_name}__$element_name)] } { @@ -740,6 +739,10 @@ return -code error "Couldn't get the next value from sequence \"$af_sequence_name($form_name)\"" } set values(__new_p) 1 + + if { [info exists new_request] } { + ad_page_contract_eval uplevel #$level $new_request + } } set values(__key_signature) [ad_sign "$values($key_name):$form_name"] @@ -910,37 +913,34 @@ foreach arg $args { if { [llength $arg] == 1 } { upvar $arg value - ad_set_element_value -element $arg $value + ad_set_element_value -element $arg -- $value } else { - ad_set_element_value -element [lindex $arg 0] [lindex $arg 1] + ad_set_element_value -element [lindex $arg 0] -- [lindex $arg 1] } } } ad_proc -public ad_form_new_p { - -key + -key:required } { This is for pages built with ad_form that handle edit and add requests in one file. - It determines wether the current request is for editing an existing item, - in which case it returns 0, or adding a new one, which will return 1. + It returns 1 if the current form being built for the entry of new data, 0 if for + the editing of existing data.

- For this to work there needs to be an element defined in the form that is of - the ad_form pseudo datatype "key". If you don't specify -key then this proc - will try to guess it from the existing variables - if there is exactly one that - ends on _id then it takes that one, otherwise you have to specify it manually. + It does not make sense to use this in pages that don't use ad_form.

- It does not make sense to use this in pages that don't use ad_form. + @param key The database key for the form, which must be declared to be of type "key"

Example usage:

-    if { [ad_form_new_p] } {
+    if { [ad_form_new_p -key item_id] } {
         ad_require_permission $package_id create
         set page_title "New Item"
     } else {
@@ -954,43 +954,7 @@
 } {
 
     set form [ns_getform]
-    if { [empty_string_p $form] } {
-        # no form. assume new
-        return 1
-    }
     
-    if { ![info exists key] } {
-        # no key name given. loop through form and try to guess one
+    return [expr {[empty_string_p $form] || [ns_set find $form $key] == -1 || [ns_set get $form __new_p] == 1 }]
 
-        for { set i 0 } { $i < [ns_set size $form] } { incr i } {
-            
-            if { [regexp {_id$} [ns_set key $form $i]] } {
-                # this could be a key
-                
-                if { [info exists key] } {
-                    # we found one before already, bad. throw an error
-                    unset key
-                    break
-                }
-                set key [ns_set key $form $i]
-            }
-        }
-        if { ![info exists key] } {
-            ad_return_error "ad_form_new_p failed" "Could not guess key element. Please specify it by using \"ad_form_new_p -key your_key_id\"."
-            ad_script_abort
-        }
-    }
-
-    if { [ns_set find $form $key] == -1 } {
-        # no key
-        return 1
-    }
-
-    if { [ns_set get $form __new_p] == 1 } {
-        # there is a key, but __new_p is also set
-        return 1
-    }
-    
-    # not new
-    return 0
 }
Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v
diff -u -N -r1.8 -r1.9
--- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl	11 Nov 2002 17:51:54 -0000	1.8
+++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl	30 Nov 2002 17:23:55 -0000	1.9
@@ -133,6 +133,7 @@
 
     @see ad_context_bar
 } {
+
     if { [llength $args] > 0 } { 
         set choices [list [list [ad_pvt_home] [ad_pvt_home_name]] \
                          [list /acs-admin/ "ACS System Wide Administration"]]
Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v
diff -u -N -r1.27 -r1.28
--- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl	10 Oct 2002 17:07:43 -0000	1.27
+++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl	30 Nov 2002 17:23:55 -0000	1.28
@@ -30,6 +30,10 @@
 
     Parameters will stay the same as in the initial request.
 
+    Keep in mind that if you do an internal redirect to something other than
+    the current directory that relative links returned to the clients
+    browser may be broken (since the client will have the original URL).
+
     @param absolute_path If set the path is an absolute path within the host filesystem
     @param path path to the file to serve
 
@@ -108,11 +112,15 @@
     when you do an rp_internal_redirect to a new page, and you want to
     feed that page with certain query variables.
 
+    Note that the variable will just be appended to the form ns_set
+    which may not be what you want, if it exists already you will
+    now have two entries in the ns_set which may cause ad_page_contract to
+    break.  Also, only simple variables may be added, not arrays.
+
     @author Lars Pind (lars@pinds.com)
     @creation-date August 20, 2002
 
-    @return the form ns_set, in case you're interested. Mostly you'll
-    probably want to discard the result.
+    @return the form ns_set, in case you're interested. Mostly you will want to discard the result.
 
  } {
     set form [rp_getform]
@@ -706,15 +714,21 @@
 ad_proc -private rp_path_prefixes {path} {
   Returns all the prefixes of a path ordered from most to least specific.
 } {
-  set path [string trimright $path /]
   if {[string index $path 0] != "/"} {
     set path "/$path"
   }
+  set path [string trimright $path /]
+  if { [string length $path] == 0 } {
+    return "/"
+  }
+
   set components [split $path "/"]
   set prefixes [list]
-  for {set i [expr [llength $components] -1]} {$i >= 0} {incr i -1} {
+  for {set i [expr [llength $components] -1]} {$i > 0} {incr i -1} {
     lappend prefixes "[join [lrange $components 0 $i] "/"]/"
+    lappend prefixes "[join [lrange $components 0 $i] "/"]"
   }
+  lappend prefixes "/"
 
   return $prefixes
 }
Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v
diff -u -N -r1.9 -r1.10
--- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl	15 Sep 2002 22:10:50 -0000	1.9
+++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl	30 Nov 2002 17:23:55 -0000	1.10
@@ -46,17 +46,23 @@
 	regsub -nocase -all {([^a-zA-Z0-9]+)(ftp://[^\(\)"<>\s]+)} $text "\\1\tsTaRtUrL\\2eNdUrL\t" text
 	
 	# email links have the form xxx@xxx.xxx
-	regsub -nocase -all {([^a-zA-Z0-9]+)([^\(\)\s:;,@<>]+@[^\(\)\s.:;,@<>]+[.][^\(\)\s:;,@<>]+)} $text \
-		"\\1\tsTaRtEmAiL\\2eNdEmAiL\t" text
+        # JCD: don't treat things =xxx@xxx.xxx as email since most
+        # common occurance seems to be in urls (although VPATH bounce
+        # emails like bounce-user=domain.com@sourcehost.com will then not
+        # work correctly).  It's all quite ugly.
+ 
+        regsub -nocase -all {([^a-zA-Z0-9=]+)(mailto:)?([^=\(\)\s:;,@<>]+@[^\(\)\s.:;,@<>]+[.][^\(\)\s:;,@<>]+)} $text \
+                "\\1\tsTaRtEmAiL\\3eNdEmAiL\t" text
 
+
     }    
 
     # At this point, before inserting some of our own <, >, and "'s
     # we quote the ones entered by the user:
     set text [ad_quotehtml $text]
 
     # Convert _single_ CRLF's to 
's to preserve line breaks - regsub -all {\r*\n} $text "
" text + regsub -all {\r*\n} $text "
\n" text # Convert every two spaces to an nbsp regsub -all { } $text "\\\  " text @@ -82,6 +88,11 @@ # Convert every tab to 4 nbsp's regsub -all {\t} $text {\ \ \ \ } text + # JCD: Remove all the eNd sTaRt stuff and warn if we do it since its bad + # to have these left (means something is broken in our regexps above) + if {[regsub -all {(sTaRtUrL|eNdUrL|sTaRtEmAiL|eNdEmAiL)} $text {} text]} { + ns_log warning "Replaced sTaRt/eNd magic tags in ad_text_to_html" + } return $text } @@ -824,7 +835,7 @@ if { [llength $img_info] == 0 } { ad_html_to_text_put_text output {[IMAGE]} } else { - ad_html_to_text_put_text output "\[IMAGE: [join $img_info " "]\]" + ad_html_to_text_put_text output "\[IMAGE: [join $img_info " "] \]" } } } @@ -907,8 +918,8 @@ } } else { # we're in a PRE: clean line breaks and tabs - regsub -all {\r\n} $text {\n} text - regsub -all {\r} $text {\n} text + regsub -all {\r\n} $text "\n" text + regsub -all {\r} $text "\n" text # tabs become four spaces regsub -all {[\v\t]} $text { } text } @@ -998,7 +1009,7 @@ } { regsub -all {<} $html {<} html regsub -all {>} $html {>} html - regsub -all {"} $html {"} html + regsub -all {"} $html "\"" html regsub -all {—} $html {--} html regsub -all {—} $html {--} html # Need to do the & last, because otherwise it could interfere with the other expansions, Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 12 Nov 2002 18:09:28 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 30 Nov 2002 17:23:55 -0000 1.21 @@ -2772,6 +2772,22 @@ } } +ad_proc -public min { args } { + Returns the minimum of a list of numbers. Example: min 2 3 1.5 returns 1.5. + + @author Ken Mayer (kmayer@bitwrangler.com) + @creation-date 26 September 2002 +} { + set min [lindex $args 0] + foreach arg $args { + if { $arg < $min } { + set min $arg + } + } + return $min +} + + ad_proc -public max { args } { Returns the maximum of a list of numbers. Example: max 2 3 1.5 returns 3. Index: openacs-4/packages/acs-templating/resources/forms/standard-lars.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/Attic/standard-lars.adp,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-templating/resources/forms/standard-lars.adp 18 Nov 2002 18:01:06 -0000 1.6 +++ openacs-4/packages/acs-templating/resources/forms/standard-lars.adp 30 Nov 2002 17:24:05 -0000 1.7 @@ -36,7 +36,7 @@ - > + @@ -104,7 +104,7 @@ - Index: openacs-4/packages/acs-templating/tcl/paginator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/paginator-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 24 Sep 2002 09:06:04 -0000 1.9 +++ openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 30 Nov 2002 17:24:15 -0000 1.10 @@ -24,9 +24,11 @@ @see template::paginator::get_page @see template::paginator::get_page_count @see template::paginator::get_pages + @see template::paginator::get_pages_info @see template::paginator::get_row @see template::paginator::get_row_count @see template::paginator::get_row_ids + @see template::paginator::get_row_last } { eval paginator::$command $args } @@ -48,13 +50,21 @@ @option pagesize The number of rows to display on a single page. - @option groupsize The number of pages in a group, for UI purposes. + @option groupsize The number of pages in a group, for UI purposes. This + is useful for result sets which span several pages. For + example, if you have 1000 results at 10 results per page, + that will leave you with 100 pages and you may not want + to display 1-100 in the UI. In this case, setting a + groupsize of 10 will allow you to display pages 1-10, then + 11-20, and so on. The default groupsize is 10. @option contextual Boolean indicating whether the pagination interface presented to the user will provide some other contextual clue in addition or instead of - page number,, such as the first few - letters of a title or date. + page number, such as the first few + letters of a title or date. By default, the second + column in the result set returned by query will be used + as the context. } { set level [template::adp_level] variable parse_level @@ -126,7 +136,7 @@ } else { # no extra column specified for paging by contextual cues - uplevel 3 "set __paginator_ids [db_list $statement_name \"$query\"]" + uplevel 3 "set __paginator_ids \[db_list $statement_name \"$query\"\]" set properties(row_ids) $ids cache set $name:$query:row_ids $ids $properties(timeout) @@ -168,6 +178,29 @@ return [expr ($pagenum - 1) * $properties(pagesize) + 1] } +ad_proc -public template::paginator::get_row_last { name pagenum } { + Calculates the last row displayed on a page. + + @param name The reference to the paginator object. + @param pagenum A number ranging from one to the number of pages in + the query result, representing the number of a page + therein. + + @return A number ranging from one to the number of rows in + the query result, representing the number of the last + row on the specified page. +} { + get_reference + + set page_count $properties(page_count) + + if {$page_count == $pagenum} { + return $properties(row_count) + } else { + return [expr $pagenum * $properties(pagesize)] + } +} + ad_proc -public template::paginator::get_group { name pagenum } { Calculates the page group in which the specified page is located. @@ -235,7 +268,7 @@ set start [expr ($group - 1) * $group_size + 1] set end [expr $start + $group_size] - if { $end > $page_count } { set end $page_count) } + if { $end > $page_count } { set end $page_count } set pages [list] @@ -322,6 +355,37 @@ } } +# DEDS: we can get away without this, but i'm throwing it in anyway +# as it makes life easier for non-contextual pagination +ad_proc -public template::paginator::get_pages_info { name datasource pages } { + Gets the page information for a set of pages in the form of a multirow + data source with 2 columns: rownum (starting with 1); and page (number + of the page). This is a counterpart for get_context when using page + objects that are non-contextual. Using this makes it easier to switch + from contextual to non-contextual so that less modification is needed + on adp template pages. Think in terms of taking out the display of + one element in a multirow datasource as compared to converting an adp + to handle a list datasource instead of a multirow datasource. + + @param name The reference to the paginator object. + @param datasource The name of the multirow datasource to create + @param pages A Tcl list of page numbers. +} { + get_reference + + upvar 2 $datasource:rowcount rowcount + set rowcount 0 + + foreach page $pages { + + incr rowcount + upvar 2 $datasource:$rowcount row + + set row(rownum) $rowcount + set row(page) $page + } +} + ad_proc -public template::paginator::get_row_count { name } { Gets the total number of records in the paginated query @@ -343,7 +407,7 @@ } { get_reference - return $properties(row_count) + return $properties(page_count) } ad_proc -public template::paginator::get_group_count { name } { @@ -442,9 +506,16 @@ # substitute the current page set set query [uplevel 2 "db_map ${statement_name}_partial"] - set in_list [join $ids ","] + + # DEDS: quote the ids so that we are not + # necessarily limited to integer keys + set quoted_ids [list] + foreach one_id $ids { + lappend quoted_ids "'[DoubleApos $one_id]'" + } + set in_list [join $quoted_ids ","] if { ! [regsub CURRENT_PAGE_SET $query $in_list query] } { - error "Token CURRENT_PAGE_SET not found in page data query: $query" + error "Token CURRENT_PAGE_SET not found in page data query ${statement_name}_partial: $query" } if { [llength $in_list] == 0 } { Index: openacs-4/packages/acs-templating/tcl/query-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/query-procs.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-templating/tcl/query-procs.tcl 24 Sep 2002 09:06:04 -0000 1.11 +++ openacs-4/packages/acs-templating/tcl/query-procs.tcl 30 Nov 2002 17:24:15 -0000 1.12 @@ -200,6 +200,9 @@ @param result_name Tcl variable name to use when setting the result @param sql Query to use when processing this command + + @see db_multirow + @see template::multirow } { upvar opts opts @@ -636,19 +639,15 @@
upvar the multirow, aliasing to new_name if provided
- @param local - If set, the multirow will be looked for in the scope the number + @param local If set, the multirow will be looked for in the scope the number of levels up given by ulevel (normally the caller's scope), instead of the [template::adp_level] scope, which is the default. - @param ulevel - Used in conjunction with the "local" parameter to specify how + @param ulevel Used in conjunction with the "local" parameter to specify how many levels up the multirow variable resides. - @param command - Multirow datasource operation: create, extend, append, - size, get, set, foreach + @param command Multirow datasource operation: create, extend, append, size, get, set, foreach, upvar @param name Name of the multirow datasource Index: openacs-4/packages/acs-templating/www/doc/migration.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/migration.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/migration.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/migration.html 30 Nov 2002 17:24:27 -0000 1.2 @@ -438,15 +438,15 @@ @@ -89,7 +89,7 @@
templating@arsdigita.com -Last modified: Wed Nov 15 18:21:30 EST 2000 +Last modified: Sun Oct 6 02:38:25 EDT 2002 Index: openacs-4/packages/acs-templating/www/doc/guide/form-process.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/guide/form-process.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/guide/form-process.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/guide/form-process.html 30 Nov 2002 17:24:57 -0000 1.2 @@ -7,6 +7,15 @@ Templating System : User Guide
+

+Important Note: The +ad_form +function has been written to be a more consistent, easier way to create and +manage dynamic forms. Behind the scenes it uses the templating system's form +builder, but it hides much of its complexity. You should definitely look at +it and at the pages that use it in the survey package. +

+

The templating system provides a simple infrastructure for validating form submissions. The typical life-cycle of a form is as follows:

Index: openacs-4/packages/acs-templating/www/doc/guide/forms.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/guide/forms.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/guide/forms.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/guide/forms.html 30 Nov 2002 17:24:57 -0000 1.2 @@ -11,6 +11,15 @@

This document outlines the steps necessary to build a dynamic form in Tcl code.

+

+Important Note: The +ad_form +function has been written to be a more consistent, easier way to create and +manage dynamic forms. Behind the scenes it uses the templating system's form +builder, but it hides much of its complexity. You should definitely look at +it and at the pages that use it in the survey package. +

+

Create a form

Use the form create command to initialize a form:

Index: openacs-4/packages/acs-templating/www/doc/tagref/include.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/tagref/include.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/tagref/include.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/tagref/include.html 30 Nov 2002 17:25:12 -0000 1.2 @@ -17,6 +17,7 @@ as any other dynamic template; the developer may associate data sources and other properties to them.

+

Usage

<include src="subtemplate.adp" attribute=value ...>
@@ -44,7 +45,28 @@ included page has the same name (&users="users"), you can use the shorthand &="users". + +
  • + It is important to note that variables passed through include + become available to the .tcl and .adp files being include'd, but it + does not make them settable through ad_page_contract. +

    + So if you'd like to have a template that will return a fragment of a + page that you'd like to include in other pages, make sure its .tcl + component does not call ad_page_contract. +

    + +

    + If you'd like to include a full page (that is, one which calls + ad_page_contract) then instead of passing a parameter through + <include>, you could use + rp_form_put + to add the variable to that page's form. For additional + references, see how message-chunk is used throughout the forums package. +

    +
  • +
  • If the src attribute begins with a slash, the path is assumed to be relative to the server root, the parent directory of @@ -60,6 +82,5 @@
    - templating@arsdigita.com Index: openacs-4/packages/address-book/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/index-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/address-book/www/index-oracle.xql 1 Sep 2001 20:34:19 -0000 1.2 +++ openacs-4/packages/address-book/www/index-oracle.xql 30 Nov 2002 17:25:46 -0000 1.3 @@ -12,15 +12,15 @@ select contact_id, - nvl(last_name,'
    ') as last_name, - nvl(first_names,'
    ') as first_names, - nvl(title,'
    ') as title, - nvl(organization,'
    ') as organization, - nvl(work_phone,'
    ') as work_phone, - nvl(home_phone,'
    ') as home_phone, - nvl(fax,'
    ') as fax, - nvl(other,'
    ') as other, - nvl(email,'
    ') as email, + nvl(last_name,'
    ') as last_name, + nvl(first_names,'
    ') as first_names, + nvl(title,'
    ') as title, + nvl(organization,'
    ') as organization, + nvl(work_phone,'
    ') as work_phone, + nvl(home_phone,'
    ') as home_phone, + nvl(fax,'
    ') as fax, + nvl(other,'
    ') as other, + nvl(email,'
    ') as email, acs_permission.permission_p(acr.rel_id,:user_id,'delete') as delete_p, acr.rel_id from ab_contacts_related acr Index: openacs-4/packages/address-book/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/index-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/address-book/www/index-postgresql.xql 1 Sep 2001 20:34:19 -0000 1.3 +++ openacs-4/packages/address-book/www/index-postgresql.xql 30 Nov 2002 17:25:46 -0000 1.4 @@ -12,15 +12,15 @@ select contact_id, - coalesce(last_name,'
    ') as last_name, - coalesce(first_names,'
    ') as first_names, - coalesce(title,'
    ') as title, - coalesce(organization,'
    ') as organization, - coalesce(work_phone,'
    ') as work_phone, - coalesce(home_phone,'
    ') as home_phone, - coalesce(fax,'
    ') as fax, - coalesce(other,'
    ') as other, - coalesce(email,'
    ') as email, + coalesce(last_name,'
    ') as last_name, + coalesce(first_names,'
    ') as first_names, + coalesce(title,'
    ') as title, + coalesce(organization,'
    ') as organization, + coalesce(work_phone,'
    ') as work_phone, + coalesce(home_phone,'
    ') as home_phone, + coalesce(fax,'
    ') as fax, + coalesce(other,'
    ') as other, + coalesce(email,'
    ') as email, acs_permission__permission_p(acr.rel_id,:user_id,'delete') as delete_p, acr.rel_id from ab_contacts_related acr Index: openacs-4/packages/attachments/www/attach.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/attach.adp,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/attachments/www/attach.adp 7 Nov 2002 15:11:50 -0000 1.5 +++ openacs-4/packages/attachments/www/attach.adp 30 Nov 2002 17:26:03 -0000 1.6 @@ -29,10 +29,10 @@ -
  • + - + Index: openacs-4/packages/authorize-gateway/www/doc/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/authorize-gateway/www/doc/index.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/authorize-gateway/www/doc/index.adp 12 Sep 2002 19:06:59 -0000 1.2 +++ openacs-4/packages/authorize-gateway/www/doc/index.adp 30 Nov 2002 17:26:16 -0000 1.3 @@ -127,7 +127,7 @@ with Authorize.net originates from. This URL be listed as a valid ADC URL in the list of accepted referers in the ADC settings. Do not leave this secret blank, it - ensures the requests received by Authorize.net are comming + ensures the requests received by Authorize.net are coming from the @package_name@ and not some spoof.

    Index: openacs-4/packages/bookmarks/bookmarks.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/bookmarks.info,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/bookmarks/bookmarks.info 13 Sep 2001 20:27:19 -0000 1.21 +++ openacs-4/packages/bookmarks/bookmarks.info 30 Nov 2002 17:26:26 -0000 1.22 @@ -1,43 +1,43 @@ - + Bookmarks Bookmarks Modules f f - + oracle postgresql Peter Marklund This module lets you manage your bookmarks on the web and enables sharing of bookmarks between people in a community (one ACS installation). - 2001-02-23 + 2002-10-27 ArsDigita Corporation - This version contains a number of bugfixes and minor improvements over the 4.X alpha versions and has been rigorously tested. - -New features in the ACS4 (not in the ACS4 version) include: - -- Adding bookmarks when browsing with the help of a Bookmarklet (a Bookmark in the browser that contains Javascript instead of a url). - -- Sorting by name and access date - -- Enhanced access permissions. The alpha version will only include toggling between private and public. Future versions could use the ACS permission API to grant read, write, delete and admin rights to any party on a bookmark level. It is not yet clear how big the need for this granular access permissions is. - -- Display of keywords and descriptions of urls (fetched with ns_httpget) - -Important features from the ACS3 version are: - -- Bookmarks are viewed in a tree structure with open/collapse functionality of folders. Alternatively the bookmarks can be viewed in a Javascript version. - -- Importing/exporting bookmarks from/to Netscape and IE browsers - -- Checking if URLs are alive - -- Display of the most popular hosts and urls in the community - + This version contains a number of bugfixes and minor improvements over the 4.X alpha versions and has been rigorously tested. + +New features in the ACS4 (not in the ACS4 version) include: + +- Adding bookmarks when browsing with the help of a Bookmarklet (a Bookmark in the browser that contains Javascript instead of a url). + +- Sorting by name and access date + +- Enhanced access permissions. The alpha version will only include toggling between private and public. Future versions could use the ACS permission API to grant read, write, delete and admin rights to any party on a bookmark level. It is not yet clear how big the need for this granular access permissions is. + +- Display of keywords and descriptions of urls (fetched with ns_httpget) + +Important features from the ACS3 version are: + +- Bookmarks are viewed in a tree structure with open/collapse functionality of folders. Alternatively the bookmarks can be viewed in a Javascript version. + +- Importing/exporting bookmarks from/to Netscape and IE browsers + +- Checking if URLs are alive + +- Display of the most popular hosts and urls in the community + Areas that need improvement: The query on the index page is a bit slow - closing and opening folders becomes impractible with for example 200 bookmarks. Users who have this many bookmarks can preferably use the Javascript version. @@ -48,6 +48,7 @@ + @@ -60,8 +61,6 @@ - - @@ -179,10 +178,10 @@ - - - + + + Index: openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql 11 Jul 2002 16:15:39 -0000 1.19 +++ openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql 30 Nov 2002 17:26:36 -0000 1.20 @@ -191,7 +191,7 @@ end if; update bm_bookmarks - set tree_sortkey = tree_next_value(v_parent_sk, v_max_value) + set tree_sortkey = tree_next_key(v_parent_sk, v_max_value) where bookmark_id = v_rec.bookmark_id; end LOOP; Index: openacs-4/packages/bookmarks/sql/postgresql/upgrade/upgrade-4.1.1b-4.6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/sql/postgresql/upgrade/upgrade-4.1.1b-4.6.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/bookmarks/sql/postgresql/upgrade/upgrade-4.1.1b-4.6.sql 30 Nov 2002 17:26:45 -0000 1.2 @@ -0,0 +1,58 @@ +-- packages/bookmarks/sql/postgresql/upgrade/upgrade-4.1.1b-4.6.sql +-- +-- @author Vinod Kurup (vinod@kurup.com) +-- @creation_date 2002-10-08 +-- +-- $Id: upgrade-4.1.1b-4.6.sql,v 1.2 2002/11/30 17:26:45 jeffd Exp $ + +CREATE OR REPLACE FUNCTION bookmark__delete (integer) +RETURNS integer AS ' +DECLARE + p_bookmark_id ALIAS FOR $1; -- in bm_bookmarks.bookmark_id%TYPE, + c_bookmark_id_tree RECORD; + c_bookmark_id_one_level RECORD; +BEGIN + + FOR c_bookmark_id_tree IN + select bm.bookmark_id, + (select case when count(*)=0 then 1 else 0 end from + bm_bookmarks where parent_id = bm.bookmark_id) as is_leaf_p + from bm_bookmarks bm, bm_bookmarks bm2 + where bm2.bookmark_id = p_bookmark_id + and bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) + order by tree_level(bm.tree_sortkey) desc, is_leaf_p desc, bm.tree_sortkey + LOOP + + -- DRB: This query is insane in both its PG and Oracle versions but I do not + -- have time to improve it at the moment ... + + FOR c_bookmark_id_one_level IN + select bookmark_id + from bm_bookmarks bm_outer + where parent_id = + ( + select parent_id from bm_bookmarks where bookmark_id = c_bookmark_id_tree.bookmark_id + ) + and not exists + ( + select 1 from bm_bookmarks where parent_id = bm_outer.bookmark_id + ) + and bm_outer.bookmark_id in + ( + select bm.bookmark_id from bm_bookmarks bm, bm_bookmarks bm2 + where bm2.bookmark_id = p_bookmark_id + and bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) + order by bm.tree_sortkey + ) + LOOP + delete from acs_permissions where object_id = c_bookmark_id_one_level.bookmark_id; + delete from bm_in_closed_p where bookmark_id = c_bookmark_id_one_level.bookmark_id; + delete from bm_bookmarks where bookmark_id = c_bookmark_id_one_level.bookmark_id; + perform acs_object__delete(c_bookmark_id_one_level.bookmark_id); + END LOOP; + END LOOP; + RETURN 0; +END; +' LANGUAGE 'plpgsql'; + + Index: openacs-4/packages/bookmarks/www/bookmark-add-import.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-add-import.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/bookmarks/www/bookmark-add-import.adp 6 Sep 2002 21:50:22 -0000 1.2 +++ openacs-4/packages/bookmarks/www/bookmark-add-import.adp 30 Nov 2002 17:26:55 -0000 1.3 @@ -51,7 +51,7 @@ (in Internet Explorer it is called Favorite). In Netscape you may then preferably rename this Bookmark (for example to "Add Bookmark") and move it to your toolbar so that you have an -easily accessible button to press everytime you want to bookmark a page. +easily accessible button to press every time you want to bookmark a page.

    Import multiple bookmarks from Netscape or Microsoft Internet Explorer bookmark.htm file

    Index: openacs-4/packages/bookmarks/www/bookmark-permissions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-permissions.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/bookmarks/www/bookmark-permissions.tcl 10 Sep 2002 22:22:26 -0000 1.3 +++ openacs-4/packages/bookmarks/www/bookmark-permissions.tcl 30 Nov 2002 17:26:55 -0000 1.4 @@ -28,7 +28,7 @@ ad_require_permission $root_folder_id admin -set page_title "Manage Permisssions on all Bookmarks" +set page_title "Manage Permissions on all Bookmarks" set context [bm_context_bar_args "\"[ad_quotehtml $page_title]\"" $viewed_user_id] Index: openacs-4/packages/bookmarks/www/bookmarks-check-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmarks-check-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/bookmarks/www/bookmarks-check-oracle.xql 23 Jul 2001 03:01:40 -0000 1.1 +++ openacs-4/packages/bookmarks/www/bookmarks-check-oracle.xql 30 Nov 2002 17:26:55 -0000 1.2 @@ -6,7 +6,7 @@ - now() + sysdate Index: openacs-4/packages/bookmarks/www/bookmarks-check-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmarks-check-postgresql.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/bookmarks/www/bookmarks-check-postgresql.xql 8 Dec 2001 01:17:59 -0000 1.4 +++ openacs-4/packages/bookmarks/www/bookmarks-check-postgresql.xql 30 Nov 2002 17:26:55 -0000 1.5 @@ -16,6 +16,8 @@ where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) and bm2.parent_id = :root_folder_id ) bm on (bm.url_id=bm_urls.url_id) + where acs_permission__permission_p(bm.bookmark_id, :browsing_user_id, + 'delete')= 't' order by bm.tree_sortkey Index: openacs-4/packages/bug-tracker/bug-tracker.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/bug-tracker.info,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/bug-tracker/bug-tracker.info 23 Sep 2002 23:32:08 -0000 1.6 +++ openacs-4/packages/bug-tracker/bug-tracker.info 30 Nov 2002 17:27:05 -0000 1.7 @@ -9,7 +9,6 @@ - oracle postgresql Lars Pind Index: openacs-4/packages/bug-tracker/www/no-components.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/no-components.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/no-components.adp 3 May 2002 16:29:59 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/no-components.adp 30 Nov 2002 17:27:33 -0000 1.2 @@ -10,5 +10,5 @@ Please visit the project administration pages to define software components.
    - Please contact a project adminsitrator to get the components set up. + Please contact a project administrator to get the components set up. Index: openacs-4/packages/bug-tracker/www/patch.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/patch.adp 11 Sep 2002 14:03:25 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/patch.adp 30 Nov 2002 17:27:33 -0000 1.2 @@ -17,9 +17,14 @@

    - + +

    +Download patch content +

    +
    +

    +
     ad_page_contract {
    -    @cvs-id $ID$
    +    @cvs-id $Id$
     } {
     }	  
     	  
     ad_page_contract {
    -    @cvs-id $ID$
    +    @cvs-id $Id$
     } {
     } -properties {
         header:onevalue
    Index: openacs-4/packages/acs-templating/www/doc/exercise/form-sample.adp
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/exercise/form-sample.adp,v
    diff -u -N -r1.1 -r1.2
    --- openacs-4/packages/acs-templating/www/doc/exercise/form-sample.adp	13 Mar 2001 22:59:27 -0000	1.1
    +++ openacs-4/packages/acs-templating/www/doc/exercise/form-sample.adp	30 Nov 2002 17:24:40 -0000	1.2
    @@ -15,7 +15,7 @@
     	  
    Gender: @formgroup.label@ @formgroup.widget@ -
    Please include gender informatoin about your entry subject
    +
    Please include gender information about your entry subject
    Birthday:
    Address:
    @@ -28,13 +33,11 @@

    -

    Download patch content

    -
    Index: openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 23 Aug 2002 19:07:35 -0000 1.5 +++ openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 30 Nov 2002 17:27:51 -0000 1.6 @@ -3,51 +3,6 @@ oracle8.1.6 - - - - begin - acs_permission.grant_permission ( - object_id => :cal_item_id, - grantee_id => :party_id, - privilege => 'cal_item_read' - ); - end; - - - - - - - - - begin - acs_permission.grant_permission ( - object_id => :cal_item_id, - grantee_id => :party_id, - privilege => :permission - ); - end; - - - - - - - - - begin - acs_permission.revoke_permission ( - object_id => :cal_item_id, - grantee_id => :party_id, - privilege => :permission - ); - end; - - - - - @@ -97,21 +52,6 @@ - - - - begin - acs_permission.grant_permission ( - object_id => :cal_item_id, - grantee_id => :grantee_id, - privilege => :privilege - ); - end; - - - - - Index: openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 21 Sep 2002 15:58:37 -0000 1.12 +++ openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 30 Nov 2002 17:27:51 -0000 1.13 @@ -3,42 +3,6 @@ postgresql7.1 - - - select acs_permission__grant_permission ( - :cal_item_id, - :party_id, - 'cal_item_read' - ) - - - - - - - - select acs_permission__grant_permission ( - :cal_item_id, - :party_id, - :permission - ) - - - - - - - - select acs_permission__revoke_permission ( - :cal_item_id, - :party_id, - :permission - ) - - - - - select acs_activity__new ( @@ -92,18 +56,6 @@ - - - select acs_permission__grant_permission ( - :cal_item_id, - :grantee_id, - :privilege - ) - - - - - select time_interval__edit ( Index: openacs-4/packages/calendar/tcl/cal-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 23 Aug 2002 19:07:35 -0000 1.10 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 30 Nov 2002 17:27:51 -0000 1.11 @@ -33,47 +33,21 @@ if { ![string equal $permission "cal_item_read"] } { # grant read permission first - - db_exec_plsql 1_grant_calendar_permissions_to_items { - begin - acs_permission.grant_permission ( - object_id => :cal_item_id, - grantee_id => :party_id, - privilege => 'cal_item_read' - ); - end; - } + permission::grant -object_id $cal_item_id -party_id $party_id -privilege cal_item_read } # grant other permission - db_exec_plsql 2_grant_calendar_permissions_to_items { - begin - acs_permission.grant_permission ( - object_id => :cal_item_id, - grantee_id => :party_id, - privilege => :permission - ); - end; - } + permission::grant -object_id $cal_item_id -party_id $party_id -privilege $permission } elseif { [string equal $revoke "revoke"] } { # revoke the permissions - db_exec_plsql 3_grant_calendar_permissions_to_items { - begin - acs_permission.revoke_permission ( - object_id => :cal_item_id, - grantee_id => :party_id, - privilege => :permission - ); - end; - } + permission::revoke -object_id $cal_item_id -party_id $party_id -privilege $permission - } } Index: openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql 24 Aug 2001 01:19:03 -0000 1.1 +++ openacs-4/packages/calendar/tcl/calendar-procs-oracle.xql 30 Nov 2002 17:27:51 -0000 1.2 @@ -32,36 +32,7 @@ - - - - begin - acs_permission.grant_permission ( - object_id => :calendar_id, - grantee_id => :party_id, - privilege => :cal_privilege - ); - end; - - - - - - - - begin - acs_permission.revoke_permission ( - object_id => :calendar_id, - grantee_id => :party_id, - privilege => :cal_privilege - ); - end; - - - - - Index: openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql 18 Sep 2001 07:02:41 -0000 1.4 +++ openacs-4/packages/calendar/tcl/calendar-procs-postgresql.xql 30 Nov 2002 17:27:51 -0000 1.5 @@ -32,28 +32,7 @@ - - - select acs_permission__grant_permission( - :calendar_id, - :party_id, - :cal_privilege - ); - - - - - - select acs_permission__revoke_permission ( - :calendar_id, - :party_id, - :cal_privilege - ); - - - - Index: openacs-4/packages/calendar/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 20 May 2002 17:33:21 -0000 1.10 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 30 Nov 2002 17:27:51 -0000 1.11 @@ -227,32 +227,14 @@ if { [empty_string_p $revoke] } { # grant the permissions - - db_exec_plsql assign_calendar_permissions { - begin - acs_permission.grant_permission ( - object_id => :calendar_id, - grantee_id => :party_id, - privilege => :cal_privilege - ); - end; - } - + permission::grant -object_id $calendar_id -party_id $party_id -privilege $cal_privilege + } elseif { [string equal $revoke "revoke"] } { # revoke the permissions + permission::revoke -object_id $calendar_id -party_id $party_id -privilege $cal_privilege - db_exec_plsql revoke_calendar_permissions { - begin - acs_permission.revoke_permission ( - object_id => :calendar_id, - grantee_id => :party_id, - privilege => :cal_privilege - ); - end; - } - } } Index: openacs-4/packages/calendar/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/index.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/calendar/www/index.tcl 10 Sep 2002 22:22:31 -0000 1.9 +++ openacs-4/packages/calendar/www/index.tcl 30 Nov 2002 17:28:09 -0000 1.10 @@ -14,11 +14,17 @@ set package_id [ad_conn package_id] set user_id [ad_conn user_id] -# If there are no calendars at all, we should create a personal one -set calendar_list [calendar::adjust_calendar_list -calendar_list {} -package_id $package_id -user_id $user_id] +if {!$user_id} { + # user isn't logged in + ad_redirect_for_registration + ad_script_abort +} -# If no calendars, we need at least a personal one! -if {[llength $calendar_list] == 0} { +# Check for a personal, private calendar, create if missing +# FIXME BUG: this should be moved to new pages to allow users +# to create/delete/modify/admin their calendars. + +if {![db_string private_calendar_count_qry {}]} { # Create a personal calendar for the user calendar::new -owner_id $user_id -private_p "t" -calendar_name "Personal" -package_id $package_id } Index: openacs-4/packages/calendar/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/index.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/calendar/www/index.xql 30 Nov 2002 17:28:09 -0000 1.2 @@ -0,0 +1,13 @@ + + + + + +select count(*) from calendars +where package_id= :package_id +and owner_id= :user_id +and private_p = 't' + + + + Index: openacs-4/packages/calendar/www/admin/calendar-permissions.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/admin/Attic/calendar-permissions.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/calendar/www/admin/calendar-permissions.xql 28 Nov 2001 18:39:39 -0000 1.3 +++ openacs-4/packages/calendar/www/admin/calendar-permissions.xql 30 Nov 2002 17:28:30 -0000 1.4 @@ -19,7 +19,7 @@ from all_object_party_privilege_map where object_id = :calendar_id and party_id = :party_id - and privilege like '%calendar%' + and privilege like 'calendar%' Index: openacs-4/packages/clickthrough/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/clickthrough/www/index-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/clickthrough/www/index-oracle.xql 4 Jun 2001 03:19:13 -0000 1.1 +++ openacs-4/packages/clickthrough/www/index-oracle.xql 30 Nov 2002 17:28:51 -0000 1.2 @@ -1,5 +1,7 @@ +oracle8.1.6 + select sn2.object_id as parent_package_id, Index: openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql 25 Sep 2002 04:11:24 -0000 1.8 +++ openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql 30 Nov 2002 17:29:02 -0000 1.9 @@ -309,7 +309,7 @@ perform workflow__add_trans_role_assign_map( ''publishing_wf'', ''authoring'', - ''author''); + ''authoring''); return 0; end;' language 'plpgsql'; Index: openacs-4/packages/cms/tcl/form-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-postgresql.xql,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/cms/tcl/form-procs-postgresql.xql 8 Dec 2001 01:17:59 -0000 1.18 +++ openacs-4/packages/cms/tcl/form-procs-postgresql.xql 30 Nov 2002 17:29:11 -0000 1.19 @@ -63,7 +63,7 @@ attributes.attribute_id = params.attribute_id - + Index: openacs-4/packages/cms/tcl/pagination-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/pagination-procs-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/cms/tcl/pagination-procs-oracle.xql 22 Aug 2001 02:24:49 -0000 1.2 +++ openacs-4/packages/cms/tcl/pagination-procs-oracle.xql 30 Nov 2002 17:29:11 -0000 1.3 @@ -1,5 +1,6 @@ +oracle8.1.6 Index: openacs-4/packages/cms/tcl/pagination-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/pagination-procs-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/cms/tcl/pagination-procs-postgresql.xql 12 Aug 2001 14:49:52 -0000 1.2 +++ openacs-4/packages/cms/tcl/pagination-procs-postgresql.xql 30 Nov 2002 17:29:11 -0000 1.3 @@ -1,5 +1,6 @@ +postgresql7.1 Index: openacs-4/packages/cms/tcl/publish-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/cms/tcl/publish-procs.tcl 16 Sep 2002 10:56:14 -0000 1.10 +++ openacs-4/packages/cms/tcl/publish-procs.tcl 30 Nov 2002 17:29:11 -0000 1.11 @@ -418,7 +418,12 @@ if { [template::util::is_nil interval] } { # Kludge: relies on that CMS is a singleton package set package_id [apm_package_id_from_key "cms"] - set interval [ad_parameter -package_id $package_id StatusSweepInterval 3600] + if { ![template::util::is_nil package_id] } { + set interval [ad_parameter -package_id $package_id StatusSweepInterval 3600] + } else { + ns_log Warning "Unable to lookup package_id for cms in publish::schedule_status_sweep defaulting to interval 3600" + set interval 3600 + } } ns_log notice "CMS publish::schedule_status_sweep: Scheduling status sweep every $interval seconds" Index: openacs-4/packages/cms/www/modules/types/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/index-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/types/index-oracle.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/types/index-oracle.xql 30 Nov 2002 17:29:21 -0000 1.2 @@ -32,7 +32,7 @@ attr.attribute_id, attr.attribute_name, attr.object_type, attr.pretty_name as attribute_name_pretty, datatype, types.pretty_name as pretty_name, - nvl(description_key,' ') as description_key, + nvl(description_key,' ') as description_key, description, widget from acs_attributes attr, acs_attribute_descriptions d, Index: openacs-4/packages/cms/www/modules/types/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/index-postgresql.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/types/index-postgresql.xql 8 Dec 2001 01:18:00 -0000 1.4 +++ openacs-4/packages/cms/www/modules/types/index-postgresql.xql 30 Nov 2002 17:29:21 -0000 1.5 @@ -30,7 +30,7 @@ attr.attribute_id, attr.attribute_name, attr.object_type, attr.pretty_name as attribute_name_pretty, datatype, types.pretty_name as pretty_name, - coalesce(description_key,' ') as description_key, + coalesce(description_key,' ') as description_key, description, widget from acs_attributes attr left outer join cm_attribute_widgets w using (attribute_id) Index: openacs-4/packages/cronjob/cronjob.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/cronjob.info,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/cronjob/cronjob.info 23 Sep 2002 23:32:14 -0000 1.3 +++ openacs-4/packages/cronjob/cronjob.info 30 Nov 2002 17:29:31 -0000 1.4 @@ -20,12 +20,13 @@ - + + @@ -42,9 +43,10 @@ - - + + + Index: openacs-4/packages/cronjob/tcl/cronjob-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/tcl/cronjob-init.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/cronjob/tcl/cronjob-init.tcl 24 Dec 2001 02:50:17 -0000 1.2 +++ openacs-4/packages/cronjob/tcl/cronjob-init.tcl 30 Nov 2002 17:29:40 -0000 1.3 @@ -11,178 +11,174 @@ ad_schedule_proc -thread t 60 cronjob_check if {![info exists qd_write_query_select]} { - -ad_proc qd_write_query_select {package attrs} { + + ad_proc qd_write_query_select {package attrs} { -

    Returns Postgresql function with: -

      -
    • correctly ordered attributes -
    • defaults filled in for un-supplied attributes. -
    +

    Returns Postgresql function with: +

      +
    • correctly ordered attributes +
    • defaults filled in for un-supplied attributes. +
    -} { - ns_log Debug "Running qd_write_query_select with $package $attrs" + } { + ns_log Debug "Running qd_write_query_select with $package $attrs" set query [list] - set in_args [list] + set in_args [list] set args [concat $attrs] foreach {attr sign value} $args { - lappend in_args $attr - set attr_array($attr) $value + lappend in_args $attr + set attr_array($attr) $value } set attrs_and_defaults [eval qd_choose_function $package $in_args] foreach {attr default_value} $attrs_and_defaults { - # see if attr was passed in with value - if {![info exists attr_array($attr)]} { - - if {[string match "" $default_value]} { - ns_log Debug "Attempt to call $package with no value for $attr" - return -code error - } - lappend query $default_value - } else { - lappend query "$attr_array($attr)" - } + # see if attr was passed in with value + if {![info exists attr_array($attr)]} { + + if {[string match "" $default_value]} { + ns_log Debug "Attempt to call $package with no value for $attr" + return -code error + } + lappend query $default_value + } else { + lappend query "$attr_array($attr)" + } } ns_log Debug "${package}([join $query ",\n"]);" return "${package}([join $query ",\n"]);" -} + } -ad_proc qd_add_package {package args} { -

    Adds a package with all the attributes for every function of the same name. -

    For example, if you have two functions that could be called - foo(a,b,c) and foo(a,c,d), - the package would be registered using: -

    -
    -         qd_add_package foo a b c d
    -       
    -
    + ad_proc qd_add_package {package args} { +

    Adds a package with all the attributes for every function of the same name. +

    For example, if you have two functions that could be called + foo(a,b,c) and foo(a,c,d), + the package would be registered using: +

    +
    +	qd_add_package foo a b c d
    +	
    +
    -} { + } { nsv_set qd_pg_packages $package $args set n 1 foreach attr $args { - nsv_set $package $attr $n - set n [expr $n * 2] + nsv_set $package $attr $n + set n [expr $n * 2] } -} + } -ad_proc qd_total_attributes {package attributes} { + ad_proc qd_total_attributes {package attributes} { -

    Totals the attribute values. -} { +

    Totals the attribute values. + } { upvar $package package_array upvar $attributes attrs set total 0 foreach attribute $attrs { - incr total $package_array($attribute) - ns_log Debug "Adding $package_array($attribute) $total" + incr total $package_array($attribute) + ns_log Debug "Adding $package_array($attribute) $total" } return $total -} + } -ad_proc qd_add_function {package args} { + ad_proc qd_add_function {package args} { -

    Adds a single function, including defaults to a package. -

    If one foo function has three attributes: a, b and c, where - a is required and b can be null and c default to 't', +

    Adds a single function, including defaults to a package. +

    If one foo function has three attributes: a, b and c, where + a is required and b can be null and c default to 't', the function would be - registered using: -

    -
    -       qd_add_function foo a "" b "null" c "'t'"
    -    
    -
    + registered using: +
    +
    +	qd_add_function foo a "" b "null" c "'t'"
    +	
    +
    -} { + } { # total up the function value. array set temp_package [nsv_array get $package] set i 1 foreach {attr default} $args { - lappend attr_list $attr + lappend attr_list $attr } set total [qd_total_attributes temp_package attr_list] nsv_set ${package}_functions $total $args -} + } -ad_proc qd_choose_function {package args} { + ad_proc qd_choose_function {package args} { -

    Used to choose a function based on passed in attributes. +

    Used to choose a function based on passed in attributes. -} { + } { array set temp_package [nsv_array get $package] set total [qd_total_attributes temp_package args] - if {[nsv_exists ${package}_functions $total]} { - ns_log Debug "Found matching sig: '$total'" - return [nsv_get ${package}_functions $total] + if {[nsv_exists ${package}_functions $total]} { + ns_log Debug "Found matching sig: '$total'" + return [nsv_get ${package}_functions $total] } set functions [nsv_array names ${package}_functions] foreach sig $functions { - ns_log Debug "checking sig '$total' against '$sig'" - if {$total == [expr $sig & $total]} { - ns_log Debug "Found match '$total' in '$sig'" - return [nsv_get ${package}_functions $sig] - } + ns_log Debug "checking sig '$total' against '$sig'" + if {$total == [expr $sig & $total]} { + ns_log Debug "Found match '$total' in '$sig'" + return [nsv_get ${package}_functions $sig] + } } return "!NO MATCH: $total not in $functions" -} + } -proc qd_write_query {package args} { + proc qd_write_query {package args} { set query [list] set attrs_and_defaults [eval qd_choose_function $package $args] foreach {attr default_value} $attrs_and_defaults { - if {[lsearch $args $attr] < 0 } { - if {[string match "" $default_value]} { - ns_log Debug "Attempt to call $package with no value for $attr" - return -code error - } - lappend query $default_value - } else { - lappend query ":${attr}" - } + if {[lsearch $args $attr] < 0 } { + if {[string match "" $default_value]} { + ns_log Debug "Attempt to call $package with no value for $attr" + return -code error + } + lappend query $default_value + } else { + lappend query ":${attr}" + } } return [join $query ",\n"] -} + } -proc qd_write_query_upvar {package listvar} { + proc qd_write_query_upvar {package listvar} { set query [list] upvar $listvar args set attrs_and_defaults [eval qd_choose_function $package $args] if {[string match "!NO MATCH:*" $attrs_and_defaults ]} { - ns_log Debug "$attrs_and_defaults" - return -code error + ns_log Debug "$attrs_and_defaults" + return -code error } foreach {attr default_value} $attrs_and_defaults { - if {[lsearch $args $attr] < 0 } { - if {[string match "" $default_value]} { - ns_log Debug "Attempt to call $package with no value for $attr" - return -code error - } - lappend query $default_value - } else { - lappend query ":${attr}" - } + if {[lsearch $args $attr] < 0 } { + if {[string match "" $default_value]} { + ns_log Debug "Attempt to call $package with no value for $attr" + return -code error + } + lappend query $default_value + } else { + lappend query ":${attr}" + } } return [join $query ",\n"] -} + } - - - } qd_add_package cronjob__new cronjob_id user_id description approved_p disabled_p minute hr mon day dayofweek run_sql run_tcl email creation_user creation_ip context_id qd_add_function cronjob__new "cronjob_id" "null" "user_id" "" "description" "" "approved_p" "'f'" "disabled_p" "'f'" "minute" "'0'" "hr" "'0'" "mon" "'0'" "day" "'0'" "dayofweek" "'0'" "run_sql" "" "run_tcl" "" "email" "" "creation_user" "null" "creation_ip" "null" "context_id" "null" - qd_add_package cronjob__set_attrs "cronjob_id" "user_id" "description" "approved_p" "disabled_p" "minute" "hr" "mon" "day" "dayofweek" "run_sql" "run_tcl" "email" qd_add_function cronjob__set_attrs "cronjob_id" "" "user_id" "null" "description" "null" "approved_p" "null" "disabled_p" "'f'" "minute" "null" "hr" "null" "mon" "null" "day" "null" "dayofweek" "null" "run_sql" "null" "run_tcl" "null" "email" "null" Index: openacs-4/packages/cronjob/tcl/cronjob-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/tcl/cronjob-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/cronjob/tcl/cronjob-procs.tcl 12 Sep 2002 22:44:25 -0000 1.4 +++ openacs-4/packages/cronjob/tcl/cronjob-procs.tcl 30 Nov 2002 17:29:40 -0000 1.5 @@ -13,33 +13,18 @@ } { - # setup the vars - set time [ns_time] - set minute [ns_fmttime $time %M] - set hr [ns_fmttime $time %H] - set mon [ns_fmttime $time %m] + # setup the vars + set time [ns_time] + set minute [ns_fmttime $time %M] + set hr [ns_fmttime $time %H] + set mon [ns_fmttime $time %m] set day [ns_fmttime $time %d] set dayofweek [ns_fmttime $time %w] - set sql " -select - cronjob_id -from - cronjobs -where - disabled_p = 'f' AND - approved_p = 't' AND - ((minute = :minute) OR (minute = '*')) AND - ((hr = :hr ) OR (hr = '*')) AND - ((mon = :mon ) OR (mon = '*')) AND - ((day = :day ) OR (day = '*')) AND - ((dayofweek = :dayofweek ) OR (dayofweek = '*'))" - - db_foreach cronjob_sched_foreach $sql { + db_foreach cronjob_sched_foreach "" { + ad_schedule_proc -once t -thread t 1 cronjob_run $cronjob_id + } - ad_schedule_proc -once t -thread t 1 cronjob_run $cronjob_id - } - } @@ -48,57 +33,47 @@ Proc to run cronjobs } { - set table "No SQL" - set sql " -select - description, - run_sql, - run_tcl, - email -from - cronjobs -where - cronjob_id = :cronjob_id" - ns_log Notice "Cronjob_id is $cronjob_id" - db_1row "crontab_query" $sql - db_release_unused_handles - if {![string match "" $run_sql]} { - set table "" - set db [ns_db gethandle "log"] - set sel [ns_db select $db $run_sql] - set rownum 0 - if {![string match "" $sel]} { - while {[ns_db getrow $db $sel]} { - set size [ns_set size $sel] - if {$rownum == 0} { - for {set i 0 } {$i < $size} {incr i} { - append table "\n" - } - } - append table "" - for {set i 0 } {$i < $size} {incr i} { - append table "\n" - } - append table "" - incr rownum - } - } - append table "
    [ns_set key $sel $i]
    [ns_set value $sel $i]
    " - if {$rownum == 0} { - set table "No Rows Returned" - } - ns_db releasehandle $db + set table "No SQL" + ns_log Notice "Cronjob_id is $cronjob_id" + db_1row crontab_query $sql + db_release_unused_handles + if {![string match "" $run_sql]} { + set table "" + set db [ns_db gethandle "log"] + set sel [ns_db select $db $run_sql] + set rownum 0 + if {![string match "" $sel]} { + while {[ns_db getrow $db $sel]} { + set size [ns_set size $sel] + if {$rownum == 0} { + for {set i 0 } {$i < $size} {incr i} { + append table "\n" + } } + append table "" + for {set i 0 } {$i < $size} {incr i} { + append table "\n" + } + append table "" + incr rownum + } + } + append table "
    [ns_set key $sel $i]
    [ns_set value $sel $i]
    " + if {$rownum == 0} { + set table "No Rows Returned" + } + ns_db releasehandle $db + } - # evaluate the run_tcl code - eval $run_tcl + # evaluate the run_tcl code + eval $run_tcl - if {![string match "" $email]} { - ns_log notice "sending cronjob email to $email" - set headers [ns_set create] - ns_set put $headers "Content-Type" "text/html" - ns_sendmail $email [ad_host_administrator] "Cronjob $cronjob_id" "Description:
    $description
    $table" $headers - } - return + if {![string match "" $email]} { + ns_log notice "sending cronjob email to $email" + set headers [ns_set create] + ns_set put $headers "Content-Type" "text/html" + ns_sendmail $email [ad_host_administrator] "Cronjob $cronjob_id" "Description:
    $description
    $table" $headers + } + return } Index: openacs-4/packages/cronjob/tcl/cronjob-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/tcl/cronjob-procs.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/tcl/cronjob-procs.xql 30 Nov 2002 17:29:40 -0000 1.2 @@ -0,0 +1,27 @@ + + + + + + + select cronjob_id + from cronjobs + where disabled_p = 'f' + and approved_p = 't' + and ((minute = :minute) or (minute = '*')) + and ((hr = :hr ) or (hr = '*')) + and ((mon = :mon ) or (mon = '*')) + and ((day = :day ) or (day = '*')) + and ((dayofweek = :dayofweek ) or (dayofweek = '*')) + + + + + + select description, run_sql, run_tcl, email + from cronjobs + where cronjob_id = :cronjob_id + + + + Index: openacs-4/packages/cronjob/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/index.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/index.tcl 4 Sep 2002 09:06:09 -0000 1.1 +++ openacs-4/packages/cronjob/www/index.tcl 30 Nov 2002 17:29:53 -0000 1.2 @@ -3,7 +3,8 @@ A place holder for access to the admin pages. @author Bart Teeuwisse - @creation-date April 2002 + @cvs-id $Id$ + @creation-date Oct 2002 } { } -properties { @@ -22,15 +23,10 @@ # Get the name of the package -if {[db_0or1row get_package_name " - select p.instance_name - from apm_packages p, apm_package_versions v - where p.package_id = :package_id - and p.package_key = v.package_key - and v.enabled_p = 't'"]} { +if {[db_0or1row get_package_name ""]} { set title "$instance_name" } else { - set title "Authorize.net Gateway" + set title "Cronjob" } # Set the context bar. Index: openacs-4/packages/cronjob/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/index.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cronjob/www/index.xql 30 Nov 2002 17:29:53 -0000 1.2 @@ -0,0 +1,15 @@ + + + + + + + select p.instance_name + from apm_packages p, apm_package_versions v + where p.package_id = :package_id + and p.package_key = v.package_key + and v.enabled_p = 't' + + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob-add-oracle.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,33 +1,27 @@ - oracle8.1.6 + oracle8.1.6 - - - - - declare - v_cronjob_id integer; - begin - v_cronjob_id := cronjob.new( - user_id => :user_id, - description => :description, - approved_p => :approved_p, - disabled_p => :disabled_p, - minute => :minute, - hr => :hr, - mon => :mon, - day => :day, - dayofweek => :dayofweek, - run_sql => :run_sql, - run_tcl => :run_tcl, - email => :email - ); - end; - - - - - + + + declare v_cronjob_id integer; + begin + v_cronjob_id := cronjob.new( + user_id => :user_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email); + end; + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob-add-postgresql.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,10 +1,10 @@ - postgresql7.1 + postgresql7.1 - - + + select [qd_write_query_select cronjob__new { user_id => :user_id description => :description @@ -19,8 +19,7 @@ run_tcl => :run_tcl email => :email } ] - - - + + Index: openacs-4/packages/cronjob/www/admin/cronjob-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-add.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/cronjob/www/admin/cronjob-add.tcl 10 Sep 2002 22:22:33 -0000 1.2 +++ openacs-4/packages/cronjob/www/admin/cronjob-add.tcl 30 Nov 2002 17:30:07 -0000 1.3 @@ -1,14 +1,15 @@ ad_page_contract { - + Cronjobs Add Page 2 - @author: tom@zmbh.com - @creation-date: 22 Sept 2001 - @cvs-id $Id$ + @author tom@zmbh.com + @creation-date 22 Sept 2001 + @cvs-id $Id$ + } { - description:trim,notnull,html - minute:notnull,trim + description:trim,notnull,html + minute:notnull,trim hr:notnull,trim mon:notnull,trim day:notnull,trim @@ -26,25 +27,25 @@ db_exec_plsql add_cronjob { - - declare - v_cronjob_id integer; - begin + + declare + v_cronjob_id integer; + begin v_cronjob_id := cronjob.new( - user_id => :user_id, - description => :description, - approved_p => :approved_p, - disabled_p => :disabled_p, - minute => :minute, - hr => :hr, - mon => :mon, - day => :day, - dayofweek => :dayofweek, - run_sql => :run_sql, - run_tcl => :run_tcl, - email => :email - ); - end; + user_id => :user_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email + ); + end; } -ad_returnredirect cronjobs \ No newline at end of file +ad_returnredirect cronjobs Index: openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob-delete-oracle.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,20 +1,14 @@ - oracle8.1.6 + oracle8.1.6 - - - - - begin - cronjob.delete( - cronjob_id => :cronjob_id - ); - end; + + + begin + cronjob.delete(cronjob_id => :cronjob_id); + end; + + - - - - Index: openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob-delete-postgresql.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,16 +1,14 @@ - postgresql7.1 + postgresql7.1 - - - - select [qd_write_query_select cronjob__delete { + + + select [qd_write_query_select cronjob__delete { cronjob_id => :cronjob_id } ] + + - - - - + Index: openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl 10 Sep 2002 22:22:33 -0000 1.2 +++ openacs-4/packages/cronjob/www/admin/cronjob-delete.tcl 30 Nov 2002 17:30:07 -0000 1.3 @@ -1,22 +1,21 @@ ad_page_contract { - + Cronjob Delete - @author: tom@zmbh.com - @creation-date: 22 Sept 2001 - @cvs-id $Id$ + @author tom@zmbh.com + @creation-date 22 Sept 2001 + @cvs-id $Id$ + } { cronjob_id:integer,trim,notnull } db_exec_plsql edit_cronjob { - - begin - cronjob.delete( - cronjob_id => :cronjob_id - ); - end; + + begin + cronjob.delete(cronjob_id => :cronjob_id); + end; } -ad_returnredirect cronjobs \ No newline at end of file +ad_returnredirect cronjobs Index: openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob-edit-oracle.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,31 +1,26 @@ - oracle8.1.6 + oracle8.1.6 - - - - - begin - cronjob.set_attrs( - cronjob_id => :cronjob_id, - description => :description, - approved_p => :approved_p, - disabled_p => :disabled_p, - minute => :minute, - hr => :hr, - mon => :mon, - day => :day, - dayofweek => :dayofweek, - run_sql => :run_sql, - run_tcl => :run_tcl, - email => :email - ); - end; + + + begin + cronjob.set_attrs( + cronjob_id => :cronjob_id, + description => :description, + approved_p => :approved_p, + disabled_p => :disabled_p, + minute => :minute, + hr => :hr, + mon => :mon, + day => :day, + dayofweek => :dayofweek, + run_sql => :run_sql, + run_tcl => :run_tcl, + email => :email); + end; + + - - - - Index: openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob-edit-postgresql.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,12 +1,11 @@ - postgresql7.1 + postgresql7.1 - - - - select [qd_write_query_select cronjob__set_attrs { + + + select [qd_write_query_select cronjob__set_attrs { cronjob_id => :cronjob_id description => :description approved_p => :approved_p @@ -19,9 +18,7 @@ run_sql => :run_sql run_tcl => :run_tcl email => :email } ] - - - - - + + + Index: openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl 10 Sep 2002 22:22:33 -0000 1.2 +++ openacs-4/packages/cronjob/www/admin/cronjob-edit.tcl 30 Nov 2002 17:30:07 -0000 1.3 @@ -1,29 +1,29 @@ ad_page_contract { Cronjobs Edit Page 2 - @author: tom@zmbh.com - @creation-date: 22 Sept 2001 - @cvs-id $Id$ + @author tom@zmbh.com + @creation-date 22 Sept 2001 + @cvs-id $Id$ + } { cronjob_id:integer,trim,notnull - {description:trim,html ""} - {minute:trim ""} + {description:trim,html ""} + {minute:trim ""} {hr:trim ""} {mon:trim ""} {day:trim ""} {dayofweek:trim ""} {run_sql:trim ""} {run_tcl:trim ""} {email:trim,email ""} - {approved_p:trim ""} - {disabled_p:trim ""} - + {approved_p:trim ""} + {disabled_p:trim ""} } db_exec_plsql edit_cronjob { - begin + begin cronjob.set_attrs( cronjob_id => :cronjob_id, description => :description, @@ -36,9 +36,8 @@ dayofweek => :dayofweek, run_sql => :run_sql, run_tcl => :run_tcl, - email => :email - ); - end; + email => :email); + end; } -ad_returnredirect cronjobs \ No newline at end of file +ad_returnredirect cronjobs Index: openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl 10 Sep 2002 22:22:33 -0000 1.3 +++ openacs-4/packages/cronjob/www/admin/cronjob-run-now.tcl 30 Nov 2002 17:30:07 -0000 1.4 @@ -1,13 +1,13 @@ ad_page_contract { Run Cronjob - @author: tom@zmbh.com - @creation-date: 22 Sept 2001 - @cvs-id $Id$ + @author tom@zmbh.com + @creation-date 22 Sept 2001 + @cvs-id $Id$ + } { cronjob_id:integer,trim,notnull - } ad_schedule_proc -once t -thread t 1 cronjob_run $cronjob_id Index: openacs-4/packages/cronjob/www/admin/cronjob.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/cronjob/www/admin/cronjob.tcl 10 Sep 2002 22:22:33 -0000 1.3 +++ openacs-4/packages/cronjob/www/admin/cronjob.tcl 30 Nov 2002 17:30:07 -0000 1.4 @@ -1,21 +1,23 @@ ad_page_contract { Cronjobs List and Add Page - @author: tom@zmbh.com - @creation-date: 22 Sept 2001 - @cvs-id $Id$ + + @author tom@zmbh.com + @creation-date 22 Sept 2001 + @cvs-id $Id$ + } { - cronjob_id:integer,notnull + cronjob_id:integer,notnull } -properties { - page_title:onevalue - context:onevalue - hour_option:onevalue - minute_option:onevalue - month_option:onevalue - day_option:onevalue - dayofweek_option:onevalue + page_title:onevalue + context:onevalue + hour_option:onevalue + minute_option:onevalue + month_option:onevalue + day_option:onevalue + dayofweek_option:onevalue } set page_title "One Cronjob" @@ -28,77 +30,65 @@ set day_option "" set dayofweek_option "" +db_1row cronjob_query "" - -db_1row cronjob_query " -select - * -from - cronjobs -where - cronjob_id = :cronjob_id" - - - foreach {value name} [list "\*" "Every Month" 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December] { - if {[string match $mon $value]} { - append month_option " + if {[string match $mon $value]} { + append month_option " " - } else { - append month_option " + } else { + append month_option " " - } + } } foreach {value name} [list "\*" "Every Day of Week" 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday] { - if {[string match $dayofweek $value]} { - append dayofweek_option " + if {[string match $dayofweek $value]} { + append dayofweek_option " " - } else { - append dayofweek_option " + } else { + append dayofweek_option " " - } + } } foreach {value name} [list "\*" "Every Day" 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31] { - if {[string match $day $value]} { - append day_option " + if {[string match $day $value]} { + append day_option " " - } else { - append day_option " + } else { + append day_option " " - - } + + } } foreach {value name} [list "\*" "Every Hour" 00 0 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23] { - if {[string match $hr $value]} { - append hour_option " + if {[string match $hr $value]} { + append hour_option " " - } else { - append hour_option " + } else { + append hour_option " " - - } + + } } foreach {value name} [list "\*" "Every Minute" 00 0 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 10 10\ - 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20\ - 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30\ - 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40\ - 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50\ - 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 ] { - if {[string match $minute $value]} { - append minute_option " + 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20\ + 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30\ + 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40\ + 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50\ + 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 ] { + if {[string match $minute $value]} { + append minute_option " " - } else { - append minute_option " + } else { + append minute_option " " - - } + + } } - - -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/cronjob/www/admin/cronjob.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjob.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjob.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjob.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,17 +1,12 @@ - - - -select - * -from - cronjobs -where - cronjob_id = :cronjob_id - - - - + + + select * + from cronjobs + where cronjob_id = :cronjob_id + + + Index: openacs-4/packages/cronjob/www/admin/cronjobs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjobs.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/cronjob/www/admin/cronjobs.tcl 10 Sep 2002 22:22:33 -0000 1.3 +++ openacs-4/packages/cronjob/www/admin/cronjobs.tcl 30 Nov 2002 17:30:07 -0000 1.4 @@ -1,18 +1,20 @@ ad_page_contract { - + Cronjobs List and Add Page - @author: tom@zmbh.com - @creation-date: 22 Sept 2001 - @cvs-id $Id$ + + @author tom@zmbh.com + @creation-date 22 Sept 2001 + @cvs-id $Id$ + } -properties { - page_title:onevalue - context:onevalue - hour_option:onevalue - minute_option:onevalue - month_option:onevalue - day_option:onevalue - dayofweek_option:onevalue + page_title:onevalue + context:onevalue + hour_option:onevalue + minute_option:onevalue + month_option:onevalue + day_option:onevalue + dayofweek_option:onevalue } set page_title "Cronjobs List and Add Page" @@ -26,39 +28,33 @@ set dayofweek_option "" foreach {value name} [list 01 January 02 February 03 March 04 April 05 May 06 June 07 July 08 August 09 September 10 October 11 November 12 December] { - append month_option " + append month_option " " } foreach {value name} [list 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday] { - append dayofweek_option " + append dayofweek_option " " } for {set i 1} {$i < 32} {incr i} { - append day_option " + append day_option " " } for {set i 0} {$i < 24} {incr i} { - append hour_option " + append hour_option " " } append minute_option $hour_option for {} {$i < 60} {incr i} { - append minute_option " + append minute_option " " } -db_multirow cronjobs cronjobs_query " -select - * -from - cronjobs -order by - user_id" +db_multirow cronjobs cronjobs_query "" -ad_return_template \ No newline at end of file +ad_return_template Index: openacs-4/packages/cronjob/www/admin/cronjobs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/admin/cronjobs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cronjob/www/admin/cronjobs.xql 4 Nov 2001 18:09:49 -0000 1.1 +++ openacs-4/packages/cronjob/www/admin/cronjobs.xql 30 Nov 2002 17:30:07 -0000 1.2 @@ -1,17 +1,12 @@ - - - -select - * -from - cronjobs -order by - user_id - - - - + + + select * + from cronjobs + order by user_id + + + Index: openacs-4/packages/download/www/help.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/help.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/download/www/help.adp 6 Sep 2002 21:50:31 -0000 1.3 +++ openacs-4/packages/download/www/help.adp 30 Nov 2002 17:30:24 -0000 1.4 @@ -8,7 +8,7 @@

    - +
    PermissionDescription
    ReadAllows a user to view or download the archive. Revoke this privalege to make an archive private.
    ReadAllows a user to view or download the archive. Revoke this privilege to make an archive private.
    WriteWrite permission is necessary to add a version to an existing archive.
    AdministerAdminister permission is necessary to grant or revoke archive permissions
    Index: openacs-4/packages/download/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/index.adp,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/download/www/index.adp 6 Sep 2002 21:50:31 -0000 1.4 +++ openacs-4/packages/download/www/index.adp 30 Nov 2002 17:30:24 -0000 1.5 @@ -32,7 +32,7 @@ -

    My Unapparoved Revisions:

    +

    My Unapproved Revisions:

    • @my_revisions.archive_name@ @my_revisions.version_name@
    • Index: openacs-4/packages/ecommerce/ecommerce.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/ecommerce.info,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/ecommerce/ecommerce.info 27 Nov 2002 00:38:11 -0000 1.30 +++ openacs-4/packages/ecommerce/ecommerce.info 30 Nov 2002 17:30:42 -0000 1.31 @@ -71,6 +71,7 @@ + @@ -402,6 +403,8 @@ + + @@ -969,53 +972,53 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/ecommerce/sql/postgresql/ecommerce-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/sql/postgresql/ecommerce-create.sql,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/ecommerce/sql/postgresql/ecommerce-create.sql 26 May 2002 04:36:49 -0000 1.15 +++ openacs-4/packages/ecommerce/sql/postgresql/ecommerce-create.sql 30 Nov 2002 17:31:01 -0000 1.16 @@ -69,7 +69,7 @@ template_id integer not null primary key, template_name varchar(200), template varchar(4000), - last_modified timestamp not null, + last_modified timestamp(0) not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -78,7 +78,7 @@ template_id integer, template_name varchar(200), template varchar(4000), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -118,7 +118,7 @@ -- pretty, human-readable category_name varchar(100), sort_key numeric, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -129,7 +129,7 @@ category_id integer, category_name varchar(100), sort_key numeric, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -164,7 +164,7 @@ -- pretty, human-readable subcategory_name varchar(100), sort_key numeric, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -177,7 +177,7 @@ category_id integer, subcategory_name varchar(100), sort_key numeric, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -221,7 +221,7 @@ -- pretty, human-readable subsubcategory_name varchar(100), sort_key numeric, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -235,7 +235,7 @@ subcategory_id integer, subsubcategory_name varchar(100), sort_key numeric, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -339,7 +339,7 @@ -- integer not null primary key, sku varchar(100), product_name varchar(200), - creation_date timestamp default now() not null, + creation_date timestamp(0)default now() not null, one_line_description varchar(400), detailed_description varchar(4000), search_keywords varchar(4000), @@ -370,9 +370,9 @@ active_p boolean default 't', -- the date the product becomes available for sale (it can be listed -- before then, it's just not buyable) - available_date timestamp default now() not null, + available_date timestamp(0)default now() not null, announcements varchar(4000), - announcements_expire timestamp, + announcements_expire timestamp(0), -- if there's a web site with more info about the product url varchar(300), template_id integer references ec_templates, @@ -389,7 +389,7 @@ -- email this list on purchase email_on_purchase_list varchar(4000), -- the user ID and IP address of the creator of the product - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -407,7 +407,7 @@ create table ec_products_audit ( product_id integer, product_name varchar(200), - creation_date timestamp, + creation_date timestamp(0), one_line_description varchar(400), detailed_description varchar(4000), search_keywords varchar(4000), @@ -418,13 +418,13 @@ dirname varchar(200), present_p boolean default 't', active_p boolean default 't', - available_date timestamp, + available_date timestamp(0), announcements varchar(4000), - announcements_expire timestamp, + announcements_expire timestamp(0), url varchar(300), template_id integer, stock_status char(1) check (stock_status in ('o','q','m','s','i')), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -491,13 +491,13 @@ sale_price_id integer not null primary key, product_id integer not null references ec_products, sale_price numeric, - sale_begins timestamp not null, - sale_ends timestamp not null, + sale_begins timestamp(0)not null, + sale_ends timestamp(0)not null, -- like Introductory Price or Sale Price or Special Offer sale_name varchar(30), -- if non-null, the user has to know this code to get the sale price offer_code varchar(20), - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -515,11 +515,11 @@ sale_price_id integer, product_id integer, sale_price numeric, - sale_begins timestamp, - sale_ends timestamp, + sale_begins timestamp(0), + sale_ends timestamp(0), sale_name varchar(30), offer_code varchar(20), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -556,7 +556,7 @@ -- components of the above series component_id integer not null references ec_products, primary key (series_id, component_id), - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -566,7 +566,7 @@ create table ec_product_series_map_audit ( series_id integer, component_id integer, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -652,15 +652,15 @@ user_class_id integer not null primary key, -- human-readable user_class_name varchar(200), -- e.g., student - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); create table ec_user_classes_audit ( user_class_id integer, user_class_name varchar(200), -- e.g., student - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -690,7 +690,7 @@ product_id integer not null references ec_products, user_class_id integer not null references ec_user_classes, price numeric, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null, primary key (product_id, user_class_id) @@ -704,7 +704,7 @@ product_id integer, user_class_id integer, price numeric, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -747,7 +747,7 @@ category_id integer references ec_categories, subcategory_id integer references ec_subcategories, subsubcategory_id integer references ec_subsubcategories, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -767,7 +767,7 @@ category_id integer, subcategory_id integer, subsubcategory_id integer, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -834,7 +834,7 @@ user_class_id integer not null references ec_user_classes, primary key (user_id, user_class_id), user_class_approved_p boolean, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -846,7 +846,7 @@ user_id integer, user_class_id integer, user_class_approved_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -877,7 +877,7 @@ create table ec_product_links ( product_a integer not null references ec_products, product_b integer not null references ec_products, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null, primary key (product_a, product_b) @@ -888,7 +888,7 @@ create table ec_product_links_audit ( product_a integer, product_b integer, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -926,8 +926,8 @@ rating numeric, -- in some systems, the administrator will have to approve comments first approved_p boolean, - comment_date timestamp, - last_modified timestamp not null, + comment_date timestamp(0), + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -944,7 +944,7 @@ one_line_summary varchar(300), rating numeric, approved_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -981,11 +981,11 @@ product_id integer not null references ec_products, author_name varchar(100), publication varchar(100), - review_date timestamp, + review_date timestamp(0), -- in HTML format review text, display_p boolean, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -998,11 +998,11 @@ product_id integer, author_name varchar(100), publication varchar(100), - review_date timestamp, + review_date timestamp(0), -- in HTML format review text, display_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1039,7 +1039,7 @@ product_id integer not null references ec_products, category_id integer not null references ec_categories, publisher_favorite_p boolean, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null, primary key (product_id, category_id) @@ -1052,7 +1052,7 @@ product_id integer, category_id integer, publisher_favorite_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1086,7 +1086,7 @@ product_id integer not null references ec_products, subcategory_id integer not null references ec_subcategories, publisher_favorite_p boolean, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null, primary key (product_id, subcategory_id) @@ -1100,7 +1100,7 @@ product_id integer, subcategory_id integer, publisher_favorite_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1133,7 +1133,7 @@ product_id integer not null references ec_products, subsubcategory_id integer not null references ec_subsubcategories, publisher_favorite_p boolean, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null, primary key (product_id, subsubcategory_id) @@ -1146,7 +1146,7 @@ product_id integer, subsubcategory_id integer, publisher_favorite_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1200,9 +1200,9 @@ default_value varchar(100), -- column type for oracle (i.e. text, varchar(50), integer, ...) column_type varchar(100), - creation_date timestamp, + creation_date timestamp(0), active_p boolean default 't', - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -1212,9 +1212,9 @@ field_name varchar(100), default_value varchar(100), column_type varchar(100), - creation_date timestamp, + creation_date timestamp(0), active_p boolean default 't', - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1250,14 +1250,14 @@ -- this table stores the values create table ec_custom_product_field_values ( product_id integer not null primary key references ec_products, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); create table ec_custom_p_field_values_audit ( product_id integer, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1291,7 +1291,7 @@ -- often will not be known user_id integer references users, ip_address varchar(20) not null, - start_time timestamp, + start_time timestamp(0), http_user_agent varchar(4000) ); @@ -1343,11 +1343,11 @@ -- information recorded upon FSM state changes -- we need this to figure out if order is stale -- and should be offered up for removal - in_basket_date timestamp, - confirmed_date timestamp, - authorized_date timestamp, - voided_date timestamp, - expired_date timestamp, + in_basket_date timestamp(0), + confirmed_date timestamp(0), + authorized_date timestamp(0), + voided_date timestamp(0), + expired_date timestamp(0), -- base shipping, which is added to the amount charged for each item shipping_charged numeric, shipping_refunded numeric, @@ -1399,18 +1399,18 @@ -- shipments. -- a trigger fills address_id in automatically if it's null address_id integer references ec_addresses, - shipment_date timestamp not null, - expected_arrival_date timestamp, + shipment_date timestamp(0)not null, + expected_arrival_date timestamp(0), carrier varchar(50), -- e.g., 'fedex' tracking_number varchar(24), -- only if we get confirmation from carrier that the goods -- arrived on a specific date - actual_arrival_date timestamp, + actual_arrival_date timestamp(0), -- arbitrary info from carrier, e.g., 'Joe Smith signed for it' actual_arrival_detail varchar(4000), -- for things that aren't really shipped like services shippable_p boolean default 't', - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20) ); @@ -1441,13 +1441,13 @@ shipment_id integer, order_id integer, address_id integer, - shipment_date timestamp, - expected_arrival_date timestamp, + shipment_date timestamp(0), + expected_arrival_date timestamp(0), carrier varchar(50), tracking_number varchar(24), - actual_arrival_date timestamp, + actual_arrival_date timestamp(0), actual_arrival_detail varchar(4000), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1488,7 +1488,7 @@ order_id integer not null references ec_orders, -- not really necessary because it's in ec_financial_transactions refund_amount numeric not null, - refund_date timestamp not null, + refund_date timestamp(0)not null, refunded_by integer not null references users, refund_reasons varchar(4000) ); @@ -1508,13 +1508,13 @@ style_choice varchar(4000), shipment_id integer references ec_shipments, -- this is the date that user put this item into their shopping basket - in_cart_date timestamp, - voided_date timestamp, + in_cart_date timestamp(0), + voided_date timestamp(0), voided_by integer references users, - expired_date timestamp, + expired_date timestamp(0), item_state varchar(50) default 'in_basket', -- NULL if not received back - received_back_date timestamp, + received_back_date timestamp(0), -- columns for reporting (e.g., what was done, what was made) price_charged numeric, price_refunded numeric, @@ -1693,7 +1693,7 @@ -- the preloaded template) default_template integer default 1 not null references ec_templates, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -1707,7 +1707,7 @@ add_exp_amount_per_item numeric, add_exp_amount_by_weight numeric, default_template integer, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1749,7 +1749,7 @@ tax_rate numeric not null, -- charge tax on shipping? shipping_p boolean not null, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -1758,7 +1758,7 @@ usps_abbrev char(2), tax_rate numeric, shipping_p boolean, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1823,7 +1823,7 @@ price_guarantee_policy varchar(4000), delivery_policy varchar(4000), installation_policy varchar(4000), - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -1851,7 +1851,7 @@ price_guarantee_policy varchar(4000), delivery_policy varchar(4000), installation_policy varchar(4000), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -1929,7 +1929,7 @@ price_guarantee_policy varchar(4000), delivery_policy varchar(4000), installation_policy varchar(4000), - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -1956,7 +1956,7 @@ price_guarantee_policy varchar(4000), delivery_policy varchar(4000), installation_policy varchar(4000), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -2022,10 +2022,10 @@ stock_status char(1) check (stock_status in ('o','q','m','s','i')), special_offer_p boolean, special_offer_html varchar(500), - offer_begins timestamp not null, - offer_ends timestamp not null, + offer_begins timestamp(0)not null, + offer_ends timestamp(0)not null, deleted_p boolean default 'f', - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -2050,10 +2050,10 @@ stock_status char(1) check (stock_status in ('o','q','m','s','i')), special_offer_p boolean, special_offer_html varchar(500), - offer_begins timestamp, - offer_ends timestamp, + offer_begins timestamp(0), + offer_ends timestamp(0), deleted_p boolean default 'f', - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), -- This differs from the deleted_p column! @@ -2110,14 +2110,14 @@ -- entire amount is used up (to speed up -- queries) amount_remaining_p boolean default 't', - issue_date timestamp, - authorized_date timestamp, - claimed_date timestamp, + issue_date timestamp(0), + authorized_date timestamp(0), + claimed_date timestamp(0), -- customer service rep who issued it issued_by integer references users, -- customer who purchased it purchased_by integer references users, - expires timestamp, + expires timestamp(0), user_id integer references users, -- if it's unclaimed, claim_check will be filled in, -- and user_id won't be filled in @@ -2128,10 +2128,10 @@ certificate_to varchar(100), certificate_from varchar(100), recipient_email varchar(100), - voided_date timestamp, + voided_date timestamp(0), voided_by integer references users, reason_for_void varchar(4000), - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null, check (user_id is not null or claim_check is not null) @@ -2173,21 +2173,21 @@ gift_certificate_id integer, gift_certificate_state varchar(50), amount numeric, - issue_date timestamp, - authorized_date timestamp, + issue_date timestamp(0), + authorized_date timestamp(0), issued_by integer, purchased_by integer, - expires timestamp, + expires timestamp(0), user_id integer, claim_check varchar(50), certificate_message varchar(200), certificate_to varchar(100), certificate_from varchar(100), recipient_email varchar(100), - voided_date timestamp, + voided_date timestamp(0), voided_by integer, reason_for_void varchar(4000), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -2226,7 +2226,7 @@ gift_certificate_id integer not null references ec_gift_certificates, order_id integer references ec_orders, amount_used numeric, - used_date timestamp, + used_date timestamp(0), amount_reinstated numeric, reinstated_date timestamp ); @@ -2251,7 +2251,7 @@ -- will have to get other info in order to identify the user create table ec_user_identification ( user_identification_id integer not null primary key, - date_added timestamp, + date_added timestamp(0), user_id integer references users, email varchar(100), first_names varchar(100), @@ -2290,7 +2290,7 @@ customer_service_rep integer references users, user_identification_id integer not null references ec_user_identification, - interaction_date timestamp, + interaction_date timestamp(0), interaction_originator varchar(20) not null, -- e.g. customer, customer-service-rep, automatic interaction_type varchar(30) not null, -- e.g. email, phone_call -- will be filled in if the customer-originated interaction is @@ -2328,8 +2328,8 @@ order_id integer references ec_orders, -- may be null if this issue isn't associated with a gift certificate gift_certificate_id integer references ec_gift_certificates, - open_date timestamp not null, - close_date timestamp, + open_date timestamp(0)not null, + close_date timestamp(0), -- customer service reps who closed the issue closed_by integer references users, -- we never really delete issues @@ -2394,7 +2394,7 @@ -- which picklist this item is in picklist_name varchar(100), sort_key numeric, - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -2404,7 +2404,7 @@ picklist_item varchar(100), picklist_name varchar(100), sort_key numeric, - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -2465,7 +2465,7 @@ -- ec_cs_issue_type_map for the issue that will be created -- when the message is sent issue_type_list varchar(100), - last_modified timestamp not null, + last_modified timestamp(0)not null, last_modifying_user integer not null references users, modified_ip_address varchar(20) not null ); @@ -2478,7 +2478,7 @@ variables varchar(1000), when_sent varchar(1000), issue_type_list varchar(100), - last_modified timestamp, + last_modified timestamp(0), last_modifying_user integer, modified_ip_address varchar(20), delete_p boolean default 'f' @@ -2550,15 +2550,15 @@ create table ec_spam_log ( spam_id integer not null primary key, - spam_date timestamp, + spam_date timestamp(0), spam_text varchar(4000), -- the following are all criteria used in choosing the users to be spammed mailing_list_category_id integer references ec_categories, mailing_list_subcategory_id integer references ec_subcategories, mailing_list_subsubcategory_id integer references ec_subsubcategories, user_class_id integer references ec_user_classes, product_id integer references ec_products, - last_visit_start_date timestamp, + last_visit_start_date timestamp(0), last_visit_end_date timestamp ); @@ -2606,12 +2606,12 @@ -- the f is mainly just for reassurance; we only capture ones with t) -- There's no need to set this for refunds. Refunds are always to be captured. to_be_captured_p boolean, - inserted_date timestamp not null, - authorized_date timestamp, + inserted_date timestamp(0)not null, + authorized_date timestamp(0), -- set when to_be_captured_p becomes 't'; used in cron jobs - to_be_captured_date timestamp, - marked_date timestamp, - refunded_date timestamp, + to_be_captured_date timestamp(0), + marked_date timestamp(0), + refunded_date timestamp(0), -- if the transaction failed, this will keep the cron jobs from continuing -- to retry it failed_p boolean default 'f', @@ -2663,13 +2663,13 @@ create table ec_problems_log ( problem_id integer not null primary key, - problem_date timestamp, + problem_date timestamp(0), problem_details varchar(4000), -- if it's related to an order order_id integer references ec_orders, -- if it's related to a gift certificate gift_certificate_id integer references ec_gift_certificates, - resolved_date timestamp, + resolved_date timestamp(0), resolved_by integer references users ); Index: openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-oracle.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-oracle.xql 12 Sep 2002 22:45:47 -0000 1.4 +++ openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-oracle.xql 30 Nov 2002 17:31:18 -0000 1.5 @@ -22,4 +22,39 @@ + + + select f.transaction_amount, f.transaction_id, c.creditcard_type, p.first_names || ' ' || p.last_name as card_name, + c.creditcard_number as card_number, substr(creditcard_expire,1,2) as card_exp_month, substr(creditcard_expire,4,2) as card_exp_year, c.creditcard_type, + a.zip_code as billing_zip, + a.line1 as billing_address, + a.city as billing_city, + nvl(a.usps_abbrev, a.full_state_name) as billing_state, + a.country_code as billing_country + from ec_financial_transactions f, ec_creditcards c, persons p, ec_addresses a + where transaction_id = :transaction_id + and f.creditcard_id = c.creditcard_id + and c.user_id = p.person_id + and c.billing_address = a.address_id + + + + + + select t.refunded_transaction_id, t.transaction_amount, + c.creditcard_number as card_number, substr(creditcard_expire,1,2) as card_exp_month, substr(creditcard_expire,4,2) as card_exp_year, c.creditcard_type, + p.first_names || ' ' || p.last_name as card_name, + a.zip_code as billing_zip, + a.line1 as billing_address, + a.city as billing_city, + nvl(a.usps_abbrev, a.full_state_name) as billing_state, + a.country_code as billing_country + from ec_financial_transactions t, ec_creditcards c, persons p, ec_addresses a + where t.transaction_id = :transaction_id + and c.creditcard_id = t.creditcard_id + and c.user_id = p.person_id + and c.billing_address = a.address_id + + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql 12 Sep 2002 22:45:47 -0000 1.6 +++ openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql 30 Nov 2002 17:31:18 -0000 1.7 @@ -22,4 +22,39 @@ + + + select f.transaction_amount, f.transaction_id, c.creditcard_type, p.first_names || ' ' || p.last_name as card_name, + c.creditcard_number as card_number, substring(creditcard_expire for 2) as card_exp_month, substring(creditcard_expire from 4 for 2) as card_exp_year, c.creditcard_type, + a.zip_code as billing_zip, + a.line1 as billing_address, + a.city as billing_city, + coalesce(a.usps_abbrev, a.full_state_name) as billing_state, + a.country_code as billing_country + from ec_financial_transactions f, ec_creditcards c, persons p, ec_addresses a + where transaction_id = :transaction_id + and f.creditcard_id = c.creditcard_id + and c.user_id = p.person_id + and c.billing_address = a.address_id + + + + + + select t.refunded_transaction_id, t.transaction_amount, + c.creditcard_number as card_number, substring(creditcard_expire for 2) as card_exp_month, substring(creditcard_expire from 4 for 2) as card_exp_year, c.creditcard_type, + p.first_names || ' ' || p.last_name as card_name, + a.zip_code as billing_zip, + a.line1 as billing_address, + a.city as billing_city, + coalesce(a.usps_abbrev, a.full_state_name) as billing_state, + a.country_code as billing_country + from ec_financial_transactions t, ec_creditcards c, persons p, ec_addresses a + where t.transaction_id = :transaction_id + and c.creditcard_id = t.creditcard_id + and c.user_id = p.person_id + and c.billing_address = a.address_id + + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs.xql 12 Sep 2002 22:45:47 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs.xql 30 Nov 2002 17:31:18 -0000 1.4 @@ -26,23 +26,6 @@ - - - select f.transaction_amount, f.transaction_id, c.creditcard_type, p.first_names || ' ' || p.last_name as card_name, - c.creditcard_number as card_number, substring(creditcard_expire for 2) as card_exp_month, substring(creditcard_expire from 4 for 2) as card_exp_year, c.creditcard_type, - a.zip_code as billing_zip, - a.line1 as billing_address, - a.city as billing_city, - coalesce(a.usps_abbrev, a.full_state_name) as billing_state, - a.country_code as billing_country - from ec_financial_transactions f, ec_creditcards c, persons p, ec_addresses a - where transaction_id = :transaction_id - and f.creditcard_id = c.creditcard_id - and c.user_id = p.person_id - and c.billing_address = a.address_id - - - update ec_financial_transactions @@ -51,24 +34,6 @@ - - - select t.refunded_transaction_id, t.transaction_amount, - c.creditcard_number as card_number, substring(creditcard_expire for 2) as card_exp_month, substring(creditcard_expire from 4 for 2) as card_exp_year, c.creditcard_type, - p.first_names || ' ' || p.last_name as card_name, - a.zip_code as billing_zip, - a.line1 as billing_address, - a.city as billing_city, - coalesce(a.usps_abbrev, a.full_state_name) as billing_state, - a.country_code as billing_country - from ec_financial_transactions t, ec_creditcards c, persons p, ec_addresses a - where t.transaction_id = :transaction_id - and c.creditcard_id = t.creditcard_id - and c.user_id = p.person_id - and c.billing_address = a.address_id - - - update ec_financial_transactions Index: openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-init.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-init.tcl 30 Nov 2002 17:31:18 -0000 1.2 @@ -0,0 +1,45 @@ +# Schedule the recurring ecommerce procedures if there is a binding with a payment +# service contract. + +# @creation-date 02 October 2000 +# @author Bart Teeuwisse +# @cvs-id $Id: ecommerce-scheduled-init.tcl,v 1.2 2002/11/30 17:31:18 jeffd Exp $ + +if { [acs_sc_binding_exists_p "PaymentGateway" [ad_parameter PaymentGateway -default [ad_parameter -package_id [ec_id] PaymentGateway]]] } { + + # Scheduled proc scheduling: + # Nightly pi time + 1 = 4:14am + + ns_schedule_daily -thread 4 14 ec_calculate_product_purchase_combinations + + # A few times a day every three hours or so (slightly different + # intervals so they'll eventually space themselves out) + + set infrequent_base [expr 3 * 60 * 60] + + ad_schedule_proc -thread t [expr $infrequent_base + 0] ec_expire_old_carts + + ad_schedule_proc -thread t [expr $infrequent_base + 50] ec_unauthorized_transactions + + ad_schedule_proc -thread t [expr $infrequent_base + 10] ec_unmarked_transactions + + ad_schedule_proc -thread t [expr $infrequent_base + 200] ec_unrefunded_transactions + + # Often, every 10 - 15 minutes + + set frequent_base [expr 60 * 10] + + ad_schedule_proc -thread t [expr $frequent_base + 0] ec_sweep_for_payment_zombies + + ad_schedule_proc -thread t [expr $frequent_base + 25] ec_sweep_for_payment_zombie_gift_certificates + + ad_schedule_proc -thread t [expr $frequent_base + 50] ec_send_unsent_new_order_email + + ad_schedule_proc -thread t [expr $frequent_base + 100] ec_delayed_credit_denied + + ad_schedule_proc -thread t [expr $frequent_base + 150] ec_remove_creditcard_data + + ad_schedule_proc -thread t [expr $frequent_base + 200] ec_send_unsent_new_gift_certificate_order_email + + ad_schedule_proc -thread t [expr $frequent_base + 250] ec_send_unsent_gift_certificate_recipient_email +} Index: openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs.tcl 27 Sep 2002 04:46:45 -0000 1.9 +++ openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs.tcl 30 Nov 2002 17:31:18 -0000 1.10 @@ -1145,45 +1145,3 @@ } } } - -# Schedule these procedures if there is a binding with a payment -# service contract. - -if { [acs_sc_binding_exists_p "PaymentGateway" [ad_parameter PaymentGateway -default [ad_parameter -package_id [ec_id] PaymentGateway]]] } { - - # Scheduled proc scheduling: - # Nightly pi time + 1 = 4:14am - - ns_schedule_daily -thread 4 14 ec_calculate_product_purchase_combinations - - # A few times a day every three hours or so (slightly different - # intervals so they'll eventually space themselves out) - - set infrequent_base [expr 3 * 60 * 60] - - ad_schedule_proc -thread t [expr $infrequent_base + 0] ec_expire_old_carts - - ad_schedule_proc -thread t [expr $infrequent_base + 50] ec_unauthorized_transactions - - ad_schedule_proc -thread t [expr $infrequent_base + 10] ec_unmarked_transactions - - ad_schedule_proc -thread t [expr $infrequent_base + 200] ec_unrefunded_transactions - - # Often, every 10 - 15 minutes - - set frequent_base [expr 60 * 10] - - ad_schedule_proc -thread t [expr $frequent_base + 0] ec_sweep_for_payment_zombies - - ad_schedule_proc -thread t [expr $frequent_base + 25] ec_sweep_for_payment_zombie_gift_certificates - - ad_schedule_proc -thread t [expr $frequent_base + 50] ec_send_unsent_new_order_email - - ad_schedule_proc -thread t [expr $frequent_base + 100] ec_delayed_credit_denied - - ad_schedule_proc -thread t [expr $frequent_base + 150] ec_remove_creditcard_data - - ad_schedule_proc -thread t [expr $frequent_base + 200] ec_send_unsent_new_gift_certificate_order_email - - ad_schedule_proc -thread t [expr $frequent_base + 250] ec_send_unsent_gift_certificate_recipient_email -} Index: openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl 10 Sep 2002 22:22:36 -0000 1.5 +++ openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl 30 Nov 2002 17:31:18 -0000 1.6 @@ -151,7 +151,6 @@ # replaced ad_ssl_available_p with ec_ssl_available_p # which detects nsopenssl if { ![ec_ssl_available_p] } { - ns_log notice "debug 3: ec_ssl_available_p thinks ssl isn't installed" # there's no ssl # if ssl is required return an error message; otherwise, do nothing ad_return_error "No SSL available" " @@ -184,7 +183,6 @@ # so that links from both /ecommerce-instance/ and # and /ecommerce-instance/admin work set register_url "[ec_secure_location][ad_conn package_url]register/index?return_url=[ns_urlencode $secure_url]&http_id=$user_id&user_session_id=$user_session_id" - ad_returnredirect $register_url template::adp_abort } @@ -211,7 +209,7 @@ # we don't need to do anything return 1 } else { - if {([empty_string_p [ns_config ns/server/[ns_info server]/modules nsssl]]) || + if {([empty_string_p [ns_config ns/server/[ns_info server]/modules nsssl]]) && ([empty_string_p [ns_config ns/server/[ns_info server]/modules nsopenssl]])} { # we don't have ssl installed. Give up. return 0 Index: openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql 26 May 2002 04:36:50 -0000 1.5 +++ openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-oracle.xql 30 Nov 2002 17:31:18 -0000 1.6 @@ -89,5 +89,40 @@ (:gift_certificate_id, :order_id, least(to_number(:amount_available), to_number(:amount_owed)), sysdate) + + + + select item_id + from ec_items i, ec_products p + where i.order_id = :order_id + and i.product_id = p.product_id + and p.no_shipping_avail_p = 't' + and rownum=1 + + + + + + update ec_items + set item_state = 'to_be_shipped' + where ec_items.order_id = :order_id + and exists + (select product_id from ec_products p + where ec_items.product_id=p.product_id + and p.no_shipping_avail_p = 'f') + + + + + + update ec_items + set item_state = 'shipped', shipment_id = :shipment_id + where ec_items.order_id = :order_id + and exists + (select product_id from ec_products p + where ec_items.product_id=p.product_id + and p.no_shipping_avail_p = 't') + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql 26 May 2002 04:36:50 -0000 1.7 +++ openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs-postgresql.xql 30 Nov 2002 17:31:18 -0000 1.8 @@ -91,4 +91,37 @@ + + + select item_id + from ec_items i, ec_products p + where i.order_id = :order_id + and i.product_id = p.product_id + and p.no_shipping_avail_p = 't' + limit 1 + + + + + + update ec_items + set item_state = 'to_be_shipped' + from ec_products p + where ec_items.order_id = :order_id + and ec_items.product_id = p.product_id + and p.no_shipping_avail_p = 'f' + + + + + + update ec_items + set item_state = 'shipped', shipment_id = :shipment_id + from ec_products p + where ec_items.order_id = :order_id + and ec_items.product_id = p.product_id + and p.no_shipping_avail_p = 't' + + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/tcl/ecommerce-state-changes-procs.xql 30 Nov 2002 17:31:18 -0000 1.3 @@ -41,29 +41,7 @@ where order_id=:order_id - - - - update ec_items - set item_state = 'shipped', shipment_id = :shipment_id - from ec_products p - where ec_items.order_id = :order_id - and ec_items.product_id = p.product_id - and p.no_shipping_avail_p = 't' - - - - - update ec_items - set item_state = 'to_be_shipped' - from ec_products p - where ec_items.order_id = :order_id - and ec_items.product_id = p.product_id - and p.no_shipping_avail_p = 'f' - - - select user_id Index: openacs-4/packages/ecommerce/www/finalize-order-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/finalize-order-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/finalize-order-oracle.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/finalize-order-oracle.xql 30 Nov 2002 17:31:29 -0000 1.3 @@ -8,21 +8,20 @@ - select ec_gift_certificate_balance(:user_id) - from dual + select ec_gift_certificate_balance(:user_id) from dual - select ec_order_gift_cert_amount(:order_id) - from dual + select ec_order_gift_cert_amount(:order_id) from dual - + - select nvl(sum(i.price_charged),0) - nvl(sum(i.price_refunded),0) as soft_goods_cost + select nvl(sum(i.price_charged),0) - nvl(sum(i.price_refunded),0) as soft_goods_cost, + nvl(sum(i.price_tax_charged),0) - nvl(sum(i.price_tax_refunded),0) as soft_goods_tax from ec_items i, ec_products p where i.order_id = :order_id and i.item_state <> 'void' @@ -31,9 +30,12 @@ - + - select nvl(sum(i.price_charged),0) - nvl(sum(i.price_refunded),0) as hard_goods_cost + select nvl(sum(i.price_charged),0) - nvl(sum(i.price_refunded),0) as hard_goods_cost, + nvl(sum(i.price_tax_charged),0) - nvl(sum(i.shipping_refunded),0) as hard_goods_tax, + nvl(sum(i.shipping_charged),0) - nvl(sum(i.shipping_refunded),0) as hard_goods_shipping, + nvl(sum(i.shipping_tax_charged),0) - nvl(sum(i.shipping_tax_refunded),0) as hard_goods_shipping_tax from ec_items i, ec_products p where i.order_id = :order_id and i.item_state <> 'void' @@ -92,4 +94,16 @@ + + + select nvl(shipping_charged, 0) from ec_orders where order_id = :order_id + + + + + + select ec_tax(0, :order_shipping, :order_id) from dual + + + Index: openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql 30 Nov 2002 17:31:29 -0000 1.3 @@ -18,9 +18,10 @@ - + - select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0) as soft_goods_cost + select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0) as soft_goods_cost, + coalesce(sum(i.price_tax_charged),0) - coalesce(sum(i.price_tax_refunded),0) as soft_goods_tax from ec_items i, ec_products p where i.order_id = :order_id and i.item_state <> 'void' @@ -29,9 +30,12 @@ - + - select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0) as hard_goods_cost + select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0) as hard_goods_cost, + coalesce(sum(i.price_tax_charged),0) - coalesce(sum(i.shipping_refunded),0) as hard_goods_tax, + coalesce(sum(i.shipping_charged),0) - coalesce(sum(i.shipping_refunded),0) as hard_goods_shipping, + coalesce(sum(i.shipping_tax_charged),0) - coalesce(sum(i.shipping_tax_refunded),0) as hard_goods_shipping_tax from ec_items i, ec_products p where i.order_id = :order_id and i.item_state <> 'void' @@ -90,4 +94,16 @@ + + + select coalesce(shipping_charged, 0) from ec_orders where order_id = :order_id + + + + + + select ec_tax(0, :order_shipping, :order_id) + + + Index: openacs-4/packages/ecommerce/www/gift-certificate-order.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/gift-certificate-order.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/gift-certificate-order.adp 17 Sep 2002 03:36:34 -0000 1.2 +++ openacs-4/packages/ecommerce/www/gift-certificate-order.adp 30 Nov 2002 17:31:29 -0000 1.3 @@ -6,8 +6,8 @@
      -

      The perfect gift for anyone, gift certificates can be used to to - buy anything at @system_name@!

      +

      The perfect gift for anyone, gift certificates can be used to buy + anything at @system_name@!

      Order a Gift Certificate!

      About Gift Certificates

        Index: openacs-4/packages/ecommerce/www/product-search-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/product-search-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/product-search-oracle.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/product-search-oracle.xql 30 Nov 2002 17:31:29 -0000 1.3 @@ -16,7 +16,7 @@ and pseudo_contains(p.product_name || p.one_line_description || p.detailed_description || p.search_keywords, :search_text) > 0 order by score desc - + @@ -28,7 +28,7 @@ and pseudo_contains(p.product_name || p.one_line_description || p.detailed_description || p.search_keywords, :search_text) > 0 order by score desc - + @@ -38,6 +38,6 @@ where pseudo_contains(p.product_name || p.one_line_description || p.detailed_description || p.search_keywords, :search_text) > 0 order by score desc - + Index: openacs-4/packages/ecommerce/www/product-search-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/product-search-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/product-search-postgresql.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/product-search-postgresql.xql 30 Nov 2002 17:31:29 -0000 1.3 @@ -16,7 +16,7 @@ and pseudo_contains(coalesce(p.product_name, '') || coalesce(p.one_line_description, '') || coalesce(p.detailed_description, '') || coalesce(p.search_keywords,''), :search_text) > 0 order by score desc - + @@ -28,7 +28,7 @@ and pseudo_contains(coalesce(p.product_name, '') || coalesce(p.one_line_description, '') || coalesce(p.detailed_description, '') || coalesce(p.search_keywords,''), :search_text) > 0 order by score desc - + @@ -38,6 +38,6 @@ where pseudo_contains(coalesce(p.product_name, '') || coalesce(p.one_line_description, '') || coalesce(p.detailed_description, '') || coalesce(p.search_keywords,''), :search_text) > 0 order by score desc - + Index: openacs-4/packages/ecommerce/www/product.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/product.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/product.tcl 17 Sep 2002 03:36:34 -0000 1.5 +++ openacs-4/packages/ecommerce/www/product.tcl 30 Nov 2002 17:31:29 -0000 1.6 @@ -184,7 +184,7 @@ } db_release_unused_handles -set context_bar [template::adp_parse [acs_root_dir]/packages/[ad_conn package_key]/www/contextbar [list context_addition $product_name]] +set context_bar [template::adp_parse [acs_root_dir]/packages/[ad_conn package_key]/www/contextbar [list context_addition [list $product_name]]] set ec_system_owner [ec_system_owner] set formatted_product [ns_adp_parse -string $template] Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql 26 May 2002 04:36:50 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql 30 Nov 2002 17:31:38 -0000 1.4 @@ -115,5 +115,19 @@ (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id) + + + + select nvl(shipping_charged, 0) + from ec_orders + where order_id = :order_id + + + + + select ec_tax(0, :order_shipping, :order_id) from dual + + + Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql 26 May 2002 04:36:50 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql 30 Nov 2002 17:31:38 -0000 1.4 @@ -106,4 +106,18 @@ + + + select coalesce(shipping_charged, 0) + from ec_orders + where order_id = :order_id + + + + + + select ec_tax(0, :order_shipping, :order_id) + + + Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql 19 Sep 2002 17:12:45 -0000 1.4 +++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.xql 30 Nov 2002 17:31:38 -0000 1.5 @@ -48,15 +48,7 @@ where item_id in ([join $item_id_list ", "]) - - - - select ${shipping_of_items}::numeric + shipping_charged - from ec_orders - where order_id=:order_id - - - + update ec_items Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-3-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-3-oracle.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-3-oracle.xql 30 Nov 2002 17:31:38 -0000 1.3 @@ -15,14 +15,14 @@ - select ec_tax(:tax_price_to_refund, 0, :order_id) + select nvl(ec_tax(:tax_price_to_refund, 0, :order_id),0) from dual - select ec_tax(0, $shipping_to_refund($item_id), :order_id) + select nvl(ec_tax(0, $shipping_to_refund($item_id), :order_id),0) from dual @@ -37,14 +37,14 @@ - select ec_tax(0, :base_shipping, :order_id) + select nvl(ec_tax(0, :base_shipping, :order_id),0) from dual - select ec_cash_amount_to_refund(:total_amount_to_refund, :order_id) + select nvl(ec_cash_amount_to_refund(:total_amount_to_refund, :order_id),0) from dual Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-3-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-3-postgresql.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-3-postgresql.xql 30 Nov 2002 17:31:38 -0000 1.3 @@ -15,13 +15,13 @@ - select ec_tax(:tax_price_to_refund, 0, :order_id) + select coalesce(ec_tax(:tax_price_to_refund, 0, :order_id),0) - select ec_tax(0, $shipping_to_refund($item_id), :order_id) + select coalesce(ec_tax(0, $shipping_to_refund($item_id), :order_id),0) @@ -35,13 +35,13 @@ - select ec_tax(0, :base_shipping, :order_id) + select coalesce(ec_tax(0, :base_shipping, :order_id),0) - select ec_cash_amount_to_refund(:total_amount_to_refund, :order_id) + select coalesce(ec_cash_amount_to_refund(:total_amount_to_refund, :order_id),0) Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-3.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-3.tcl 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-3.tcl 30 Nov 2002 17:31:38 -0000 1.3 @@ -81,7 +81,7 @@ set tax_price_to_refund $price_to_refund($item_id) set iteration_price_tax_to_refund [ec_min $price_tax_charged [db_string get_ec_tax " - select ec_tax(:tax_price_to_refund,0,:order_id) + select coalesce(ec_tax(:tax_price_to_refund,0,:order_id),0) from dual"]] set total_price_tax_to_refund [expr $total_price_tax_to_refund + $iteration_price_tax_to_refund] } @@ -99,7 +99,7 @@ set total_shipping_to_refund [expr $total_shipping_to_refund + $shipping_to_refund($item_id)] set iteration_shipping_tax_to_refund [ec_min $shipping_tax_charged [db_string get_it_shipping_tax_refund " - select ec_tax(0,$shipping_to_refund($item_id), $order_id) + select coalesce(ec_tax(0,$shipping_to_refund($item_id), $order_id),0) from dual"]] set total_shipping_tax_to_refund [expr $total_shipping_tax_to_refund + $iteration_shipping_tax_to_refund] } @@ -123,7 +123,7 @@ } else { set total_shipping_to_refund [expr $total_shipping_to_refund + $base_shipping_to_refund] set iteration_shipping_tax_to_refund [ec_min $base_shipping_tax [db_string get_base_shipping_it_refund " - select ec_tax(0,:base_shipping,:order_id) + select coalesce(ec_tax(0,:base_shipping,:order_id),0) from dual"]] set total_shipping_tax_to_refund [expr $total_shipping_tax_to_refund + $iteration_shipping_tax_to_refund] } @@ -139,7 +139,7 @@ # Determine how much of this will be refunded in cash set cash_amount_to_refund [db_string get_cash_refunded " - select ec_cash_amount_to_refund(:total_amount_to_refund,:order_id) + select nvl(ec_cash_amount_to_refund(:total_amount_to_refund,:order_id),0) from dual"] # Calculate gift certificate amount and tax to refund Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql 26 May 2002 04:36:50 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-4-oracle.xql 30 Nov 2002 17:31:38 -0000 1.4 @@ -123,4 +123,71 @@ + + + select * from ( + select transaction_id as charged_transaction_id, marked_date + from ec_financial_transactions + where order_id = :order_id + and transaction_type = 'charge' + and (transaction_amount - :refund_amount) < 0.01 + and (transaction_amount - :refund_amount) > 0 + and refunded_amount is null + and marked_date is not null + and failed_p = 'f' + order by transaction_id) + where rownum=1 + + + + + + select * from ( + select transaction_id as charged_transaction_id, (transaction_amount - nvl(refunded_amount, 0)) as unrefunded_amount, marked_date + from ec_financial_transactions + where order_id = :order_id + and transaction_type = 'charge' + and (transaction_amount - nvl(refunded_amount, 0)) > 0.01 + and marked_date is not null + and failed_p = 'f' + order by (transaction_amount - nvl(refunded_amount, 0)) desc + ) + where rownum=1 + + + + + + update ec_financial_transactions + set refunded_amount = nvl(refunded_amount, 0) + :refund_amount + where transaction_id = :charged_transaction_id + + + + + + update ec_financial_transactions + set refunded_amount = coalesce(refunded_amount, 0) + :unrefunded_amount + where transaction_id = :charged_transaction_id + + + + + + insert into ec_financial_transactions + (transaction_id, refunded_transaction_id, order_id, refund_id, creditcard_id, transaction_amount, transaction_type, inserted_date, to_be_captured_date) + values + (:refund_transaction_id, :charged_transaction_id, :order_id, :refund_id, :creditcard_id, :refund_amount, 'refund', sysdate, to_date(:scheduled_hour,'YYYY-MM-DD HH12:MI:SSAM')) + + + + + + insert into ec_financial_transactions + (transaction_id, refunded_transaction_id, order_id, refund_id, creditcard_id, transaction_amount, transaction_type, inserted_date, to_be_captured_date) + values + (:refund_transaction_id, :charged_transaction_id, :order_id, :refund_id, :creditcard_id, :unrefunded_amount, 'refund', sysdate, to_date(:scheduled_hour,'YYYY-MM-DD HH12:MI:SSAM')) + + + Index: openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql 26 May 2002 04:36:50 -0000 1.3 +++ openacs-4/packages/ecommerce/www/admin/orders/items-return-4-postgresql.xql 30 Nov 2002 17:31:38 -0000 1.4 @@ -171,4 +171,68 @@ + + + select transaction_id as charged_transaction_id, marked_date + from ec_financial_transactions + where order_id = :order_id + and transaction_type = 'charge' + and (transaction_amount - :refund_amount) < 0.01::numeric + and (transaction_amount - :refund_amount) > 0::numeric + and refunded_amount is null + and marked_date is not null + and failed_p = 'f' + order by transaction_id + limit 1 + + + + + + select transaction_id as charged_transaction_id, (transaction_amount - coalesce(refunded_amount, 0)) as unrefunded_amount, marked_date + from ec_financial_transactions + where order_id = :order_id + and transaction_type = 'charge' + and (transaction_amount - coalesce(refunded_amount, 0)) > 0.01::numeric + and marked_date is not null + and failed_p = 'f' + order by (transaction_amount - coalesce(refunded_amount, 0)) desc + limit 1 + + + + + + update ec_financial_transactions + set refunded_amount = coalesce(refunded_amount, 0) + :refund_amount + where transaction_id = :charged_transaction_id + + + + + + update ec_financial_transactions + set refunded_amount = coalesce(refunded_amount, 0) + :unrefunded_amount + where transaction_id = :charged_transaction_id + + + + + + insert into ec_financial_transactions + (transaction_id, refunded_transaction_id, order_id, refund_id, creditcard_id, transaction_amount, transaction_type, inserted_date, to_be_captured_date) + values + (:refund_transaction_id, :charged_transaction_id, :order_id, :refund_id, :creditcard_id, :refund_amount, 'refund', sysdate, :scheduled_hour) + + + + + + insert into ec_financial_transactions + (transaction_id, refunded_transaction_id, order_id, refund_id, creditcard_id, transaction_amount, transaction_type, inserted_date, to_be_captured_date) + values + (:refund_transaction_id, :charged_transaction_id, :order_id, :refund_id, :creditcard_id, :unrefunded_amount, 'refund', sysdate, :scheduled_hour) + + + Index: openacs-4/packages/ecommerce/www/admin/orders/items-void.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/items-void.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/orders/items-void.xql 10 Jul 2001 20:33:53 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/orders/items-void.xql 30 Nov 2002 17:31:38 -0000 1.2 @@ -3,7 +3,7 @@ - select count(*) from ec_items where order_id=:order_id and product_id=:product_id and item_state<>'void' + select count(*) from ec_items where order_id=:order_id and product_id=:product_id and item_state <> 'void' Index: openacs-4/packages/ecommerce/www/admin/orders/one-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/one-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/one-oracle.xql 30 Nov 2002 17:31:38 -0000 1.3 @@ -0,0 +1,22 @@ + + + + + oracle + 8.1.6 + + + + + select o.order_state, o.creditcard_id, o.confirmed_date, o.cs_comments, + o.shipping_method, o.shipping_address, o.in_basket_date, + o.authorized_date, o.shipping_charged, o.voided_by, o.voided_date, + o.reason_for_void, u.user_id, u.first_names, u.last_name, c.billing_address + from ec_orders o, cc_users u, ec_creditcards c + where order_id=:order_id + and o.user_id = u.user_id(+) + and o.creditcard_id = c.creditcard_id(+) + + + + Index: openacs-4/packages/ecommerce/www/admin/orders/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/one-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/one-postgresql.xql 30 Nov 2002 17:31:38 -0000 1.2 @@ -0,0 +1,17 @@ + + + + + + select o.order_state, o.creditcard_id, o.confirmed_date, o.cs_comments, + o.shipping_method, o.shipping_address, o.in_basket_date, + o.authorized_date, o.shipping_charged, o.voided_by, o.voided_date, + o.reason_for_void, u.user_id, u.first_names, u.last_name, c.billing_address + from ec_orders o + left join cc_users u using (user_id) + left join ec_creditcards c using (creditcard_id) + where order_id=:order_id + + + + Index: openacs-4/packages/ecommerce/www/admin/orders/one.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/one.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/orders/one.xql 26 May 2002 04:36:50 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/orders/one.xql 30 Nov 2002 17:31:38 -0000 1.3 @@ -1,19 +1,6 @@ - - - - select o.order_state, o.creditcard_id, o.confirmed_date, o.cs_comments, - o.shipping_method, o.shipping_address, o.in_basket_date, - o.authorized_date, o.shipping_charged, o.voided_by, o.voided_date, - o.reason_for_void, u.user_id, u.first_names, u.last_name, c.billing_address - from ec_orders o - left join cc_users u using (user_id) - left join ec_creditcards c using (creditcard_id) - where order_id=:order_id - - - + select first_names || ' ' || last_name Index: openacs-4/packages/ecommerce/www/admin/products/categories-upload-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/categories-upload-2-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/products/categories-upload-2-postgresql.xql 24 Nov 2001 03:44:26 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/products/categories-upload-2-postgresql.xql 30 Nov 2002 17:31:49 -0000 1.2 @@ -1,10 +1,11 @@ + postgresql7.1 select product_id from ec_products - where sku = :sku; + where sku = :sku Index: openacs-4/packages/ecommerce/www/doc/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/doc/index.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/ecommerce/www/doc/index.adp 19 Sep 2002 03:02:18 -0000 1.3 +++ openacs-4/packages/ecommerce/www/doc/index.adp 30 Nov 2002 17:31:59 -0000 1.4 @@ -47,7 +47,7 @@

        @package_name@ is part of the Open Architecture Community System (OpenACS) originally developed by Eve Andersson then ported - from the Arsdigita Community System to OpenACS by Jerry Asher, Walter McGinnis, and furfly.net followed by a major overhaul