Index: openacs-4/packages/address-book/tcl/address-book-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/tcl/address-book-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/tcl/address-book-procs.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,69 @@ + + + + + + + select last_name, + first_names, + title, + organization + from ab_contacts + where contact_id = :contact_id + + + + + + + + + select attr_id, + type_name, + value + from ab_contact_attr_types acat, + ab_contact_attrs aca + where acat.type_key = aca.type_key + and aca.contact_id = :contact_id + order by sort_key + + + + + + + + select type_name, + value + from ab_contact_attr_types acat, + ab_contact_attrs aca + where acat.type_key = aca.type_key + and aca.contact_id = :contact_id + order by sort_key + + + + + + + + + select address_id, + address_name, + line_one, + line_two, + line_three, + line_four, + municipality_name, + region_id, + postal_code, + country_id + from addresses_located + where locatee_id = :contact_id + order by sort_key + + + + + + Index: openacs-4/packages/address-book/www/address-ae-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-ae-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-ae-2.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + select case when count(*) = 0 then 0 else 1 end from pl_addresses where address_id = :address_id + + + + + Index: openacs-4/packages/address-book/www/address-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-delete-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-delete-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,42 @@ + + + + oracle8.1.6 + + + + + begin + location_rel.delete(:rel_id); + end; + + + + + + + + + declare + v_rel_id subplace_rels.rel_id%TYPE; + cursor subplace_rel_cursor is + select sr.rel_id + from subplace_rels sr, + acs_rels ar + where ar.rel_id = sr.rel_id + and ar.object_id_two = :address_id; + begin + open subplace_rel_cursor; + fetch subplace_rel_cursor into v_rel_id; + if not subplace_rel_cursor%NOTFOUND then + subplace_rel.delete(v_rel_id); + end if; + close subplace_rel_cursor; + pl_address.delete(:address_id); + end; + + + + + + Index: openacs-4/packages/address-book/www/address-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-delete-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-delete-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,46 @@ + + + + postgresql7.1 + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + location_rel__delete(:rel_id); + end; + + + + + + + + FIX ME PLSQL +FIX ME PLSQL + + declare + v_rel_id subplace_rels.rel_id%TYPE; + cursor subplace_rel_cursor is + select sr.rel_id + from subplace_rels sr, + acs_rels ar + where ar.rel_id = sr.rel_id + and ar.object_id_two = :address_id; + begin + open subplace_rel_cursor; + fetch subplace_rel_cursor into v_rel_id; + if not subplace_rel_cursor%NOTFOUND then + subplace_rel__delete(v_rel_id); + end if; + close subplace_rel_cursor; + pl_address__delete(:address_id); + end; + + + + + + Index: openacs-4/packages/address-book/www/address-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-delete.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + select case when count(*) = 0 then 1 else 0 end from place_element_map where place_id = :address_id + + + + + + + select case when count(*) = 0 then 0 else 1 end from acs_objects where object_id = :address_id and object_type = 'pl_address' + + + + + Index: openacs-4/packages/address-book/www/address-swap-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-swap-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-swap-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,25 @@ + + + + oracle8.1.6 + + + + select rel_id from (select rel_id from addresses_located where sort_key $operator (select sort_key from location_rels where rel_id = :rel_id) and locatee_id = :contact_id order by sort_key $direction) sq where rownum = 1 + + + + + + + + begin + location_rel.swap_sort(rel_id_one => :rel_id, + rel_id_two => :other_rel_id); + end; + + + + + + Index: openacs-4/packages/address-book/www/address-swap-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-swap-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-swap-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,28 @@ + + + + postgresql7.1 + + + + FIX ME ROWNUM +select rel_id from (select rel_id from addresses_located where sort_key $operator (select sort_key from location_rels where rel_id = :rel_id) and locatee_id = :contact_id order by sort_key $direction) sq where rownum = 1 + + + + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + location_rel__swap_sort(rel_id_one => :rel_id, + rel_id_two => :other_rel_id); + end; + + + + + + Index: openacs-4/packages/address-book/www/address-swap.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/address-swap.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/address-swap.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + select locatee_id from pl_addresses_located where rel_id = :rel_id + + + + + Index: openacs-4/packages/address-book/www/attr-ae-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-ae-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-ae-2-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,30 @@ + + + + oracle8.1.6 + + + + + begin + :1 := + ab_contact_attr.new(creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :contact_id, + contact_id => :contact_id, + type_key => :attr_type, + value => :attr_value); + end; + + + + + + + + begin ab_contact_attr.delete(:attr_id); end; + + + + + Index: openacs-4/packages/address-book/www/attr-ae-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-ae-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-ae-2-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,34 @@ + + + + postgresql7.1 + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + :1 := + ab_contact_attr__new(creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :contact_id, + contact_id => :contact_id, + type_key => :attr_type, + value => :attr_value); + end; + + + + + + + + FIX ME PLSQL +FIX ME PLSQL +begin ab_contact_attr__delete(:attr_id); end; + + + + + Index: openacs-4/packages/address-book/www/attr-ae-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-ae-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-ae-2.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,22 @@ + + + + + + select case when count(*) = 0 then 0 else 1 end from ab_contact_attrs where attr_id = :attr_id + + + + + + + + update ab_contact_attrs + set type_key = :attr_type, value = :attr_value + where attr_id = :attr_id + + + + + + Index: openacs-4/packages/address-book/www/attr-ae.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-ae.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-ae.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,38 @@ + + + + + + + select type_key + from ab_contact_attr_types + where type_id = (select min(type_id) + from ab_contact_attr_types + where type_key not in (select type_key + from ab_contact_attrs + where contact_id = :contact_id)) + + + + + + + + + select type_key + from ab_contact_attr_types + where type_id = (select min(type_id) + from ab_contact_attr_types) + + + + + + + + select type_key, value from ab_contact_attrs where attr_id = :attr_id + + + + + Index: openacs-4/packages/address-book/www/attr-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-delete-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-delete-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,15 @@ + + + + oracle8.1.6 + + + + + begin ab_contact_attr.delete(:attr_id); end; + + + + + + Index: openacs-4/packages/address-book/www/attr-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-delete-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-delete-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,17 @@ + + + + postgresql7.1 + + + + FIX ME PLSQL +FIX ME PLSQL + + begin ab_contact_attr__delete(:attr_id); end; + + + + + + Index: openacs-4/packages/address-book/www/attr-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-delete.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select contact_id + from ab_contact_attrs + where attr_id = :attr_id + + + + + + Index: openacs-4/packages/address-book/www/attr-swap-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-swap-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-swap-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,25 @@ + + + + oracle8.1.6 + + + + select attr_id from (select attr_id from ab_contact_attrs where sort_key $operator (select sort_key from ab_contact_attrs where attr_id = :attr_id) and contact_id = :contact_id order by sort_key $direction) where rownum = 1 + + + + + + + + begin + ab_contact_attr.swap_sort(attr_id_one => :attr_id, + attr_id_two => :other_attr_id); + end; + + + + + + Index: openacs-4/packages/address-book/www/attr-swap-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-swap-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-swap-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,28 @@ + + + + postgresql7.1 + + + + FIX ME ROWNUM +select attr_id from (select attr_id from ab_contact_attrs where sort_key $operator (select sort_key from ab_contact_attrs where attr_id = :attr_id) and contact_id = :contact_id order by sort_key $direction) where rownum = 1 + + + + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + ab_contact_attr__swap_sort(attr_id_one => :attr_id, + attr_id_two => :other_attr_id); + end; + + + + + + Index: openacs-4/packages/address-book/www/attr-swap.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/attr-swap.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/attr-swap.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + select contact_id from ab_contact_attrs where attr_id = :attr_id + + + + + Index: openacs-4/packages/address-book/www/contact-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-add-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-add-2-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,46 @@ + + + + oracle8.1.6 + + + + + begin + :1 := + ab_contact.new(contact_id => :contact_id, + creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :instance_id, + first_names => :first_names, + last_name => :last_name, + title => :title, + organization => :organization, + object_id => :instance_id, + category => 'ab_contact'); + end; + + + + + + + + + begin acs_permission.grant_permission(object_id => :contact_id, + grantee_id => :user_id, + privilege => 'admin'); + end; + + + + + + + + begin $plsql_block end; + + + + + Index: openacs-4/packages/address-book/www/contact-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-add-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-add-2-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,52 @@ + + + + postgresql7.1 + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + :1 := + ab_contact__new(contact_id => :contact_id, + creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :instance_id, + first_names => :first_names, + last_name => :last_name, + title => :title, + organization => :organization, + object_id => :instance_id, + category => 'ab_contact'); + end; + + + + + + + + FIX ME PLSQL +FIX ME PLSQL + + begin acs_permission__grant_permission(object_id => :contact_id, + grantee_id => :user_id, + privilege => 'admin'); + end; + + + + + + + + FIX ME PLSQL +FIX ME PLSQL +begin $plsql_block end; + + + + + Index: openacs-4/packages/address-book/www/contact-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-add-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-add-2.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + select case when count(*) = 0 then 0 else 1 end from ab_contacts where contact_id = :contact_id + + + + + Index: openacs-4/packages/address-book/www/contact-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-delete-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-delete-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,34 @@ + + + + oracle8.1.6 + + + + + begin + ab_contact_rel.delete(:rel_id); + end; + + + + + + + + + begin + -- Delete perms on the contact + delete from acs_permissions + where object_id = :contact_id; + + -- Delete the contact, blowing away orphan addresses. + ab_contact.delete(contact_id => :contact_id, + delete_orphan_addresses_p => 't'); + end; + + + + + + Index: openacs-4/packages/address-book/www/contact-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-delete-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-delete-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,38 @@ + + + + postgresql7.1 + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + ab_contact_rel__delete(:rel_id); + end; + + + + + + + + FIX ME PLSQL +FIX ME PLSQL + + begin + -- Delete perms on the contact + delete from acs_permissions + where object_id = :contact_id; + + -- Delete the contact, blowing away orphan addresses. + ab_contact__delete(contact_id => :contact_id, + delete_orphan_addresses_p => 't'); + end; + + + + + + Index: openacs-4/packages/address-book/www/contact-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-delete.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + select case when count(*) = 0 then 1 else 0 end from ab_contacts_related where contact_id = :contact_id + + + + + + + select case when count(*) = 0 then 0 else 1 end from acs_objects where object_id = :contact_id and object_type = 'ab_contact' + + + + + Index: openacs-4/packages/address-book/www/contact-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-edit-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-edit-2.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + + update ab_contacts + set first_names = :first_names, + last_name = :last_name, + title = :title, + organization= :organization + where contact_id = :contact_id + + + + + + Index: openacs-4/packages/address-book/www/contact-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-edit.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + + select first_names, + last_name, + title, + organization + from ab_contacts + where contact_id = :contact_id + + + + + + Index: openacs-4/packages/address-book/www/contact-view.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/contact-view.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/contact-view.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,26 @@ + + + + + + + select address_id, + address_name, + line_one, + line_two, + line_three, + line_four, + municipality_name, + region_id, + postal_code, + country_id, + rel_id + from pl_addresses_located + where locatee_id = :contact_id + order by sort_key + + + + + + Index: openacs-4/packages/address-book/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/index-oracle.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,13 @@ + + + + oracle8.1.6 + + + + begin :1 := acs_object.name(:instance_id); end; + + + + + Index: openacs-4/packages/address-book/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/address-book/www/index-postgresql.xql 22 Aug 2001 23:11:49 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + FIX ME PLSQL +FIX ME PLSQL +begin :1 := acs_object__name(:instance_id); end; + + + + +