Index: openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml,v
diff -u -N -r1.67 -r1.68
--- openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 14 Mar 2006 08:35:57 -0000 1.67
+++ openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 15 Mar 2006 09:05:56 -0000 1.68
@@ -262,8 +262,10 @@
Contact has never logged in
Contact has not logged in within the last: <strong>%interval%</strong>
in the search %search_link%
+ Contact last interaction in the last: <strong>%interval%</strong>
Contact not commented on in the last: <strong>%interval%</strong>
Contact not created in the last: <strong>%interval%</strong>
+ Contact last interaction in the last: <strong>%interval%</strong>
Contact not updated in the last: <strong>%interval%</strong>
Contact Rel Employment
Contact Relationships
@@ -296,6 +298,7 @@
If multiple words are used then all words must match the above critera. So, for example if our contacts database contains these entries:
Instance Permissions - Not done yet
Insufficient Permissions
+ last interaction in the last ->
Invalid input, you specified form as '%form%' but should only specify: top, bottom, none
labels are not implemented yet
"Last Name" contains "Search_Word" or
@@ -307,6 +310,7 @@
You do not have permission to delete this item from this contacts history
not commented on in last ->
not created in the last ->
+ last interacted not in the last ->
not updated in the last ->
of the following conditions:<br>
<p>When you have printed these letters you may <a href="%return_url%">return to where you were</a> or create <a href="%labels_url%">labels</a> or <a href="%envelopes_url%">envelopes</a> for these letters.<p>
Index: openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl,v
diff -u -N -r1.17 -r1.18
--- openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl 13 Mar 2006 04:04:13 -0000 1.17
+++ openacs-4/packages/contacts/tcl/contact-search-condition-type-procs.tcl 15 Mar 2006 09:05:56 -0000 1.18
@@ -550,6 +550,8 @@
[list "[_ contacts.not_in_the_search] ->" "not_in_search"] \
[list "[_ contacts.lt_updated_in_the_last_-]" "update"] \
[list "[_ contacts.lt_not_updated_in_the_la]" "not_update"] \
+ [list "[_ contacts.lt_interacted_in_the_last_-]" "interacted"] \
+ [list "[_ contacts.lt_not_interacted_in_the_la]" "not_interacted"] \
[list "[_ contacts.lt_commented_on_in_last_]" "comment"] \
[list "[_ contacts.lt_not_commented_on_in_l]" "not_comment"] \
[list "[_ contacts.lt_created_in_the_last_-]" "created"] \
@@ -640,6 +642,26 @@
set output_pretty "[_ contacts.lt_Contact_not_updated_i]"
set output_code "CASE WHEN ( select creation_date from acs_objects where object_id = $revision_id ) > ( now() - '$interval'::interval ) THEN 'f'::boolean ELSE 't'::boolean END"
}
+ interacted {
+ if { [util_memoize [list ::db_table_exists acs_mail_log]] } {
+ # mail-tracking is installed so we use this table as well as the contact_message_log
+ set interacted_table "( select recipient_id, sent_date from acs_mail_log union select recipient_id, sent_date from contact_message_log ) as messages"
+ } else {
+ set interacted_table "contact_message_log"
+ }
+ set output_pretty "[_ contacts.lt_Contact_interacted_in_th]"
+ set output_code "CASE WHEN ( select distinct on (recipient_id) sent_date from $interacted_table where recipient_id = $party_id order by recipient_id, sent_date desc ) > ( now() - '$interval'::interval ) THEN 't'::boolean ELSE 'f'::boolean END"
+ }
+ not_interacted {
+ if { [util_memoize [list ::db_table_exists acs_mail_log]] } {
+ # mail-tracking is installed so we use this table as well as the contact_message_log
+ set interacted_table "( select recipient_id, sent_date from acs_mail_log union select recipient_id, sent_date from contact_message_log ) as messages"
+ } else {
+ set interacted_table "contact_message_log"
+ }
+ set output_pretty "[_ contacts.lt_Contact_not_interacted_i]"
+ set output_code "CASE WHEN ( select distinct on (recipient_id) sent_date from $interacted_table where recipient_id = $party_id order by recipient_id, sent_date desc ) > ( now() - '$interval'::interval ) THEN 'f'::boolean ELSE 't'::boolean END"
+ }
comment {
set output_pretty "[_ contacts.lt_Contact_commented_on_]"
set output_code "CASE WHEN (select creation_date from acs_objects where object_id in ( select comment_id from general_comments where object_id = $party_id ) order by creation_date desc limit 1 ) > ( now() - '$interval'::interval ) THEN 't'::boolean ELSE 'f'::boolean END"