+
+
+ |
+
+
+ |
+
Last updated: @update_date@
-
-
-
- -
-
|
-
-
-
-
-@letter_bar;noquote@ -#contacts.Showing# @first_row@ - @last_row@ #contacts.of# @total_rows@
- |
-
-
+From: @from@ +To: @messages.to@ +Subject: @messages.subject@ + +@messages.content@ ++
What role does @contact_name_one@ have when @contact_name_two@ is a @secondary_role_pretty@:
+All searches are case insensitive, capitalization does not matter. If more than one contact match the search a list of results is returned. If only one contact meets the search criteria you are redirected to that contact.
+Entering a string in the normal search box means that a search will be performed where:
+If multiple words are used then all words must match the above critera. So, for example if our contacts database contains these entries: +
+Contact ID | First Names | Last Name | Organization Name +--------------+----------------+---------------+--------------------------------- +123 | Jane | Doe | +234 | John | Doe | +345 | Alfred | Hitchcock | +456 | | | United States Treasury ++
If in a normal search we search for "D Jane". The first Search_Word ("D") matches contacts 123 (via "Doe"), 234 (via "Doe"), and 345 (via "Alfred"). And the second Search_Word ("Jane") matches only contact 123. Thus only one contact meets both requirements and "Jane Doe" (contact 123) is returned.
+ +Advanced searches are very powerful but in return they require very specific input...
Index: openacs-4/packages/contacts/www/search-help.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search-help.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/search-help.tcl 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,14 @@
+ad_page_contract {
+ List and manage contacts.
+
+ @author Matthew Geddert openacs@geddert.com
+ @creation-date 2004-07-28
+ @cvs-id $Id: search-help.tcl,v 1.1 2005/05/18 16:45:50 matthewg Exp $
+} {
+} -validate {
+}
+set admin_p [ad_permission_p [ad_conn package_id] admin]
+#set default_group_id [contacts::default_group_id]
+set title "Search Help"
+set context [list $title]
+
Index: openacs-4/packages/contacts/www/search-redirect.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/Attic/search-redirect.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/search-redirect.tcl 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,25 @@
+ad_page_contract {
+ List and manage contacts.
+
+ @author Matthew Geddert openacs@geddert.com
+ @creation-date 2004-07-28
+ @cvs-id $Id: search-redirect.tcl,v 1.1 2005/05/18 16:45:50 matthewg Exp $
+} {
+ {query:notnull}
+ {object_type:notnull}
+ {all_any:notnull}
+} -validate {
+}
+#ad_return_error "Error" $query
+#ad_returnredirect [export_vars -base "search" -url {query object_type all_any}]
+rp_internal_redirect search
+ad_script_abort
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/contacts/www/search.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/search.adp 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,16 @@
+
+Add Signature
+
+Relationships
+Add Group
+Instance Permissions - Not done yet
+ Once ready for release this will be taken care of in code Note: Write permission is needed to create or edit a contact and/or any sepecific attribute associated with that contact type. By default all attributes inherit permissions from the package.
+Define a new relationship type
+View all roles
+ Currently, the system is able to handle the following types of relationships: Debugging Code - Only SW Admins See This
+
+@query_code;noquote@
+
"}}
+ }
+} else {
+# {{People or Organizations} party}
+ append form_elements {
+ {object_type:text(select) {label {Search for}} {options {
+ {{People} person}
+ {{Organizations} organization}
+ }} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+}
+
+
+
+# set query_pretty [list]
+if { $search_exists_p } {
+ set query_pretty ""
+ db_foreach selectqueries {
+ select type as query_type, var_list as query_var_list from contact_search_conditions where search_id = :search_id
+ } {
+ append query_pretty "
"
+ append form_elements {
+ {query:text(hidden),optional}
+ {query_pretty:text(inform),optional {label {}} {value $query_pretty}}
+ }
+ if { $sw_admin_p } {
+ set query_code "
+
+
+
+select contact__name(party_id), party_id, revision_id
+ from parties, cr_items, cr_revisions
+ where party_id = cr_items.item_id
+ and cr_items.latest_revision = cr_revisions.revision_id
+[contact::search::where_clauses -and -search_id $search_id -party_id "party_id" -revision_id "cr.revisions.revision_id"]
+
+
+
+"
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if { [exists_and_not_null object_type] } {
+
+ # QUERY TYPE
+ set type_options [list \
+ [list "Attribute ->" "attribute"] \
+ [list "Contact ->" "contact"] \
+ [list "Group ->" "group"] \
+ ]
+
+# [list "Tasks ->" "tasks"]
+ append form_elements {
+ {type:text(select),optional {label {}} {options $type_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+}
+
+
+# each type must specify when to save a query
+set add_p 0
+
+switch $type {
+ attribute {
+
+
+ set attribute_options [db_list_of_lists get_attributes {
+ select pretty_name || ' ->' , attribute_id
+ from ams_attributes
+ where object_type in ('organization','party','person','user')
+ and ams_attribute_id is not null
+ order by upper (pretty_name)
+ }]
+
+ append form_elements {
+ {var1:text(select),optional {label {}} {options $attribute_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+
+ if { [exists_and_not_null var1] } {
+ set attribute_id $var1
+ ams::attribute::get -attribute_id $attribute_id -array "attr_info"
+ set value_method [ams::widget -widget $attr_info(widget) -request "value_method"]
+
+ switch $value_method {
+ ams_value__options {
+ set operand_options [list \
+ [list "is ->" "selected"] \
+ [list "is not ->" "not_selected"] \
+ [list "is set" "set"] \
+ [list "is not set" "not_set"] \
+ ]
+
+ append form_elements {
+ {var2:text(select),optional {label {}} {options $operand_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+ if { [exists_and_not_null var2] } {
+ if { $var2 == "exists" || $var2 == "not_exists" } {
+ set action "add"
+ } else {
+ set option_options [ams::widget_options -attribute_id $attribute_id]
+ append form_elements {
+ {var3:text(select) {label {}} {options $option_options}}
+ }
+ }
+ set add_p 1
+ }
+
+ }
+ ams_value__telecom_number {
+ set operand_options [list \
+ [list "area code is ->" "area_code_equals"] \
+ [list "area code is not ->" "not_area_code_equals"] \
+ [list "country code is ->" "country_code_equals"] \
+ [list "country code is not ->" "not_country_code_equals"] \
+ [list "is set" "set"] \
+ [list "is not set" "not_set"] \
+ ]
+
+ append form_elements {
+ {var2:text(select),optional {label {}} {options $operand_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+ if { [exists_and_not_null var2] } {
+ if { $var2 == "exists" || $var2 == "not_exists" } {
+ set action "add"
+ } else {
+ append form_elements {
+ {var3:integer(text) {label {}} {html {size 3 maxlength 3}}}
+ }
+ }
+ set add_p 1
+ }
+
+ }
+ ams_value__text {
+ set operand_options [list \
+ [list "contains ->" "contains"] \
+ [list "does not contain ->" "not_contains"] \
+ [list "is set" "set"] \
+ [list "is not set" "not_set"] \
+ ]
+
+ append form_elements {
+ {var2:text(select),optional {label {}} {options $operand_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+ if { [exists_and_not_null var2] } {
+ if { $var2 == "exists" || $var2 == "not_exists" } {
+ set action "add"
+ } else {
+ append form_elements {
+ {var3:text(text) {label {}}}
+ }
+ }
+ set add_p 1
+ }
+
+ }
+ ams_value__postal_address {
+ set operand_options [list \
+ [list "country is ->" "country_is"] \
+ [list "country is not ->" "country_is_not"] \
+ [list "state/province is ->" "state_is"] \
+ [list "state/province is not ->" "state_is_not"] \
+ [list "zip/postal starts with ->" "zip_is"] \
+ [list "zip/postal does not start with ->" "zip_is_not"] \
+ [list "is set" "set"] \
+ [list "is not set" "not_set"] \
+ ]
+
+ append form_elements {
+ {var2:text(select),optional {label {}} {options $operand_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+ if { [exists_and_not_null var2] } {
+ if { $var2 == "exists" || $var2 == "not_exists" } {
+ set action "add"
+ } elseif { $var2 == "state_is" || $var2 == "state_is_not" } {
+ append form_elements {
+ {var3:text(text) {label {}} {html {size 2 maxlength 2}}}
+ }
+ } elseif { $var2 == "country_is" || $var2 == "country_is_not" } {
+ set country_options [template::util::address::country_options]
+ append form_elements {
+ {var3:text(select) {label {}} {options $country_options}}
+ }
+ } else {
+ append form_elements {
+ {var3:text(text) {label {}} {html {size 7 maxlength 7}}}
+ }
+ }
+ set add_p 1
+ }
+
+ }
+ ams_value__number {
+ set operand_options [list \
+ [list "is ->" "is"] \
+ [list "is greater than ->" "greater_than"] \
+ [list "is less than ->" "less_than"] \
+ [list "is set" "set"] \
+ [list "is not set" "not_set"] \
+ ]
+
+ append form_elements {
+ {var2:text(select),optional {label {}} {options $operand_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+ if { [exists_and_not_null var2] } {
+ if { $var2 == "exists" || $var2 == "not_exists" } {
+ set action "add"
+ } else {
+ append form_elements {
+ {var3:integer(text) {label {}} {html {size 4 maxlength 20}}}
+ }
+ }
+ set add_p 1
+ }
+
+ }
+ ams_value__time {
+ set operand_options [list \
+ [list "is less than ->" "less_than"] \
+ [list "is more than ->" "more_than"] \
+ [list "is after ->" "after"] \
+ [list "is before ->" "before"] \
+ [list "is set" "set"] \
+ [list "is not set" "not_set"] \
+ ]
+ append form_elements {
+ {var2:text(select),optional {label {}} {options $operand_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+ if { [exists_and_not_null var2] } {
+ if { $var2 == "exists" || $var2 == "not_exists" } {
+ set action "add"
+ } else {
+ if { $var2 == "more_than" || $var2 == "less_than" } {
+ set interval_options {
+ {years years}
+ {months months}
+ {days days}
+ }
+ append form_elements {
+ {var3:integer(text) {label {}} {html {size 2 maxlength 3}}}
+ {var4:text(select) {label {}} {options $interval_options} {after_html {ago}}}
+ }
+ } else {
+ append form_elements {
+ {var3:date(date) {label {}}}
+ }
+ }
+ }
+ set add_p 1
+ }
+
+ }
+ }
+
+
+ }
+ }
+ contact {
+ set contact_options [list \
+ [list "updated in the last ->" "update"] \
+ [list "not updated in the last ->" "not_update"] \
+ [list "commented on in last ->" "comment"] \
+ [list "not commented on in last ->" "not_comment"] \
+ [list "created in the last ->" "created"] \
+ [list "not created in the last ->" "not_created"] \
+ ]
+ if { $object_type == "person" } {
+ lappend contact_options [list "has logged in" "login"]
+ lappend contact_options [list "has never logged in" "not_login"]
+ lappend contact_options [list "has logged in within ->" "login_time"]
+ lappend contact_options [list "has not logged in within ->" "not_login_time"]
+ }
+ append form_elements {
+ {var1:text(select) {label {}} {options $contact_options} {html {onClick "javascript:acs_FormRefresh('advanced_search')"}}}
+ }
+
+ if { [exists_and_not_null var1] } {
+ if { $var1 == "login" || $var1 == "not_login" } {
+ set action "add"
+ } else {
+ set interval_options {
+ {days days}
+ {months months}
+ {years years}
+ }
+ append form_elements {
+ {var2:integer(text) {label {}} {html {size 3 maxlength 4}}}
+ {var3:text(select) {label {}} {options $interval_options}}
+ }
+ }
+ set add_p 1
+ }
+ }
+ group {
+ set operand_options [list \
+ [list "contact is in ->" "in"] \
+ [list "contact is not in ->" "not_in"] \
+ ]
+
+ set group_options [contact::groups -expand "all" -privilege_required "read"]
+ set add_p 1
+ append form_elements {
+ {var1:text(select) {label {}} {options $operand_options}}
+ {var2:text(select) {label {}} {options $group_options}}
+ }
+
+ }
+ tasks {
+ set contact_options [list \
+ [list "" ""] \
+ [list "" ""] \
+ [list "" ""] \
+ [list "" ""] \
+ [list "" ""] \
+ [list "" ""] \
+ ]
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if { $add_p } {
+ append form_elements {
+ {add:text(submit) {label "Add Condition"} {value "add"}}
+ }
+} else {
+ append form_elements {
+ {next:text(submit) {label "Next"} {value "next"}}
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if { $search_exists_p } {
+ append form_elements {
+ {title:text(text),optional {label "
save this search as"} {html {size 40 maxlength 255}}}
+ {save:text(submit) {label {Save}} {value "save"}}
+ {search:text(submit) {label {Search}} {value "search"}}
+ {clear:text(submit) {label {Clear}} {value "clear"}}
+ {delete:text(submit) {label {Delete}} {value "delete"}}
+ }
+}
+ad_form -name "advanced_search" -method "GET" -form $form_elements \
+ -on_request {
+ } -edit_request {
+ } -on_refresh {
+ } -on_submit {
+ if { [contact::search::exists_p -search_id $search_id] } {
+ contact::search::update -search_id $search_id -title $title -owner_id $owner_id -all_or_any $all_or_any
+ }
+ if { $action == "add" } {
+ if { [string is false [contact::search::exists_p -search_id $search_id]] } {
+ set search_id [contact::search::new -search_id $search_id -title $title -owner_id $owner_id -all_or_any $all_or_any -object_type $object_type]
+ }
+ set var_list $var1
+ set vars [list var2 var3 var4 var5]
+ foreach var $vars {
+ if { [set $var] != "" } {
+ if { [template::element::get_property advanced_search $var widget] == "date" } {
+ set $var [join [template::util::date::get_property linear_date_no_time [set $var]] "-"]
+ }
+ lappend var_list [set $var]
+ }
+ }
+ contact::search::condition::new -search_id $search_id -type $type -var_list $var_list
+ }
+ } -after_submit {
+ if { $action == "add" } {
+# rp_internal_redirect search
+ ad_returnredirect [export_vars -base "search" -url {search_id object_type all_or_any}]
+ ad_script_abort
+ }
+ }
+
Index: openacs-4/packages/contacts/www/search.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/search.xql 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,90 @@
+
+My Signatures
+
-
READ THESE
+
+
+
+
+
+
+
Index: openacs-4/packages/contacts/www/admin/relationships.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/relationships.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/admin/relationships.tcl 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,48 @@
+# /packages/mbryzek-subsite/www/admin/rel-types/index.tcl
+
+ad_page_contract {
+
+ Shows list of all defined relationship types, excluding the parent
+ type "relationship"
+
+ @author mbryzek@arsdigita.com
+ @creation-date Sun Dec 10 17:10:56 2000
+ @cvs-id $Id: relationships.tcl,v 1.1 2005/05/18 16:45:50 matthewg Exp $
+
+} {
+} -properties {
+ context:onevalue
+ rel_types:multirow
+}
+
+set title "Relationship types"
+set context [list $title]
+
+set package_id [ad_conn package_id]
+
+# Select out all relationship types, excluding the parent type names 'relationship'
+# Count up the number of relations that exists for each type.
+db_multirow -extend { primary_type_pretty secondary_type_pretty } rel_types get_rels {
+
+select CASE WHEN primary_object_type = 'party' THEN '1' WHEN primary_object_type = 'person' THEN '2' ELSE '3' END as sort_one,
+ CASE WHEN secondary_object_type = 'party' THEN '2' WHEN secondary_object_type = 'person' THEN '3' ELSE '4' END as sort_two,
+ acs_rel_type__role_pretty_name(primary_role) as primary_role_pretty,
+ acs_rel_type__role_pretty_name(secondary_role) as secondary_role_pretty,
+ *
+ from contact_rel_types
+order by sort_one, sort_two, primary_role_pretty
+
+} {
+ switch $primary_object_type {
+ party { set primary_type_pretty "Person or Organization" }
+ organization { set primary_type_pretty "Organization" }
+ person { set primary_type_pretty "Person" }
+ }
+ switch $secondary_object_type {
+ party { set secondary_type_pretty "Person or Organization" }
+ organization { set secondary_type_pretty "Organization" }
+ person { set secondary_type_pretty "Person" }
+ }
+
+}
+ad_return_template
Index: openacs-4/packages/contacts/www/admin/role-ae.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/role-ae.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/admin/role-ae.adp 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,6 @@
+
+
+
+
+
+
+
Index: openacs-4/packages/contacts/www/admin/roles.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/roles.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/admin/roles.tcl 18 May 2005 16:45:50 -0000 1.1
@@ -0,0 +1,37 @@
+# /packages/mbryzek-subsite/www/admin/rel-types/roles.tcl
+
+ad_page_contract {
+
+ Shows all roles with links to add/delete
+
+ @author mbryzek@arsdigita.com
+ @creation-date Mon Dec 11 11:08:34 2000
+ @cvs-id $Id: roles.tcl,v 1.1 2005/05/18 16:45:50 matthewg Exp $
+
+} {
+} -properties {
+ context:onevalue
+
+}
+
+set context [list [list "relationships" "Relationship types"] "Roles"]
+
+db_multirow roles select_roles {
+ select r.role, r.pretty_name, coalesce(num1.number_rels,0) + coalesce(num2.number_rels,0) as number_rel_types
+ from acs_rel_roles r left join
+ (select t.role_one as role, count(*) as number_rels
+ from acs_rel_types t
+ group by t.role_one) num1 on r.role=num1.role left join
+ (select t.role_two as role, count(*) as number_rels
+ from acs_rel_types t
+ group by t.role_two) num2 on r.role=num2.role
+ order by lower(r.role)
+} {
+ # The role pretty names can be message catalog keys that need
+ # to be localized before they are displayed
+ set pretty_name [lang::util::localize $pretty_name]
+}
+
+ad_return_template
+
+
Index: openacs-4/packages/contacts/www/admin/widgets-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/widgets-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/contacts/www/admin/widgets-postgresql.xql 13 Jan 2005 13:57:14 -0000 1.2
+++ openacs-4/packages/contacts/www/admin/widgets-postgresql.xql 18 May 2005 16:45:50 -0000 1.3
@@ -1,15 +1,15 @@
-
-
-