Index: openacs-4/contrib/obsolete-packages/bboard/bboard.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/bboard.info,v
diff -u -r1.4 -r1.5
--- openacs-4/contrib/obsolete-packages/bboard/bboard.info	21 Nov 2001 01:26:11 -0000	1.4
+++ openacs-4/contrib/obsolete-packages/bboard/bboard.info	16 Jan 2003 13:43:29 -0000	1.5
@@ -111,7 +111,6 @@
             <file type="query_file" db_type="postgresql" path="www/index-postgresql.xql"/>
             <file type="content_page" path="www/index.adp"/>
             <file type="content_page" path="www/index.tcl"/>
-            <file type="content_page" path="www/master.adp"/>
             <file type="content_page" path="www/message-approve.tcl"/>
             <file type="query_file" path="www/message-approve.xql"/>
             <file type="content_page" path="www/message-attach-2.tcl"/>
Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs-postgres.xql'.
Fisheye: No comparison available.  Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs-postgresql.xql'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs.tcl	3 Aug 2001 21:09:20 -0000	1.2
+++ openacs-4/packages/acs-subsite/tcl/plpgsql-utility-procs.tcl	16 Jan 2003 13:38:14 -0000	1.3
@@ -29,6 +29,12 @@
 	return [generate_attribute_parameter_call -prepend $prepend $function_name $the_list]
     }
 
+    ad_proc -private get_function_args {function_name} {
+        uncached version returns list of lists args
+        called from generate_attribute_parameter_call
+    } { 
+        return [db_list_of_lists get_function_args {}]
+    }
 
     ad_proc -public generate_attribute_parameter_call {
 	{ -prepend "" }
@@ -41,14 +47,8 @@
 	@creation-date 07/2001
 
     } {
-	ns_log Notice "*** $function_name [join $pairs "\n"]"
 	# Get the list of real args to the function
-	set real_args [db_list_of_lists get_function_args "
-	    select arg_name, arg_default
-	      from acs_function_args
-	     where function = upper(:function_name)
-	     order by arg_seq
-	"]
+	set real_args [util_memoize [list plpgsql_utility::get_function_args $function_name]]
 
 	foreach row $pairs {
 	    set attr [string trim [lindex $row 0]]
@@ -84,12 +84,7 @@
 	@creation-date 07/2001
 
     } {
-	return [db_string fetch_type "
-	       select data_type
-	         from user_tab_columns
-		where table_name = upper(:table)
-		  and column_name = upper(:column)
-	"]
+	return [db_string fetch_type {}]
     }
 
     ad_proc -public generate_attribute_parameters { 
Index: openacs-4/packages/acs-subsite/www/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/Attic/index-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-subsite/www/index-oracle.xql	30 Apr 2001 20:07:31 -0000	1.1
+++ openacs-4/packages/acs-subsite/www/index-oracle.xql	16 Jan 2003 13:38:49 -0000	1.2
@@ -19,6 +19,7 @@
     from site_nodes n
    where n.parent_id = :node_id
     and n.object_id is not null
+   order by name
 
       </querytext>
 </fullquery>
Index: openacs-4/packages/acs-subsite/www/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/Attic/index-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/index-postgresql.xql	30 Apr 2001 20:07:31 -0000	1.3
+++ openacs-4/packages/acs-subsite/www/index-postgresql.xql	16 Jan 2003 13:38:49 -0000	1.4
@@ -19,6 +19,7 @@
     from site_nodes n
    where n.parent_id = :node_id
     and n.object_id is not null
+   order by name
 
       </querytext>
 </fullquery>
Index: openacs-4/packages/acs-subsite/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/index.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/index.adp	16 Sep 2002 12:58:04 -0000	1.4
+++ openacs-4/packages/acs-subsite/www/index.adp	16 Jan 2003 13:38:49 -0000	1.5
@@ -13,9 +13,11 @@
  </else>
 
  <if @admin_p@ eq 1> 
-  <li> <a href="admin/">Administration</a></li>
+  <p>
+   <li> <a href="admin/">@subsite_name@ Administration</a></li>
+  </p>
  </if>
 </ul>
 
-<if @user_id@ eq 0><a href="/register/?return_url=/">login</a></if>
-<else><a href="register/logout">logout</a></else>
+<if @user_id@ eq 0><a href="@login_url@">Login</a></if>
+<else><a href="register/logout">Logout</a></else>
Index: openacs-4/packages/acs-subsite/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/index.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/www/index.tcl	16 Sep 2002 12:58:04 -0000	1.5
+++ openacs-4/packages/acs-subsite/www/index.tcl	16 Jan 2003 13:38:49 -0000	1.6
@@ -28,11 +28,8 @@
 
 set node_id [ad_conn node_id]
 
-db_multirow nodes site_nodes {
-  select site_node.url(n.node_id) as url, acs_object.name(n.object_id) as name
-    from site_nodes n
-   where n.parent_id = :node_id
-    and n.object_id is not null
-}
+db_multirow nodes site_nodes {}
 
+set login_url "register/?[export_vars { { return_url {[ad_conn url]}} }]"
+
 ad_return_template
Index: openacs-4/packages/acs-subsite/www/admin/host-node-map/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/host-node-map/index.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/admin/host-node-map/index.tcl	18 Sep 2002 14:54:50 -0000	1.4
+++ openacs-4/packages/acs-subsite/www/admin/host-node-map/index.tcl	16 Jan 2003 13:39:35 -0000	1.5
@@ -29,6 +29,7 @@
 db_foreach node_list {
     select name, node_id
     from site_nodes
+    order by name
 } {
     append nodes "<input type=radio name=root value=$node_id> /$name<br>"
 }
Index: openacs-4/packages/acs-subsite/www/admin/host-node-map/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/host-node-map/index.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-subsite/www/admin/host-node-map/index.xql	10 Oct 2001 18:15:13 -0000	1.1
+++ openacs-4/packages/acs-subsite/www/admin/host-node-map/index.xql	16 Jan 2003 13:39:35 -0000	1.2
@@ -7,6 +7,7 @@
 
           select name, node_id
 	  from site_nodes
+          order by name
       
       </querytext>
 </fullquery>
Index: openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl	4 Dec 2002 16:41:17 -0000	1.10
+++ openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl	16 Jan 2003 13:40:07 -0000	1.11
@@ -202,6 +202,11 @@
 	doc_body_append "<option value=$package_key>$pretty_name</option>\n"
       }
 
+      # If this is a site-wide admin, offer a link to the package manager
+      if { [ad_permission_p 0 admin] } {
+          doc_body_append "<option value=\"/new\">--Install new package--</option>\n"
+      }
+
       doc_body_append "
         </select>
         </td>
Index: openacs-4/packages/acs-subsite/www/admin/site-map/package-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/package-new.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/www/admin/site-map/package-new.tcl	20 Dec 2002 13:58:16 -0000	1.5
+++ openacs-4/packages/acs-subsite/www/admin/site-map/package-new.tcl	16 Jan 2003 13:40:07 -0000	1.6
@@ -15,6 +15,11 @@
     root_id:integer,optional
 }
 
+if { [string equal $package_key "/new"] } {
+    ad_returnredirect "/acs-admin/apm/packages-install"
+    ad_script_abort
+}
+
 set context_id [db_string context_id {
     select parent.object_id as context_id
     from   site_nodes parent, site_nodes child
Index: openacs-4/packages/acs-subsite/www/permissions/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/index-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/permissions/index-oracle.xql	28 Nov 2001 18:39:39 -0000	1.2
+++ openacs-4/packages/acs-subsite/www/permissions/index-oracle.xql	16 Jan 2003 13:40:36 -0000	1.3
@@ -5,15 +5,20 @@
 
 <fullquery name="adminable_objects">      
       <querytext>
-      
-  select distinct o.object_id, acs_object.name(o.object_id) as name
-  from acs_objects o, all_object_party_privilege_map map
-  where map.object_id = o.object_id
-    and map.party_id = :user_id
-    and map.privilege = 'admin'
-
+ select o.object_id, acs_object.name(o.object_id) as name, context_id, object_type,
+    (case when o.object_id = :root then 0 else 1 end) as child
+  from acs_objects o
+  where exists (
+    SELECT 1 
+      FROM all_object_party_privilege_map map
+     WHERE map.object_id = o.object_id
+       and map.party_id = :user_id
+       and map.privilege = 'admin')
+    and (o.object_id = :root or o.context_id = :root)
+    order by child, object_type, name      
       </querytext>
 </fullquery>
 
  
 </queryset>
+
Index: openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql	13 Dec 2001 02:00:01 -0000	1.4
+++ openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql	16 Jan 2003 13:40:36 -0000	1.5
@@ -5,13 +5,16 @@
 
 <fullquery name="adminable_objects">      
       <querytext>
-      
-  select distinct o.object_id, acs_object__name(o.object_id) as name
-  from acs_objects o, all_object_party_privilege_map map
-  where map.object_id = o.object_id
-    and map.party_id = :user_id
-    and map.privilege = 'admin'
-
+ select o.object_id, acs_object__name(o.object_id) as name, context_id, object_type,
+    (case when o.object_id = :root then 0 else 1 end) as child
+  from acs_objects o
+  where exists ( SELECT 1 
+                   FROM acs_permissions_all map 
+                  WHERE map.object_id = o.object_id
+                    and map.grantee_id = :user_id
+                    and map.privilege = 'admin')
+    and (o.object_id = :root or o.context_id = :root)
+    order by child, object_type, name
       </querytext>
 </fullquery>
 
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/index.adp'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/acs-subsite/www/permissions/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-subsite/www/permissions/index.tcl	13 Mar 2001 22:59:26 -0000	1.1
+++ openacs-4/packages/acs-subsite/www/permissions/index.tcl	16 Jan 2003 13:40:37 -0000	1.2
@@ -1,46 +1,28 @@
 # packages/acs-core-ui/www/permissions/index.tcl
-
 ad_page_contract {
-  Display all objects that the user has admin on.
-
-  @author rhs@mit.edu
-  @creation-date 2000-08-29
-  @cvs-id $Id$
+    Display all objects that the user has admin on.
+    
+    Templated and changed to browse heirarchy by davis@xarg.net 
+    since all objects can be a *lot* of objects.
+    
+    @author rhs@mit.edu
+    @creation-date 2000-08-29
+    @cvs-id $Id$
+} { 
+    root:trim,integer,optional
 }
 
 set user_id [ad_maybe_redirect_for_registration]
 
-doc_body_append "[ad_header "Permissions"]
+set context "Permissions"
 
-<h2>Permissions</h2>
-
-[ad_context_bar "Permissions"]
-<hr>
-
-<form method=\"get\" action=\"one\">
-Select an Object by Id:
-<input name=\"object_id\" type=\"text\"> <input value=\"Continue\" type=\"submit\">
-</form><p>
-
-You have admin on the following objects:
-
-<ul>
-"
-
-db_foreach adminable_objects {
-  select o.object_id, acs_object.name(o.object_id) as name
-  from acs_objects o, acs_object_party_privilege_map map
-  where map.object_id = o.object_id
-    and map.party_id = :user_id
-    and map.privilege = 'admin'
-} {
-  doc_body_append "  <li><a href=one?[export_url_vars object_id]>$name</a></li>\n"
-} if_no_rows {
-  doc_body_append "  <li>(none)</li>\n"
+if {![exists_and_not_null root]} { 
+    set root [ad_conn package_id]
 }
 
-doc_body_append "
-</ul>
+db_multirow objects adminable_objects { *SQL* }
 
-[ad_footer]
-"
+set security_context_root [acs_magic_object security_context_root]
+set default_context [acs_magic_object default_context]
+set admin_p [permission::permission_p -object_id $security_context_root -party_id $user_id -privilege admin]
+set subsite [ad_conn package_id]
Index: openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql	7 Dec 2001 22:45:41 -0000	1.3
+++ openacs-4/packages/acs-subsite/www/permissions/one-oracle.xql	16 Jan 2003 13:40:37 -0000	1.4
@@ -45,9 +45,9 @@
 <fullquery name="context">      
       <querytext>
       
-  select acs_object.name(context_id)
-  from acs_objects
-  where object_id = :object_id
+SELECT acs_object.name(context_id) as context_name, context_id, security_inherit_p
+  FROM acs_objects
+ WHERE object_id = :object_id
 
       </querytext>
 </fullquery>
@@ -56,7 +56,7 @@
 <fullquery name="children">      
       <querytext>
       
-	select object_id as c_object_id,acs_object.name(object_id) as c_name
+	select object_id as c_object_id,acs_object.name(object_id) as c_name, object_type as c_type
 	from acs_objects o
 	where context_id = :object_id
               and exists (select 1
Index: openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql	7 Dec 2001 22:46:40 -0000	1.4
+++ openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql	16 Jan 2003 13:40:37 -0000	1.5
@@ -44,27 +44,26 @@
  
 <fullquery name="context">      
       <querytext>
-      
-  select acs_object__name(context_id)
-  from acs_objects
-  where object_id = :object_id
 
+SELECT acs_object__name(context_id) as context_name, context_id, security_inherit_p
+  FROM acs_objects
+ WHERE object_id = :object_id
+
       </querytext>
 </fullquery>
 
  
 <fullquery name="children">      
       <querytext>
       
-	select object_id as c_object_id,acs_object__name(object_id) as c_name
+	select object_id as c_object_id,acs_object__name(object_id) as c_name, object_type as c_type
 	from acs_objects o
 	where context_id = :object_id
               and exists (select 1
-                          from all_object_party_privilege_map
+                          from acs_permissions_all
                           where object_id = o.object_id
-                          and party_id = :user_id
+                          and grantee_id = :user_id
                           and privilege = 'admin')    
-    
       </querytext>
 </fullquery>
 
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/permissions/one.adp'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/acs-subsite/www/pvt/unsubscribe-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/Attic/unsubscribe-2-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/pvt/unsubscribe-2-postgresql.xql	15 May 2001 16:59:01 -0000	1.3
+++ openacs-4/packages/acs-subsite/www/pvt/unsubscribe-2-postgresql.xql	16 Jan 2003 13:41:15 -0000	1.4
@@ -15,11 +15,7 @@
  
 <fullquery name="unused">      
       <querytext>
-      FIX ME PLSQL
-
-begin
-  membership_rel__deleted( rel_id => :rel_id );
-end;
+        begin return membership_rel__deleted(:rel_id); end;
       </querytext>
 </fullquery>
 
Index: openacs-4/packages/acs-tcl/acs-tcl.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/acs-tcl/acs-tcl.info	19 Jul 2002 23:17:15 -0000	1.23
+++ openacs-4/packages/acs-tcl/acs-tcl.info	16 Jan 2003 13:41:42 -0000	1.24
@@ -25,6 +25,7 @@
             <file type="package_spec" path="acs-tcl.info"/>
             <file type="tcl_procs" db_type="oracle" path="tcl/00-database-procs-oracle.tcl"/>
             <file type="tcl_procs" db_type="postgresql" path="tcl/00-database-procs-postgresql.tcl"/>
+            <file type="query_file" db_type="postgresql" path="tcl/00-database-procs-postgresql-postgresql.xql"/>
             <file type="tcl_procs" path="tcl/00-database-procs.tcl"/>
             <file type="tcl_procs" path="tcl/10-charset-compat-procs.tcl"/>
             <file type="tcl_init" path="tcl/20-memoize-init.tcl"/>
Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl	13 Sep 2002 10:43:57 -0000	1.12
+++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl	16 Jan 2003 13:41:57 -0000	1.13
@@ -171,7 +171,7 @@
         
         set person(person_id) $person_id
         set person(first_names) $first_names
-        set person(last_name) $last_names
+        set person(last_name) $last_name
 
         return [array get person]
     }
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 -r1.29 -r1.30
--- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl	11 Jan 2003 10:43:23 -0000	1.29
+++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl	16 Jan 2003 13:41:57 -0000	1.30
@@ -672,7 +672,7 @@
     set error_url [ad_conn url]
 
     if { [llength [info procs ds_collection_enabled_p]] == 1 && [ds_collection_enabled_p] } {
-	ds_add conn error $message
+	ad_call_proc_if_exists ds_add conn error $message
     }
 
     if {![ad_parameter -package_id [ad_acs_kernel_id] "RestrictErrorsToAdminsP" dummy 0] || \
Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl	15 Sep 2002 22:10:50 -0000	1.17
+++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl	16 Jan 2003 13:41:57 -0000	1.18
@@ -112,6 +112,9 @@
         returns an array representing the site node that matches the given url
 
         either url or node_id is required, if both are passed url is ignored
+
+        The array elements are: package_id, package_key, object_type, directory_p, 
+        instance_namem, pattern_p, parent_id, node_id, object_id, url.
     } {
         if {[empty_string_p $url] && [empty_string_p $node_id]} {
             error "site_node::get \"must pass in either url or node_id\""
@@ -131,6 +134,8 @@
         {-node_id:required}
     } {
         returns an array representing the site node for the given node_id
+        
+        @see site_node::get
     } {
         return [get_from_url -url [get_url -node_id $node_id]]
     }
@@ -139,6 +144,8 @@
         {-url:required}
     } {
         returns an array representing the site node that matches the given url
+
+        @see site_node::get
     } {
         # attempt an exact match
         if {[nsv_exists site_nodes $url]} {
@@ -332,9 +339,9 @@
     {-sync_p "t"}
     {-return "package_id"}
     parent_node_id
-    instance_name
+    url_path_component
     package_key
-    package_name
+    instance_name
 } {
     Creates a new instance of the specified package and mounts it
     beneath parent_node_id.
@@ -343,17 +350,16 @@
     @creation-date 2001-02-05
 
     @param sync_p If "t", we flush the in-memory site map
-    @param return You can specify what is returned: the package_id or node_id
-           (now ignored, always return package_id)
+    @param return (now ignored, always return package_id)
     @param parent_node_id The node under which we are mounting this
            application
-    @param instance_name The instance name for the new site node
+    @param url_path_component the url for the mounted instance (appended to the parent_node 
+           url)
     @param package_key The type of package we are mounting
-    @param package_name The name we want to give the package we are
-           mounting.
-    @return The package id of the newly mounted package or the new
-           node id, based on the value of $return
+    @param instance_name The name we want to give the package we are
+           mounting (used for the context bar string etc).
 
+    @return The package id of the newly mounted package
 } {
     # if there is an object mounted at the parent_node_id then use that
     # object_id, instead of the parent_node_id, as the context_id
@@ -365,11 +371,11 @@
     }
 
     return [site_node_apm_integration::new_site_node_and_package \
-        -name $instance_name \
-        -parent_id $parent_node_id \
-        -package_key $package_key \
-        -instance_name $package_name \
-        -context_id $context_id \
+                -name $url_path_component \
+                -parent_id $parent_node_id \
+                -package_key $package_key \
+                -instance_name $instance_name \
+                -context_id $context_id \
     ]
 }
 
Index: openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl	10 Sep 2002 22:22:14 -0000	1.2
+++ openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl	16 Jan 2003 13:41:57 -0000	1.3
@@ -1,7 +1,9 @@
 
 ad_library {
 
-    Procs to manage extensions to user data
+    Procs to manage extensions to user data.
+    This calls the UserData service contract for allowing packages to be notified 
+    of changes in user information.
 
     @author ben@openforce.net
     @creation-date 2002-01-22
@@ -16,6 +18,11 @@
         {-list_of_args:required}
         {-impl ""}
     } {
+    
+    	Dispatches (calls the service contract routines) the requested
+	method so that the operation gets executed.
+
+    } {
         if {[empty_string_p $impl]} {
             set extensions [list_extensions]
         } else {
Index: openacs-4/packages/acs-tcl/tcl/user-extensions-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/user-extensions-procs.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-tcl/tcl/user-extensions-procs.xql	23 Jan 2002 02:06:53 -0000	1.1
+++ openacs-4/packages/acs-tcl/tcl/user-extensions-procs.xql	16 Jan 2003 13:41:57 -0000	1.2
@@ -5,11 +5,14 @@
 
 <fullquery name="acs_user_extension::list_extensions.select_extensions">
 <querytext>
-select impl_name from acs_sc_impls, acs_sc_bindings, acs_sc_contracts
-where
-acs_sc_impls.impl_id = acs_sc_bindings.impl_id and
-acs_sc_contracts.contract_id= acs_sc_bindings.contract_id and 
-acs_sc_contracts.contract_name='UserData'
+  select 
+         impl_name from acs_sc_impls, acs_sc_bindings, acs_sc_contracts
+   where
+         acs_sc_impls.impl_id = acs_sc_bindings.impl_id 
+     and
+         acs_sc_contracts.contract_id = acs_sc_bindings.contract_id 
+     and 
+         acs_sc_contracts.contract_name = 'UserData'
 </querytext>
 </fullquery>
 
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 -r1.24 -r1.25
--- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl	10 Jan 2003 13:13:07 -0000	1.24
+++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl	16 Jan 2003 13:41:57 -0000	1.25
@@ -3280,7 +3280,6 @@
 # See the file "license.terms" for information on usage and redistribution
 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 # 
-# RCS: @(#) $Id$
 
 # Version 1.0 implemented Base64_Encode, Bae64_Decode
 # Version 2.0 uses the base64 namespace
Index: openacs-4/packages/acs-templating/resources/forms/wizard.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/wizard.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-templating/resources/forms/wizard.adp	13 Jan 2003 15:23:30 -0000	1.4
+++ openacs-4/packages/acs-templating/resources/forms/wizard.adp	16 Jan 2003 13:42:09 -0000	1.5
@@ -96,8 +96,6 @@
 
   </multiple>
 
-  </table>
-
 </td></tr>
 
 <noparse><if \@buttons:rowcount\@ gt 0></noparse>
Index: openacs-4/packages/adserver/adserver.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/adserver/adserver.info,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/adserver/adserver.info	23 Sep 2002 23:32:07 -0000	1.3
+++ openacs-4/packages/adserver/adserver.info	16 Jan 2003 13:42:37 -0000	1.4
@@ -18,7 +18,7 @@
         <release-date>2001-07-09</release-date>
         <vendor url="www.furfly.net">furfly.net, LLC</vendor>
 
-        <provides url="acs-adserver" version="4.2"/>
+        <provides url="adserver" version="4.2"/>
         <requires url="acs-kernel" version="4.0"/>
 
         <files>
@@ -68,7 +68,6 @@
             <file type="query_file" path="www/admin/delete-adv.xql"/>
             <file type="content_page" path="www/admin/index.tcl"/>
             <file type="query_file" path="www/admin/index.xql"/>
-            <file type="content_page" path="www/admin/master.adp"/>
             <file type="content_page" path="www/admin/one-adv-detailed-stats.tcl"/>
             <file type="query_file" path="www/admin/one-adv-detailed-stats.xql"/>
             <file type="content_page" path="www/admin/one-adv-group.tcl"/>
@@ -91,7 +90,6 @@
             <file type="content_page" path="www/default.tcl"/>
             <file type="content_page" path="www/admin/default.tcl"/>
             <file type="query_file" path="www/index.xql"/>
-            <file type="content_page" path="www/master.adp"/>
             <file type="content_page" path="www/view-group.tcl"/>
             <file type="query_file" path="www/view-group.xql"/>
         </files>
Index: openacs-4/packages/attachments/attachments.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/attachments.info,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/attachments/attachments.info	17 Sep 2002 21:08:37 -0000	1.7
+++ openacs-4/packages/attachments/attachments.info	16 Jan 2003 13:42:58 -0000	1.8
@@ -53,8 +53,6 @@
             <file type="query_file" path="www/go-to-attachment.xql"/>
             <file type="content_page" path="www/graphics/file.gif"/>
             <file type="content_page" path="www/graphics/folder.gif"/>
-            <file type="content_page" path="www/master.adp"/>
-            <file type="content_page" path="www/master.tcl"/>
             <file type="content_page" path="www/simple-add-2.tcl"/>
             <file type="content_page" path="www/simple-add.adp"/>
             <file type="content_page" path="www/simple-add.tcl"/>
Index: openacs-4/packages/attachments/www/go-to-attachment.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/attachments/www/go-to-attachment.tcl	7 Nov 2002 15:11:50 -0000	1.3
+++ openacs-4/packages/attachments/www/go-to-attachment.tcl	16 Jan 2003 13:43:15 -0000	1.4
@@ -26,7 +26,8 @@
     }
 
     content_item {
-        ad_returnredirect "download/$object_id?object_id=$object_id&attachment_id=$attachment_id"
+        set title [db_string select_attachment_title {}]
+        ad_returnredirect "download/[ad_urlencode $title]?object_id=$object_id&attachment_id=$attachment_id"
         ad_script_abort
         return
     }
Index: openacs-4/packages/attachments/www/go-to-attachment.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/attachments/www/go-to-attachment.xql	2 Jul 2002 19:41:20 -0000	1.1
+++ openacs-4/packages/attachments/www/go-to-attachment.xql	16 Jan 2003 13:43:15 -0000	1.2
@@ -23,5 +23,14 @@
 </querytext>
 </fullquery>
 
+
+  <fullquery name="select_attachment_title">      
+    <querytext>
+      select r.title 
+      from cr_revisions r, cr_items i 
+      where i.item_id = :attachment_id 
+      and r.revision_id  = i.live_revision
+    </querytext>
+  </fullquery>
  
 </queryset>
Index: openacs-4/packages/bug-tracker/www/bug-submission-instructions.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug-submission-instructions.html,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bug-tracker/www/bug-submission-instructions.html	20 Sep 2002 15:08:57 -0000	1.1
+++ openacs-4/packages/bug-tracker/www/bug-submission-instructions.html	16 Jan 2003 13:43:58 -0000	1.2
@@ -60,11 +60,11 @@
     like.  
     
     <hr>
-    <address><a href="mailto:davis@arsdigita.com">Jeff
+    <address><a href="mailto:davis@xarg.net">Jeff
 Davis</a></address>
 <!-- Created: Wed Feb 21 08:26:26 EST 2001 -->
 <!-- hhmts start -->
-Last modified: Fri Mar  2 10:24:36 EST 2001
+Last modified: Fri Dec 13 06:36:53 EST 2002
 <!-- hhmts end -->
   </body>
 </html>
Index: openacs-4/packages/bug-tracker/www/patch-list.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-list.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/bug-tracker/www/patch-list.adp	20 Sep 2002 15:22:53 -0000	1.2
+++ openacs-4/packages/bug-tracker/www/patch-list.adp	16 Jan 2003 13:43:58 -0000	1.3
@@ -11,11 +11,11 @@
 </multiple>
 ]
 </p>
-
 <p>
 Apply to version: [ @version_filter@ ]
 </p>
-
+<p>
+Display states: [ @state_filter@ ]
 <blockquote>
 <table>
 <if @patch_list:rowcount@ not eq 0>
Index: openacs-4/packages/bug-tracker/www/patch-list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-list.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/bug-tracker/www/patch-list.tcl	20 Sep 2002 15:22:53 -0000	1.2
+++ openacs-4/packages/bug-tracker/www/patch-list.tcl	16 Jan 2003 13:43:58 -0000	1.3
@@ -8,6 +8,7 @@
 } {
     {component_id:integer ""}
     {version_id:integer ""}
+    {status:trim ""}
 }
 
 set package_id [ad_conn package_id]
@@ -21,7 +22,7 @@
 
 multirow create components url label selected_p
 
-multirow append components "patch-list?[export_vars { version_id }]" "All Components" [empty_string_p $component_id]
+multirow append components "patch-list?[export_vars { version_id status }]" "All Components" [empty_string_p $component_id]
 
 multirow extend components loop_component_id
 
@@ -33,7 +34,7 @@
                     where p.component_id = c.component_id)
 } {
     set selected_p [string equal $component_id $loop_component_id]
-    set url "patch-list?[export_vars { version_id { component_id $loop_component_id} }]"
+    set url "patch-list?[export_vars { version_id status { component_id $loop_component_id} }]"
 }
 
 if { ![empty_string_p $component_id] } {
@@ -48,7 +49,7 @@
 if { [empty_string_p $version_id] } {
     lappend version_filter_list "<b>All Versions</b>"
 } else {
-    lappend version_filter_list "<a href=\"patch-list?[export_vars -url -override {{version_id {}}} {component_id}]\">All Versions</a>"
+    lappend version_filter_list "<a href=\"patch-list?[export_vars -url -override {{version_id {}}} {component_id status}]\">All Versions</a>"
 }
 db_foreach versions_for_patches {
     select version_id as loop_version_id,
@@ -61,21 +62,47 @@
     if { $version_id == $loop_version_id } {
         lappend version_filter_list "<b>$version_name</b>"
     } else {
-        lappend version_filter_list "<a href=\"patch-list?[export_vars -url -override {{version_id $loop_version_id}} {component_id}]\">$version_name</a>"
+        lappend version_filter_list "<a href=\"patch-list?[export_vars -url -override {{version_id $loop_version_id}} {component_id status} ]\">$version_name</a>"
     }
 }
 set version_filter [join $version_filter_list " | "]
+
+
+foreach statusi {{} open accepted refused} { 
+    if {[string equal $status $statusi]} { 
+	if {[empty_string_p $status]} { 
+	    lappend status_list "<b>All States</b>"
+	} else { 
+	    lappend status_list "<b>$status</b>"
+	}
+    } else { 
+	if {[empty_string_p $statusi]} { 
+	    lappend status_list "<a href=\"patch-list?[export_vars -url -override {{status $statusi}} {component_id version_id} ]\">All states</a>"
+	} { 
+	    lappend status_list "<a href=\"patch-list?[export_vars -url -override {{status $statusi}} {component_id version_id} ]\">$statusi</a>"
+	}
+    }
+}
+set state_filter [join $status_list " | "]
+
 if { ![empty_string_p $version_id] } {
     set version_where_clause "           and bt_patches.apply_to_version = :version_id"
 } else {
     set version_where_clause ""
 }
 
+if {![empty_string_p $status] } { 
+    set status_where_clause "           and bt_patches.status = :status"
+} else { 
+    set status_where_clause ""
+}
 
 # Create the pagination filter
 set where_clause "bt_patches.project_id = :package_id
            $component_where_clause   
-           $version_where_clause"
+           $version_where_clause
+           $status_where_clause"
+
 set patch_count [db_string patch_count "select count(*)
                                         from bt_patches
                                         where $where_clause"]
Index: openacs-4/packages/bug-tracker/www/patch-submission-instructions.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-submission-instructions.html,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bug-tracker/www/patch-submission-instructions.html	20 Sep 2002 15:08:57 -0000	1.1
+++ openacs-4/packages/bug-tracker/www/patch-submission-instructions.html	16 Jan 2003 13:43:58 -0000	1.2
@@ -12,7 +12,10 @@
       better, <code>cvs diff -u</code> and in either case you should
       then inspect the resulting patch file to insure that it is what
       you expect and manually remove any changes which should not be
-      part of the submitted patch.
+      part of the submitted patch. <em>For people not using GNU diff,
+        -u and -N may not work, use -c for context diffs, and
+        <code>diff /dev/null filename</diff> to generate a diff to
+          create a file</em>.
     </p>
 
     <h2>The best way: Make changes in a current cvs checkout</h2>
@@ -109,7 +112,7 @@
       <address><a href="mailto:davis@netcomuk.co.uk">Jeff Davis</a></address>
       <!-- Created: Sun Sep 15 12:11:31 EDT 2002 -->
       <!-- hhmts start -->
-Last modified: Tue Sep 17 04:57:41 EDT 2002
+Last modified: Fri Dec 13 06:39:02 EST 2002
 <!-- hhmts end -->
   </body>
 </html>
Index: openacs-4/packages/bulk-mail/bulk-mail.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/bulk-mail.info,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/bulk-mail/bulk-mail.info	29 Oct 2002 18:00:57 -0000	1.2
+++ openacs-4/packages/bulk-mail/bulk-mail.info	16 Jan 2003 13:44:20 -0000	1.3
@@ -38,7 +38,6 @@
             <file type="query_file" path="tcl/bulk-mail-procs.xql"/>
             <file type="content_page" path="www/index.adp"/>
             <file type="content_page" path="www/index.tcl"/>
-            <file type="content_page" path="www/master.adp"/>
             <file type="content_page" path="www/one.adp"/>
             <file type="content_page" path="www/one.tcl"/>
             <file type="query_file" path="www/one.xql"/>
Index: openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql	12 Jun 2002 13:53:13 -0000	1.2
+++ openacs-4/packages/bulk-mail/sql/postgresql/bulk-mail-package-create.sql	16 Jan 2003 13:44:34 -0000	1.3
@@ -5,6 +5,8 @@
 -- @version $Id$
 --
 
+select define_function_args('bulk_mail__new','bulk_mail_id,package_id,send_date,date_format,sent_p;f,from_addr,subject,reply_to,extra_headers,message,query,creation_date;now(),creation_user,creation_ip,context_id');
+
 create function bulk_mail__new (integer, integer, varchar, varchar, varchar, varchar, varchar, varchar, varchar, text, varchar, timestamp, integer, varchar, integer)
 returns integer as '
 declare
@@ -25,6 +27,8 @@
     bulk_mail__new__context_id alias for $15; -- default to null
     v_bulk_mail_id integer;
     v_send_date varchar(4000);
+    v_date_format varchar(4000);
+    v_sent_p boolean;
 begin
 
     v_bulk_mail_id := acs_object__new(
@@ -36,8 +40,9 @@
         bulk_mail__new__context_id
     );
 
-    if bulk_mail__new__date_format is null then
-        bulk_mail__new__date_format := ''YYYY MM DD HH24 MI SS'';
+    v_date_format := bulk_mail__new__date_format;
+    if v_date_format is null then
+        v_date_format := ''YYYY MM DD HH24 MI SS'';
     end if;
 
     v_send_date := bulk_mail__new__send_date;
@@ -46,8 +51,9 @@
         into v_send_date;
     end if;
 
-    if bulk_mail__new__sent_p is null then
-        bulk_mail__new__sent_p := ''f'';
+    v_sent_p := bulk_mail__new__sent_p;
+    if v_sent_p is null then
+        v_sent_p := ''f'';
     end if;
 
     insert
@@ -58,7 +64,7 @@
      extra_headers, message, query)
     values
     (v_bulk_mail_id, bulk_mail__new__package_id,
-     to_date(bulk_mail__new__send_date, bulk_mail__new__date_format), bulk_mail__new__sent_p,
+     to_date(v_send_date, v_date_format), v_sent_p,
      bulk_mail__new__from_addr, bulk_mail__new__subject, bulk_mail__new__reply_to,
      bulk_mail__new__extra_headers, bulk_mail__new__message, bulk_mail__new__query);
 
Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql	15 May 2002 22:07:52 -0000	1.1
+++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-oracle.xql	16 Jan 2003 13:44:51 -0000	1.2
@@ -24,7 +24,6 @@
             from bulk_mail_messages
             where bulk_mail_messages.sent_p = 'f'
             and bulk_mail_messages.send_date <= sysdate
-            for update
         </querytext>
     </fullquery>
 
Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql	15 May 2002 22:07:52 -0000	1.1
+++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs-postgresql.xql	16 Jan 2003 13:44:51 -0000	1.2
@@ -23,7 +23,6 @@
             from bulk_mail_messages
             where bulk_mail_messages.sent_p = 'f'
             and bulk_mail_messages.send_date <= now()
-            for update
         </querytext>
     </fullquery>
 
Index: openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl	29 Oct 2002 18:00:59 -0000	1.4
+++ openacs-4/packages/bulk-mail/tcl/bulk-mail-procs.tcl	16 Jan 2003 13:44:51 -0000	1.5
@@ -170,7 +170,15 @@
     } {
         ns_log notice "bulk_mail::sweep starting"
 
-        db_transaction {
+        ## JCD: this transaction is misguided since any code 
+        ## errors in any procs below would cause the messages 
+        ## already sent to be marked unsent.  Also, it seems to 
+        ## cause locking problems on oracle 
+        ## (per Caroline Meeks 
+        ## http://openacs.org/bugtracker/openacs/bug?bug_number=93
+
+        #db_transaction {
+
             foreach bulk_mail [db_list_of_ns_sets select_bulk_mails_to_send {}] {
                 foreach recipient [db_list_of_ns_sets select_bulk_mail_recipients [ns_set get $bulk_mail query]] {
 
@@ -235,7 +243,7 @@
                 set bulk_mail_id [ns_set get $bulk_mail bulk_mail_id]
                 db_dml mark_message_sent {}
             }
-        }
+        #}
 
         ns_log notice "bulk_mail::sweep ending"
     }
Index: openacs-4/packages/calendar/calendar.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/calendar.info,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/calendar/calendar.info	23 Sep 2002 23:32:10 -0000	1.15
+++ openacs-4/packages/calendar/calendar.info	16 Jan 2003 13:45:11 -0000	1.16
@@ -83,7 +83,6 @@
             <file type="query_file" db_type="postgresql" path="www/admin/index-postgresql.xql"/>
             <file type="content_page" path="www/admin/index.adp"/>
             <file type="content_page" path="www/admin/index.tcl"/>
-            <file type="content_page" path="www/admin/master.adp"/>
             <file type="query_file" db_type="oracle" path="www/admin/one-oracle.xql"/>
             <file type="query_file" db_type="postgresql" path="www/admin/one-postgresql.xql"/>
             <file type="content_page" path="www/admin/one.adp"/>
@@ -142,11 +141,10 @@
             <file type="documentation" path="www/doc/requirements.html"/>
             <file type="documentation" path="www/doc/thesisUsabilityTest.htm"/>
             <file type="content_page" path="www/ics/index.vuh"/>
-            <file type="content_page" path="www/index.adp"/>
             <file type="content_page" path="www/index.tcl"/>
+            <file type="query_file" path="www/index.xql"/>
             <file type="content_page" path="www/item-type-delete.tcl"/>
             <file type="content_page" path="www/item-type-new.tcl"/>
-            <file type="content_page" path="www/master.adp"/>
             <file type="content_page" path="www/view.adp"/>
             <file type="content_page" path="www/view.tcl"/>
         </files>
Index: openacs-4/packages/chat/chat.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/chat.info,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/chat/chat.info	9 Mar 2002 02:00:02 -0000	1.2
+++ openacs-4/packages/chat/chat.info	16 Jan 2003 13:45:37 -0000	1.3
@@ -54,7 +54,6 @@
             <file type="content_page" path="www/index.adp"/>
             <file type="content_page" path="www/index.tcl"/>
             <file type="content_page" path="www/java-chat.adp"/>
-            <file type="content_page" path="www/master.adp"/>
             <file type="content_page" path="www/message-delete-2.tcl"/>
             <file type="content_page" path="www/message-delete.adp"/>
             <file type="content_page" path="www/message-delete.tcl"/>
Index: openacs-4/packages/download/download.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/download.info,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/download/download.info	23 Feb 2002 05:15:27 -0000	1.6
+++ openacs-4/packages/download/download.info	16 Jan 2003 13:45:55 -0000	1.7
@@ -7,23 +7,21 @@
     <initial-install-p>f</initial-install-p>
     <singleton-p>f</singleton-p>
 
-    <version name="4.0a" url="http://www.arsdigita.com/acs-repository/download/apm/download-4.0a.apm">
+    <version name="4.1" url="http://www.arsdigita.com/acs-repository/download/apm/download-4.1.apm">
     <database-support>
         <database>oracle</database>
         <database>postgresql</database>
     </database-support>
-        <owner url="mailto:vkurup@massmed.org">Vinod Kurup</owner>
         <owner>Joseph Bank</owner>
-        <summary>ACS 4.x version of download module.  Supports the functionality required by the current acs-repository.</summary>
-        <release-date>2001-01-19</release-date>
+        <owner url="mailto:vinod@kurup.com">Vinod Kurup</owner>
+        <summary>OpenACS 4.x version of download module.  Supports the functionality required by the current acs-repository.</summary>
+        <release-date>2003-01-03</release-date>
         <vendor url="http://www.openacs.org/">OpenACS</vendor>
+        <description format="text/plain">Create an instance of the download module. Each instance has a repository_id which allows the download module to differentiate between different instances of the package.</description>
 
-        <provides url="download" version="4.0a"/>
-        <requires url="acs-content-repository" version="4.0.1"/>
+        <provides url="download" version="4.1"/>
         <requires url="acs-kernel" version="4.0"/>
-        <requires url="acs-mail" version="4.1"/>
-        <requires url="acs-tcl" version="4.0.2"/>
-        <requires url="acs-templating" version="4.1.2"/>
+        <requires url="acs-mail" version="4.6"/>
 
         <files>
             <file type="package_spec" path="download.info"/>
@@ -48,20 +46,21 @@
             <file type="content_page" path="www/admin/export-csv.tcl"/>
             <file type="content_page" path="www/admin/index.adp"/>
             <file type="content_page" path="www/admin/index.tcl"/>
-            <file type="content_page" path="www/admin/master.adp"/>
-            <file type="content_page" path="www/admin/master.tcl"/>
             <file type="query_file" db_type="oracle" path="www/admin/report-by-ip-oracle.xql"/>
             <file type="query_file" db_type="postgresql" path="www/admin/report-by-ip-postgresql.xql"/>
             <file type="content_page" path="www/admin/report-by-ip.adp"/>
             <file type="content_page" path="www/admin/report-by-ip.tcl"/>
+            <file type="query_file" path="www/admin/report-by-ip.xql"/>
             <file type="query_file" db_type="oracle" path="www/admin/report-by-user-oracle.xql"/>
             <file type="query_file" db_type="postgresql" path="www/admin/report-by-user-postgresql.xql"/>
             <file type="content_page" path="www/admin/report-by-user.adp"/>
             <file type="content_page" path="www/admin/report-by-user.tcl"/>
+            <file type="query_file" path="www/admin/report-by-user.xql"/>
             <file type="query_file" db_type="oracle" path="www/admin/report-one-ip-oracle.xql"/>
             <file type="query_file" db_type="postgresql" path="www/admin/report-one-ip-postgresql.xql"/>
             <file type="content_page" path="www/admin/report-one-ip.adp"/>
             <file type="content_page" path="www/admin/report-one-ip.tcl"/>
+            <file type="query_file" path="www/admin/report-one-ip.xql"/>
             <file type="query_file" db_type="oracle" path="www/admin/report-one-user-oracle.xql"/>
             <file type="query_file" db_type="postgresql" path="www/admin/report-one-user-postgresql.xql"/>
             <file type="content_page" path="www/admin/report-one-user.adp"/>
@@ -141,8 +140,6 @@
             <file type="content_page" path="www/index.adp"/>
             <file type="content_page" path="www/index.tcl"/>
             <file type="query_file" path="www/index.xql"/>
-            <file type="content_page" path="www/master.adp"/>
-            <file type="content_page" path="www/master.tcl"/>
             <file type="query_file" db_type="oracle" path="www/one-archive-oracle.xql"/>
             <file type="query_file" db_type="postgresql" path="www/one-archive-postgresql.xql"/>
             <file type="content_page" path="www/one-archive.adp"/>
Index: openacs-4/packages/download/www/admin/report-by-ip-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/report-by-ip-oracle.xql	22 May 2001 04:17:45 -0000	1.1
+++ openacs-4/packages/download/www/admin/report-by-ip-oracle.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -4,19 +4,15 @@
 <fullquery name="download_table">
       <querytext>
       
-    select min(u.last_name || ', ' || u.first_names) as user_name,
-           min(u.email) as email,
-           min(d.user_id) as user_id,
-           d.download_ip,
+    select d.download_ip,
            nvl(min(d.download_hostname),'unavailable') as download_hostname,
-           count(*) as num_downloads,
-           min('$downloaded') as downloaded
+           count(*) as num_downloads
      from download_downloads_repository d, cc_users u
-     where d.repository_id = $repository_id and
+     where d.repository_id = :repository_id and
            d.user_id = u.user_id
            [ad_dimensional_sql $dimensional where]
      group by d.download_ip
-     order by 2 desc
+     order by 2
 
       </querytext>
 </fullquery>
Index: openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql	22 May 2001 04:17:45 -0000	1.1
+++ openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -6,19 +6,15 @@
 <fullquery name="download_table">
       <querytext>
       
-    select min(u.last_name || ', ' || u.first_names) as user_name,
-           min(u.email) as email,
-           min(d.user_id) as user_id,
-           d.download_ip,
+    select d.download_ip,
            coalesce(min(d.download_hostname),'unavailable') as download_hostname,
-           count(*) as num_downloads,
-           min('$downloaded'::varchar) as downloaded
+           count(*) as num_downloads
      from download_downloads_repository d, cc_users u
-     where d.repository_id = $repository_id and
+     where d.repository_id = :repository_id and
            d.user_id = u.user_id
            [ad_dimensional_sql $dimensional where]
      group by d.download_ip
-     order by 2 desc
+     order by 2
 
       </querytext>
 </fullquery>
Index: openacs-4/packages/download/www/admin/report-by-ip.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/download/www/admin/report-by-ip.adp	6 Sep 2002 21:50:32 -0000	1.5
+++ openacs-4/packages/download/www/admin/report-by-ip.adp	16 Jan 2003 13:46:20 -0000	1.6
@@ -3,7 +3,11 @@
 <property name="context">@context@</property>
 
 <p>
-<a href=spam-users?@export_sql_query@>Spam Downloaders</a>
+<form method="post" action="spam-users">
+  @user_id_list_export@
+  <input type="submit" value="Spam Downloaders" />
+</form>
 </p>
+
 @dimensional_html@
 @table@
\ No newline at end of file
Index: openacs-4/packages/download/www/admin/report-by-ip.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/download/www/admin/report-by-ip.tcl	10 Sep 2002 22:22:35 -0000	1.6
+++ openacs-4/packages/download/www/admin/report-by-ip.tcl	16 Jan 2003 13:46:20 -0000	1.7
@@ -1,59 +1,47 @@
-# /packages/download/www/admin/all-user-downloads.tcl
+# /packages/download/www/admin/report-by-ip.tcl
 ad_page_contract {
+    List of IP addresses that have downloaded a specific archive
      
      @author jbank@arsdigita.com [jbank@arsdigita.com]
      @creation-date Wed Dec 13 13:39:29 2000
      @cvs-id $Id$
 } {
     {downloaded "1m"}
+} -properties {
+    context:onevalue
+    user_id_list_export:onevalue
+    dimensional_html:onevalue
+    table:onevalue
 }
 
 set repository_id [download_repository_id]
-##TODO: Add support for other
 
-# vinodk: put in the full query name so that when I
-#         pass this var to spam-users, it can find
-#         the right query
 set dimensional {
     {downloaded "Download Period" 1m {
-        {1d "last 24hrs" {where "[db_map dbqd.download.www.admin.report-by-ip.date_clause_1]"}}
-        {1w "last week"  {where "[db_map dbqd.download.www.admin.report-by-ip.date_clause_7]"}}
-        {1m "last month" {where "[db_map dbqd.download.www.admin.report-by-ip.date_clause_30]"}}
+        {1d "last 24hrs" {where "[db_map date_clause_1]"}}
+        {1w "last week"  {where "[db_map date_clause_7]"}}
+        {1m "last month" {where "[db_map date_clause_30]"}}
         {all "all" {}}}}
 }
 
 set table_def {
     {download_ip "From IP"
                {no_sort}
-               {<td><a href=report-one-ip?[export_url_vars download_ip downloaded]>$download_ip</a></td>}}
+               {<td><a href="report-one-ip?[export_url_vars download_ip downloaded]">$download_ip</a></td>}}
     {download_hostname "Hostname" {} {}}
     {num_downloads "# Downloads" {no_sort} {}}
 }
 
-set sql_query "
-    select min(u.last_name || ', ' || u.first_names) as user_name,
-           min(u.email) as email,
-           min(d.user_id) as user_id,
-           d.download_ip,
-           nvl(min(d.download_hostname),'unavailable') as download_hostname,
-           count(*) as num_downloads,
-           min('$downloaded') as downloaded
-     from download_downloads_repository d, cc_users u
-     where d.repository_id = $repository_id and
-           d.user_id = u.user_id
-           [ad_dimensional_sql $dimensional where]
-     group by d.download_ip
-     order by 2 desc
-"
-
-set export_sql_query [export_vars -url -sign {downloaded repository_id dimensional}]
-
 set dimensional_html [ad_dimensional $dimensional]
 set table [ad_table \
-        -Ttable_extra_html { width= 90% align=center} \
+        -Ttable_extra_html { width="90%" align="center" } \
         -bind [ad_tcl_vars_to_ns_set repository_id downloaded] \
-        download_table $sql_query $table_def ]
+               download_table { *SQL* } $table_def ]
 
+# query users to spam
+set user_id_list [db_list users_to_spam { *SQL* }]
+set user_id_list_export [export_vars -form -sign user_id_list]
+
 set context [list "Downloads by IP"]
 
 ad_return_template
\ No newline at end of file
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/download/www/admin/report-by-ip.xql'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/download/www/admin/report-by-user-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/report-by-user-oracle.xql	22 May 2001 04:17:45 -0000	1.1
+++ openacs-4/packages/download/www/admin/report-by-user-oracle.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -4,17 +4,16 @@
 <fullquery name="download_table">
       <querytext>
       
-    select min(u.last_name || ', ' || u.first_names) as user_name,
+    select d.user_id,
+           min(u.last_name || ', ' || u.first_names) as user_name,
            min(u.email) as email,
-           d.user_id,
-           count(*) as num_downloads,
-           min('$downloaded') as downloaded
+           count(*) as num_downloads
      from download_downloads_repository d, cc_users u
-     where d.repository_id = $repository_id and
+     where d.repository_id = :repository_id and
            d.user_id = u.user_id
            [ad_dimensional_sql $dimensional where]
      group by d.user_id
-     order by 2 desc
+     order by 2
 
       </querytext>
 </fullquery>
Index: openacs-4/packages/download/www/admin/report-by-user-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/report-by-user-postgresql.xql	22 May 2001 04:17:45 -0000	1.1
+++ openacs-4/packages/download/www/admin/report-by-user-postgresql.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -6,17 +6,16 @@
 <fullquery name="download_table">
       <querytext>
       
-    select min(u.last_name || ', ' || u.first_names) as user_name,
+    select d.user_id,
+           min(u.last_name || ', ' || u.first_names) as user_name,
            min(u.email) as email,
-           d.user_id,
-           count(*) as num_downloads,
-           min('$downloaded'::varchar) as downloaded
+           count(*) as num_downloads
      from download_downloads_repository d, cc_users u
-     where d.repository_id = $repository_id and
+     where d.repository_id = :repository_id and
            d.user_id = u.user_id
            [ad_dimensional_sql $dimensional where]
      group by d.user_id
-     order by 2 desc
+     order by 2
 
       </querytext>
 </fullquery>
Index: openacs-4/packages/download/www/admin/report-by-user.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/download/www/admin/report-by-user.adp	6 Sep 2002 21:50:32 -0000	1.4
+++ openacs-4/packages/download/www/admin/report-by-user.adp	16 Jan 2003 13:46:20 -0000	1.5
@@ -3,7 +3,11 @@
 <property name="context">@context@</property>
 
 <p>
-<a href=spam-users?@export_sql_query@>Spam Downloaders</a>
+<form method="post" action="spam-users">
+  @user_id_list_export@
+  <input type="submit" value="Spam Downloaders" />
+</form>
 </p>
+
 @dimensional_html@
 @table@
\ No newline at end of file
Index: openacs-4/packages/download/www/admin/report-by-user.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/download/www/admin/report-by-user.tcl	10 Sep 2002 22:22:35 -0000	1.6
+++ openacs-4/packages/download/www/admin/report-by-user.tcl	16 Jan 2003 13:46:20 -0000	1.7
@@ -1,55 +1,45 @@
-# /packages/download/www/admin/all-user-downloads.tcl
+# /packages/download/www/admin/report-by-user.tcl
 ad_page_contract {
-     
+     Show list of users who have downloaded a specified archive.
+
      @author jbank@arsdigita.com [jbank@arsdigita.com]
      @creation-date Wed Dec 13 13:39:29 2000
      @cvs-id $Id$
 } {
     {downloaded "1m"}
+} -properties {
+    context:onevalue
+    user_id_list_export:onevalue
+    dimensional_html:onevalue
+    table:onevalue
 }
 
 set repository_id [download_repository_id]
-##TODO: Add support for other
 
-# vinodk: put in the full query name so that when I
-#         pass this var to spam-users, it can find
-#         the right query
 set dimensional {
     {downloaded "Download Period" 1m {
-        {1d "last 24hrs" {where "[db_map dbqd.download.www.admin.report-by-user.date_clause_1]"}}
-        {1w "last week"  {where "[db_map dbqd.download.www.admin.report-by-user.date_clause_7]"}}
-        {1m "last month" {where "[db_map dbqd.download.www.admin.report-by-user.date_clause_30]"}}
+        {1d "last 24hrs" {where "[db_map date_clause_1]"}}
+        {1w "last week"  {where "[db_map date_clause_7]"}}
+        {1m "last month" {where "[db_map date_clause_30]"}}
         {all "all" {}}}}
 }
 
 set table_def {
     {user_name "User Name (Last name, first name)"
                {no_sort}
-               {<td><a href=report-one-user?[export_url_vars user_id downloaded]>$user_name</a> (<a href=mailto:$email>$email</a>)</td>}}
+               {<td><a href="report-one-user?[export_url_vars user_id downloaded]">$user_name</a> (<a href="mailto:$email">$email</a>)</td>}}
     {num_downloads "# Downloads" {no_sort} {}}
 }
 
-set sql_query "
-    select min(u.last_name || ', ' || u.first_names) as user_name,
-           min(u.email) as email,
-           d.user_id,
-           count(*) as num_downloads,
-           min('$downloaded') as downloaded
-     from download_downloads_repository d, cc_users u
-     where d.repository_id = $repository_id and
-           d.user_id = u.user_id
-           [ad_dimensional_sql $dimensional where]
-     group by d.user_id
-     order by 2 desc
-"
-
-set export_sql_query [export_vars -url -sign {downloaded repository_id dimensional}]
-
 set dimensional_html [ad_dimensional $dimensional]
 set table [ad_table \
-        -Ttable_extra_html { width= 90% align=center} \
+        -Ttable_extra_html { width="90%" align="center" } \
         -bind [ad_tcl_vars_to_ns_set repository_id downloaded] \
-        download_table $sql_query $table_def ]
+               download_table { *SQL* } $table_def ]
 
+# query users to spam
+set user_id_list [db_list users_to_spam { *SQL* }]
+set user_id_list_export [export_vars -form -sign user_id_list]
+
 set context [list "Downloads by User"]
 ad_return_template
\ No newline at end of file
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/download/www/admin/report-by-user.xql'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/download/www/admin/report-one-ip-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/download/www/admin/report-one-ip-oracle.xql	23 May 2001 16:35:03 -0000	1.2
+++ openacs-4/packages/download/www/admin/report-one-ip-oracle.xql	16 Jan 2003 13:46:20 -0000	1.3
@@ -4,21 +4,21 @@
 <fullquery name="download_table">
       <querytext>
 
-    select da.archive_name, 
+    select u.user_id,
+           u.last_name || ', ' || u.first_names as user_name,
+           u.email,
+           da.archive_name, 
            da.archive_id, 
            dar.revision_id,
            dar.version_name,
            d.download_date,
-           u.last_name || ', ' || u.first_names as user_name,
-           u.user_id,
-           u.email,
            nvl(d.download_hostname,'unavailable') as download_hostname,
            nvl2(d.reason_id, dr.reason, d.reason) as reason
       from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u
-     where da.repository_id = $repository_id
+     where da.repository_id = :repository_id
        and da.archive_id = dar.archive_id
        and d.revision_id = dar.revision_id
-       and d.download_ip = '$download_ip'
+       and d.download_ip = :download_ip
        and dr.download_reason_id(+) = d.reason_id
        and u.user_id = d.user_id
        [ad_dimensional_sql $dimensional where]
@@ -27,6 +27,7 @@
       </querytext>
 </fullquery>
 
+
 <partialquery name="date_clause_1">
       <querytext>
 
Index: openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql	22 May 2001 04:17:45 -0000	1.1
+++ openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -6,25 +6,25 @@
 <fullquery name="download_table">
       <querytext>
 
-    select da.archive_name, 
+    select u.user_id,
+           u.last_name || ', ' || u.first_names as user_name,
+           u.email,
+           da.archive_name, 
            da.archive_id, 
            dar.revision_id,
            dar.version_name,
            d.download_date,
-           u.last_name || ', ' || u.first_names as user_name,
-           u.user_id,
-           u.email,
            coalesce(d.download_hostname,'unavailable') as download_hostname,
            case when d.reason_id is null then d.reason else dr.reason end as reason
       from download_downloads d left join download_reasons dr 
 			on (d.reason_id=dr.download_reason_id),
 		   download_archives_obj da, 
 		   download_arch_revisions_obj dar, 
 		   cc_users u
-     where da.repository_id = $repository_id
+     where da.repository_id = :repository_id
        and da.archive_id = dar.archive_id
        and d.revision_id = dar.revision_id
-       and d.download_ip = '$download_ip'
+       and d.download_ip = :download_ip
        and u.user_id = d.user_id
        [ad_dimensional_sql $dimensional where]
        [ad_order_by_from_sort_spec $orderby $table_def]
Index: openacs-4/packages/download/www/admin/report-one-ip.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/download/www/admin/report-one-ip.adp	6 Sep 2002 21:50:32 -0000	1.4
+++ openacs-4/packages/download/www/admin/report-one-ip.adp	16 Jan 2003 13:46:20 -0000	1.5
@@ -3,7 +3,11 @@
 <property name="context">@context@</property>
 
 <p>
-<a href="spam-users.tcl?@export_sql_query@">Spam Downloaders</a>
+<form method="post" action="spam-users">
+  @user_id_list_export@
+  <input type="submit" value="Spam Downloaders" />
+</form>
 </p>
+
 @dimensional_html@
 @table@
\ No newline at end of file
Index: openacs-4/packages/download/www/admin/report-one-ip.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/download/www/admin/report-one-ip.tcl	10 Sep 2002 22:22:35 -0000	1.5
+++ openacs-4/packages/download/www/admin/report-one-ip.tcl	16 Jan 2003 13:46:20 -0000	1.6
@@ -1,5 +1,6 @@
-# /packages/download/www/admin/report-one-ip-.tcl
+# /packages/download/www/admin/report-one-ip.tcl
 ad_page_contract {
+    Show all downloaders from a single IP address
      
      @author jbank@arsdigita.com [jbank@arsdigita.com]
      @creation-date Thu Dec 14 16:11:49 2000
@@ -8,6 +9,12 @@
     download_ip:notnull
     {orderby "archive_name"}
     {downloaded "1m"}
+} -properties {
+    download_ip:onevalue
+    context:onevalue
+    user_id_list_export:onevalue
+    dimensional_html:onevalue
+    table:onevalue
 }
 
 
@@ -40,36 +47,16 @@
     {}}
 }
 
-set sql_query "
-    select da.archive_name, 
-           da.archive_id, 
-           dar.revision_id,
-           dar.version_name,
-           d.download_date,
-           u.last_name || ', ' || u.first_names as user_name,
-           u.user_id,
-           u.email,
-           nvl(d.download_hostname,'unavailable') as download_hostname,
-           nvl2(d.reason_id, d.reason, dr.reason) as reason
-      from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u
-     where da.repository_id = $repository_id
-       and da.archive_id = dar.archive_id
-       and d.revision_id = dar.revision_id
-       and d.download_ip = '$download_ip'
-       and dr.download_reason_id(+) = d.reason_id
-       and u.user_id = d.user_id
-       [ad_dimensional_sql $dimensional where]
-       [ad_order_by_from_sort_spec $orderby $table_def]
-"
-
-set export_sql_query [export_vars -url -sign {downloaded repository_id dimensional}]
-
 set dimensional_html [ad_dimensional $dimensional]
 set table [ad_table \
-        -Ttable_extra_html { width= 90% align=center} \
+        -Ttable_extra_html { width="90%" align="center" } \
         -bind [ad_tcl_vars_to_ns_set repository_id download_ip] \
-        download_table $sql_query $table_def ]
+               download_table { *SQL* } $table_def ]
 
+# query users to spam
+set user_id_list [db_list users_to_spam { *SQL* }]
+set user_id_list_export [export_vars -form -sign user_id_list]
+
 set context [list [list "report-by-ip" "Downloads by IP"] "$download_ip"]
 
 ad_return_template
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/download/www/admin/report-one-ip.xql'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/download/www/admin/report-one-user-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/download/www/admin/report-one-user-oracle.xql	23 May 2001 16:35:03 -0000	1.2
+++ openacs-4/packages/download/www/admin/report-one-user-oracle.xql	16 Jan 2003 13:46:20 -0000	1.3
@@ -14,10 +14,10 @@
            nvl(d.download_hostname,'unavailable') as download_hostname,
            nvl2(d.reason_id, dr.reason, d.reason) as reason
       from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr
-     where da.repository_id = $repository_id
+     where da.repository_id = :repository_id
        and da.archive_id = dar.archive_id
        and d.revision_id = dar.revision_id
-       and d.user_id = $user_id
+       and d.user_id = :user_id
        and dr.download_reason_id(+) = d.reason_id
        [ad_dimensional_sql $dimensional where]
        [ad_order_by_from_sort_spec $orderby $table_def]
Index: openacs-4/packages/download/www/admin/report-one-user-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/report-one-user-postgresql.xql	22 May 2001 04:17:45 -0000	1.1
+++ openacs-4/packages/download/www/admin/report-one-user-postgresql.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -22,7 +22,7 @@
      where da.repository_id = :repository_id
        and da.archive_id = dar.archive_id
        and d.revision_id = dar.revision_id
-       and d.user_id = $user_id
+       and d.user_id = :user_id
        [ad_dimensional_sql $dimensional where]
        [ad_order_by_from_sort_spec $orderby $table_def]
 
Index: openacs-4/packages/download/www/admin/report-one-user.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/download/www/admin/report-one-user.tcl	10 Sep 2002 22:22:35 -0000	1.5
+++ openacs-4/packages/download/www/admin/report-one-user.tcl	16 Jan 2003 13:46:20 -0000	1.6
@@ -1,4 +1,4 @@
-# /packages/download/www/admin/one-user-downloads.tcl
+# /packages/download/www/admin/report-one-user.tcl
 ad_page_contract {
      
      @author jbank@arsdigita.com [jbank@arsdigita.com]
@@ -8,6 +8,12 @@
     user_id:integer,notnull
     {orderby "archive_name"}
     {downloaded "1m"}
+} -properties {
+    first_names:onevalue
+    last_name:onevalue
+    context:onevalue
+    dimensional_html:onevalue
+    table:onevalue
 }
 
 set repository_id [download_repository_id]
@@ -23,51 +29,29 @@
 
 set table_def {
     {archive_name "Archive"
-    {archive_name $order}
-    {<td><a href="../one-archive?archive_id=$archive_id">$archive_name</a></td>}}
+        {archive_name $order}
+        {<td><a href="../one-archive?archive_id=$archive_id">$archive_name</a></td>}}
     {version_name "Version"
-    {version_name $order}
-    {<td><a href="../one-revision?revision_id=$revision_id">$version_name</a></td>}}
+        {version_name $order}
+        {<td><a href="../one-revision?revision_id=$revision_id">$version_name</a></td>}}
     {download_date "Download Date"
-    {download_date}
-    {}}
+        {download_date}
+        {}}
     {download_ip "From IP"
-    {download_ip}
-    {<td><a href=report-one-ip?[export_url_vars download_ip downloaded]>$download_ip</a> ($download_hostname)</td>}}
+        {download_ip}
+        {<td><a href=report-one-ip?[export_url_vars download_ip downloaded]>$download_ip</a> ($download_hostname)</td>}}
     {reason "Download Reason"
-    {reason}
-    {}}
+        {reason}
+        {}}
 }
 
-set sql_query "
-    select da.repository_id,
-           da.archive_name, 
-           da.archive_id, 
-           dar.revision_id,
-           dar.version_name,
-           d.download_date,
-           d.download_ip,
-           nvl(d.download_hostname,'unavailable') as download_hostname,
-           nvl2(d.reason_id, d.reason, dr.reason) as reason
-      from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr
-     where da.repository_id = $repository_id
-       and da.archive_id = dar.archive_id
-       and d.revision_id = dar.revision_id
-       and d.user_id = $user_id
-       and dr.download_reason_id(+) = d.reason_id
-       [ad_dimensional_sql $dimensional where]
-       [ad_order_by_from_sort_spec $orderby $table_def]
-"
+db_1row name_select { *SQL* }
 
-db_1row name_select "select u.last_name, u.first_names
-                     from cc_users u
-                     where u.user_id = :user_id "
-
 set dimensional_html [ad_dimensional $dimensional]
 set table [ad_table \
-        -Ttable_extra_html { width= 90% align=center} \
+        -Ttable_extra_html { width="90%" align="center" } \
         -bind [ad_tcl_vars_to_ns_set repository_id user_id] \
-        download_table $sql_query $table_def ]
+               download_table { *SQL* } $table_def ]
 
 set context [list [list "report-by-user" "Downloads by User"] "$first_names $last_name"]
 ad_return_template
Index: openacs-4/packages/download/www/admin/report-one-user.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/download/www/admin/report-one-user.xql	22 May 2001 04:17:45 -0000	1.2
+++ openacs-4/packages/download/www/admin/report-one-user.xql	16 Jan 2003 13:46:20 -0000	1.3
@@ -4,8 +4,8 @@
 <fullquery name="name_select">      
       <querytext>
       select u.last_name, u.first_names
-                     from cc_users u
-                     where u.user_id = :user_id 
+        from cc_users u
+        where u.user_id = :user_id 
       </querytext>
 </fullquery>
 
Index: openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql	23 May 2001 16:35:03 -0000	1.2
+++ openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql	16 Jan 2003 13:46:20 -0000	1.3
@@ -6,18 +6,18 @@
 <fullquery name="download_table">
       <querytext>
       
-    select u.last_name || ', ' || u.first_names as user_name,
+    select u.user_id,
+           u.email,
+           u.last_name || ', ' || u.first_names as user_name,
            d.download_date,
            d.download_ip,
            nvl(d.download_hostname,'unavailable') as download_hostname,
            nvl(dar.version_name, 'unnamed') as version_name,
            dar.revision_id,
-           u.user_id,
-           u.email,
            nvl2(d.reason_id, dr.reason, d.reason) as reason
       from download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u
      where d.user_id = u.user_id
-       and dar.archive_id = $archive_id
+       and dar.archive_id = :archive_id
        and dar.revision_id = d.revision_id
        and dr.download_reason_id(+) = d.reason_id
        [ad_dimensional_sql $dimensional where]
@@ -26,6 +26,7 @@
       </querytext>
 </fullquery>
 
+
 <partialquery name="version_clause">
       <querytext>
 
Index: openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql	23 May 2001 01:00:43 -0000	1.2
+++ openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql	16 Jan 2003 13:46:20 -0000	1.3
@@ -6,14 +6,14 @@
 <fullquery name="download_table">
 <querytext>
       
-select u.last_name || ', ' || u.first_names as user_name,
+select u.user_id,
+       u.email,
+       u.last_name || ', ' || u.first_names as user_name,
        d.download_date,
        d.download_ip,
        coalesce(d.download_hostname,'unavailable') as download_hostname,
        coalesce(dar.version_name, 'unnamed') as version_name,
        dar.revision_id,
-       u.user_id,
-       u.email,
        case when d.reason_id is null then d.reason else dr.reason end as reason
 from download_downloads d left join download_reasons dr
   on (d.reason_id=dr.download_reason_id),
@@ -29,7 +29,6 @@
 </fullquery>
 
 
-
 <partialquery name="version_clause">
 <querytext>
 
Index: openacs-4/packages/download/www/admin/report-version-downloads.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads.adp,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/download/www/admin/report-version-downloads.adp	6 Sep 2002 21:50:32 -0000	1.4
+++ openacs-4/packages/download/www/admin/report-version-downloads.adp	16 Jan 2003 13:46:20 -0000	1.5
@@ -2,13 +2,14 @@
 <property name="title">@archive_name@ Download History</property>
 <property name="context">@context@</property>
 
+<p>
+<form method="post" action="spam-users">
+  @user_id_list_export@
+  <input type="submit" value="Spam Downloaders" />
+</form>
+</p>
 
-<ul>
-<li><a href=spam-users?@export_sql_query@>Spam Downloaders</a>
-<li><a href=export-csv?@export_sql_query@>Export CSV File</a>
-</ul>
-
 @dimensional_html@
-<center><b>Total downloads listed: @count@; Overall Total for @archive_name@: @total_count@</b>
+<center><strong>Total downloads listed: @current_count@; Overall Total for @archive_name@: @total_count@</strong>
 </center>
 @table@
\ No newline at end of file
Index: openacs-4/packages/download/www/admin/report-version-downloads.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/download/www/admin/report-version-downloads.tcl	10 Sep 2002 22:22:35 -0000	1.5
+++ openacs-4/packages/download/www/admin/report-version-downloads.tcl	16 Jan 2003 13:46:20 -0000	1.6
@@ -9,8 +9,18 @@
     {orderby "last_name"}
     {downloaded 1m}
     {versions "current"}
+} -properties {
+    archive_name:onevalue
+    context:onevalue
+    user_id_list_export:onevalue
+    dimensional_html:onevalue
+    current_count:onevalue
+    total_count:onevalue
+    table:onevalue
 }
 
+set repository_id [download_repository_id]
+
 ad_require_permission $archive_id "admin"
 
 set dimensional {
@@ -29,87 +39,37 @@
 
 set table_def {
     {user_name "User Name"
-    {user_name $order}
-    {<td><a href=report-one-user?user_id=$user_id>$user_name</a></td>}}
+        {user_name $order}
+        {<td><a href="report-one-user?user_id=$user_id">$user_name</a></td>}}
     {version_name "Version"
-    {version_name $order}
-    {<td><a href=[ad_conn package_url]one-revision?[export_url_vars revision_id downloaded]>$version_name</a></td>}}
+        {version_name $order}
+        {<td><a href="[ad_conn package_url]one-revision?[export_url_vars revision_id downloaded]">$version_name</a></td>}}
     {download_date "Download Date"
-    {download_date $order}
-    {}}
+        {download_date $order}
+        {}}
     {download_ip "From IP (hostname)"
-    {download_ip $order}
-    {<td><a href=report-one-ip?[export_url_vars download_ip downloaded]>$download_ip</a> ($download_hostname)</td>}}
+        {download_ip $order}
+        {<td><a href="report-one-ip?[export_url_vars download_ip downloaded]">$download_ip</a> ($download_hostname)</td>}}
     {reason "Download Reason"
-    {reason $order}
-    {<td>$reason</td>}}
+        {reason $order}
+        {<td>$reason</td>}}
 }
 
-db_1row name_select {
-    select da.archive_name from download_archives_obj da where da.archive_id = :archive_id
-}
+db_1row name_select { *SQL* }
 
-if {$versions == "all" } {
-    set version_str " in (
-       select revision_id from download_arch_revisions_obj
-        where archive_id = :archive_id )"
-} else {
-    set version_str " = (
-       select revision_id from download_arch_revisions_obj
-        where archive_id = :archive_id 
-          and revision_id = content_item.get_live_revision(:archive_id))
-       "
-}
+set current_count [db_string current_count { *SQL* }]
+set total_count [db_string total_count { *SQL* }]
 
-set count [db_string count_select "select count(*)
-from   download_downloads d, download_arch_revisions_obj dar
-where  dar.archive_id = :archive_id and
-       d.revision_id = dar.revision_id 
-       [ad_dimensional_sql $dimensional where]
-"]
-
-#FIXME 
-# what is temp_downloaded for?
-# why are count and total_count the same query?
-# do we need version_str above?
-
-set temp_downloaded $downloaded
-
-set total_count [db_string count_select "select count(*)
-from   download_downloads d, download_arch_revisions_obj dar
-where  dar.archive_id = :archive_id and 
-       d.revision_id = dar.revision_id
-       [ad_dimensional_sql $dimensional where]
-"]
-set downloaded $temp_downloaded 
-
-set sql_query "
-    select u.last_name || ', ' || u.first_names as user_name,
-           d.download_date,
-           d.download_ip,
-           nvl(d.download_hostname,'unavailable') as download_hostname,
-           nvl(dar.version_name, 'unnamed') as version_name,
-           dar.revision_id,
-           u.user_id,
-           u.email,
-           nvl2(d.reason_id, d.reason, dr.reason) as reason
-      from download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u
-     where d.user_id = u.user_id
-       and dar.archive_id = $archive_id
-       and dar.revision_id = d.revision_id
-       and dr.download_reason_id(+) = d.reason_id
-       [ad_dimensional_sql $dimensional where]
-       [ad_order_by_from_sort_spec $orderby $table_def]
-"
-
-set export_sql_query [export_vars -url -sign {sql_query}]
-
 set dimensional_html [ad_dimensional $dimensional]
 set table [ad_table \
-        -Ttable_extra_html { width= 90% align=center} \
+        -Ttable_extra_html { width="90%" align="center" } \
         -bind [ad_tcl_vars_to_ns_set archive_id] \
-        download_table $sql_query $table_def ]
+               download_table { *SQL* } $table_def ]
 
+# query users to spam
+set user_id_list [db_list users_to_spam { *SQL* }]
+set user_id_list_export [export_vars -form -sign user_id_list]
+
 set context [list "$archive_name Download History"]
 
 ad_return_template
Index: openacs-4/packages/download/www/admin/report-version-downloads.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/download/www/admin/report-version-downloads.xql	22 May 2001 04:17:45 -0000	1.2
+++ openacs-4/packages/download/www/admin/report-version-downloads.xql	16 Jan 2003 13:46:20 -0000	1.3
@@ -10,16 +10,41 @@
 </fullquery>
 
  
-<fullquery name="count_select">      
+<fullquery name="current_count">      
       <querytext>
       select count(*)
 from   download_downloads d, download_arch_revisions_obj dar
 where  dar.archive_id = :archive_id and
-       d.revision_id = dar.revision_id 
+       d.revision_id = dar.revision_id
        [ad_dimensional_sql $dimensional where]
 
       </querytext>
 </fullquery>
 
+<fullquery name="total_count">      
+      <querytext>
+      select count(*)
+from   download_downloads d, download_arch_revisions_obj dar
+where  dar.archive_id = :archive_id and
+       d.revision_id = dar.revision_id 
+
+      </querytext>
+</fullquery>
+
  
+<fullquery name="users_to_spam">
+      <querytext>
+      
+select distinct d.user_id
+from download_downloads_repository d,
+     download_arch_revisions_obj dar
+where d.repository_id = :repository_id
+      and dar.archive_id = :archive_id
+      and dar.revision_id = d.revision_id
+      [ad_dimensional_sql $dimensional where]
+
+      </querytext>
+</fullquery>
+
+
 </queryset>
Index: openacs-4/packages/download/www/admin/spam-users-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users-2.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/download/www/admin/spam-users-2.tcl	10 Sep 2002 22:22:35 -0000	1.4
+++ openacs-4/packages/download/www/admin/spam-users-2.tcl	16 Jan 2003 13:46:20 -0000	1.5
@@ -5,7 +5,7 @@
      @creation-date Mon Jan  8 18:05:51 2001
      @cvs-id $Id$
 } {
-    userid_list:verify
+    user_id_list:verify
     subject:notnull
     msgbody:notnull
 }
@@ -18,7 +18,7 @@
 
 <h2>Spam Downloaders</h2> 
 <p>
-[list "Spam Downloader"]
+[ad_context_bar "Spam Downloader"]
 
 <h3>Spam Downloader </h3>
 
@@ -34,7 +34,7 @@
 
 # send out email
 set count 0
-foreach to_user_id $userid_list {
+foreach to_user_id $user_id_list {
     db_exec_plsql sendmail {
         select acs_mail_nt__post_request (
 		    :user_id,    -- p_party_from
Index: openacs-4/packages/download/www/admin/spam-users.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/download/www/admin/spam-users.adp	6 Sep 2002 21:50:32 -0000	1.3
+++ openacs-4/packages/download/www/admin/spam-users.adp	16 Jan 2003 13:46:20 -0000	1.4
@@ -2,8 +2,22 @@
     <property name="title">Spam Downloaders</property>
     <property name="context">"Spam downloaders"</property>
 
+    <if @users:rowcount@ eq 0>
+      After weeding out users who don't want to be spammed, there was no one
+      left on your list. Sorry!
+    </if>
+    <else>
+
+    <p>
+        Users who have requested not to be spammed will
+        <strong>NOT</strong> receive your email.
+        <br />
+        (@no_spam_count@ user<if @no_spam_count@ ne 1>s</if> removed 
+        from the list for this reason)
+    </p>
+
     <form action="spam-users-2" method="post">
-      @userid_list_export@
+      @user_id_list_export@
       <table>
         <tr>
           <td>Email Subject:</td>
@@ -23,6 +37,14 @@
     <p>
       The following users will receive your spam:
       <ul>
-        @userlist_str@
+        <if @users:rowcount@ lt 25>
+          <multiple name="users">
+            <li>@users.user_name@ (<a href="mailto:@users.email@">@users.email@</a>)</li>
+          </multiple>
+        </if>
+        <else>
+          <li>@users:rowcount@ users will receive your message.</li>
+        </else>
       </ul>
-    </p>
\ No newline at end of file
+    </p>
+    </else>
\ No newline at end of file
Index: openacs-4/packages/download/www/admin/spam-users.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/download/www/admin/spam-users.tcl	10 Sep 2002 22:22:35 -0000	1.3
+++ openacs-4/packages/download/www/admin/spam-users.tcl	16 Jan 2003 13:46:20 -0000	1.4
@@ -1,49 +1,32 @@
 # /packages/download/www/admin/spam-users.tcl
 ad_page_contract {
-     Spam downloaders based on the queyr passed in
+    Spam downloaders based on the user_id list passed in. The user_id list 
+    must be signed.
+
      @author jbank@arsdigita.com [jbank@arsdigita.com]
      @creation-date Mon Jan  8 17:33:15 2001
      @cvs-id $Id$
 } {
-	downloaded:verify
-	repository_id:verify
-	dimensional:verify
+    user_id_list:verify
+} -properties {
+    users:multirow
+    user_id_list_export:onevalue
+    no_spam_count:onevalue
 }
 
 ad_require_permission [ad_conn package_id] "admin"
 set user_id [ad_verify_and_get_user_id]
 
-# ACS version passed sql_query as a query variable
-#  I changed it to pass the important parameters
-#   and then build the query by grabbing the 
-#   appropriate query using the query dispatcher
-#  -- vinodk
+# get name, email and
+# remove any users who don't want spam
 
-set sql_query [subst [db_fullquery_get_querytext [db_qd_fetch dbqd.download.www.admin.report-by-user.download_table]]]
-
-ns_log notice "vinodk: $sql_query"
-ns_log notice "vinodk: $dimensional"
-
-set userlist_str ""
-set email_list [list]
-set old_userid 0
-set count 0
-
-#TODO: Add where clause that checks from no_spam pref.
-db_foreach user_select "select u.email, u.user_id, u.user_name from ($sql_query) u" {
-    if { $user_id != $old_userid } {
-		append userlist_str "<li>$user_name (<a href=mailto:$email>$email</a>)"
-		lappend userid_list $user_id
-    }
-    set old_userid $user_id
-    incr count
+set want_spam_list {}
+db_multirow users user_select { *SQL* } {
+    lappend want_spam_list $user_id
 }
+set no_spam_count [expr [llength user_id_list] - [llength want_spam_list]]
+set user_id_list $want_spam_list
 
-# Display user name only when count is less than 25
-if { $count > 25 } {
-    set userlist_str "<li>$count users will receive your spam."
-}
+set user_id_list_export [export_vars -form -sign {user_id_list}]
 
-set userid_list_export [export_vars -form -sign {userid_list}]
-
 ad_return_template
Index: openacs-4/packages/download/www/admin/spam-users.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/download/www/admin/spam-users.xql	10 May 2001 20:51:31 -0000	1.1
+++ openacs-4/packages/download/www/admin/spam-users.xql	16 Jan 2003 13:46:20 -0000	1.2
@@ -3,7 +3,13 @@
 
 <fullquery name="user_select">      
       <querytext>
-      select u.email, u.user_id, u.user_name from ($sql_query) u
+      select u.email, 
+             u.user_id, 
+             u.last_name || ', ' || u.first_names as user_name 
+        from cc_users u, user_preferences up
+        where u.user_id in ([join $user_id_list ,]) and
+              u.user_id = up.user_id and
+              up.dont_spam_me_p = 'f'
       </querytext>
 </fullquery>
 
Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql	23 Sep 2002 03:32:43 -0000	1.10
+++ openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql	16 Jan 2003 13:46:35 -0000	1.11
@@ -51,7 +51,7 @@
 
   <fullquery name="ec_add_to_cart_link.available_date_select">      
     <querytext>
-      select to_char(available_date,'Month DD, YYYY') available_date
+      select to_char(available_date,'Month DD, YYYY') as available_date
       from ec_products
       where product_id = :product_id
     </querytext>
Index: openacs-4/packages/email-handler/email-handler.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/email-handler/email-handler.info,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/email-handler/email-handler.info	3 May 2001 20:49:43 -0000	1.2
+++ openacs-4/packages/email-handler/email-handler.info	16 Jan 2003 13:47:02 -0000	1.3
@@ -17,7 +17,7 @@
         <vendor url="http://www.arsdigita.com/">ArsDigita Corporation</vendor>
         <description format="text/plain">A service to autmatically dispatch and process incoming email messages.Email messages are tagged and inserted into a database table by an external script, and the email handler dispatches emails by tag to Tcl procedures to handle them. </description>
 
-        <provides url="email-handler" version="4.0"/>
+        <provides url="email-handler" version="4.0.1"/>
         <requires url="acs-kernel" version="4.0"/>
 
         <files>
Index: openacs-4/packages/faq/faq.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq/faq.info,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/faq/faq.info	30 Nov 2002 17:32:33 -0000	1.6
+++ openacs-4/packages/faq/faq.info	16 Jan 2003 13:47:28 -0000	1.7
@@ -18,7 +18,7 @@
         <release-date>2002-10-27</release-date>
         <vendor url="http://ybos.net">Ybos Corporation</vendor>
 
-        <provides url="faq" version="4.0"/>
+        <provides url="faq" version="4.6"/>
         <requires url="acs-kernel" version="4.0"/>
 
         <files>
Index: openacs-4/packages/file-storage/file-storage.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/file-storage/file-storage.info	9 Dec 2002 22:48:44 -0000	1.19
+++ openacs-4/packages/file-storage/file-storage.info	16 Jan 2003 13:47:41 -0000	1.20
@@ -157,6 +157,7 @@
             <parameter datatype="number"  min_n_values="1"  max_n_values="1"  name="ShowAdministerPermissionsLinkP"  default="1" description="Whether or not to show a link to administer permissions on the file storage object."/>
             <parameter datatype="number"  min_n_values="1" max_n_values="1"  name="GeneralCommentsP"  default="0" description="Allow comments to be attached to a file."/>
             <parameter datatype="number"  min_n_values="1"  max_n_values="1"  name="MaximumFileSize"  default="2000000" description="The maximum size, in bytes, of files that users are allowed to upload"/>
+            <parameter datatype="number"  min_n_values="1"  max_n_values="1"  name="StoreFilesInDatabaseP"  default="1" description="Flag to determine the storage type. A flag of 1 (true) will store the files in the database. If 0 (false) files are stored in the filesystem. ***This parameter should only be changed at package instance creation.***"/>
         </parameters>
 
     </version>
Index: openacs-4/packages/file-storage/www/folder-chunk.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.adp,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/file-storage/www/folder-chunk.adp	11 Dec 2002 13:28:09 -0000	1.14
+++ openacs-4/packages/file-storage/www/folder-chunk.adp	16 Jan 2003 13:47:56 -0000	1.15
@@ -48,7 +48,10 @@
             #file-storage.delete#
           </a>
 </if>
-          ]</small>
+<if @contents.write_p@ or @contents.delete_p@ or @contents.admin_p@>
+           ]
+</if>
+        </small>
       </td>
       <td>&nbsp;</td>
       <td>@contents.type@ </td>
@@ -77,7 +80,7 @@
 </else>
 </else>
     </tr>
-</multiple>
+    </multiple>
   </table>
 </if>
 <else>