Index: openacs-4/packages/contacts/sql/postgresql/contacts-search-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-search-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/contacts/sql/postgresql/contacts-search-create.sql 14 Jun 2005 06:21:48 -0000 1.3
+++ openacs-4/packages/contacts/sql/postgresql/contacts-search-create.sql 14 Jun 2005 06:51:54 -0000 1.4
@@ -19,6 +19,7 @@
object_type varchar(1000)
constraint contact_searches_object_type_nn not null,
deleted_p boolean default 'f'
+ constraint contact_searches_deleted_p_nn not null
);
-- create the content type
@@ -90,7 +91,7 @@
insert into contact_searches
(search_id,title,owner_id,all_or_any,object_type,deleted_p)
values
- (v_search_id,p_title,p_owner_id,p_all_or_any,p_object_type,deleted_p);
+ (v_search_id,p_title,p_owner_id,p_all_or_any,p_object_type,p_deleted_p);
return v_search_id;
Index: openacs-4/packages/contacts/tcl/contact-search-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/contacts/tcl/contact-search-procs.tcl 14 Jun 2005 06:08:28 -0000 1.6
+++ openacs-4/packages/contacts/tcl/contact-search-procs.tcl 14 Jun 2005 06:51:54 -0000 1.7
@@ -61,7 +61,7 @@
} {
create a contact search
} {
- return [db_0or1row delete_it { update contact_searches set deleted_p = 't' where search_id = :search_id }]
+ db_dml delete_it { update contact_searches set deleted_p = 't' where search_id = :search_id }
}
ad_proc -public contact::search::exists_p {
Index: openacs-4/packages/contacts/www/search-action.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search-action.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/contacts/www/search-action.tcl 14 Jun 2005 06:08:28 -0000 1.1
+++ openacs-4/packages/contacts/www/search-action.tcl 14 Jun 2005 06:51:54 -0000 1.2
@@ -57,15 +57,16 @@
util_user_message -html -message [_ contacts.The_search_-title-_was_made_public]
}
"copy" {
- set similar_titles [db_list get_similar_titles {}]
+ regsub -all "'" $title "''" sql_title
+ set similar_titles [db_list select_similar_titles {}]
set number 1
set orig_title $title
while { [lsearch $similar_titles $title] >= 0 } {
set title "$orig_title ($number)"
incr number
}
set new_search_id [contact::search::new -title $title -owner_id $owner_id -all_or_any $all_or_any -object_type $object_type]
- db_foreach select_search_conditions {}{
+ db_foreach select_search_conditions {} {
contact::search::condition::new -search_id $new_search_id -type $type -var_list $var_list
}
util_user_message -html -message [_ contacts.The_search_-title-_was_copied_to_your_searches]
Index: openacs-4/packages/contacts/www/search-action.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search-action.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/contacts/www/search-action.xql 14 Jun 2005 06:08:28 -0000 1.1
+++ openacs-4/packages/contacts/www/search-action.xql 14 Jun 2005 06:51:54 -0000 1.2
@@ -25,7 +25,7 @@
select title
from contact_searches
where owner_id = :owner_id
- and upper(title) like upper('${title}%')
+ and upper(title) like upper('${sql_title}%')
Index: openacs-4/packages/contacts/www/search.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/contacts/www/search.tcl 14 Jun 2005 06:08:28 -0000 1.8
+++ openacs-4/packages/contacts/www/search.tcl 14 Jun 2005 06:51:54 -0000 1.9
@@ -83,15 +83,15 @@
append form_elements {
{object_type:text(hidden) {value $object_type}}
{object_type_pretty:text(inform) {label {[_ contacts.Search_for]}} {value "$object_type_pretty"} {after_html "[_ contacts.which_match]"}}
- {all_or_any:text(select),optional {label ""} {options {{[_ acs-kernel.common_All] all} {[_ acs-kernel.common_Any] any}}} {after_html "[_ contacts.lt_of_the_following_cond]
"}}
+ {all_or_any:text(select),optional {label ""} {options {{[_ contacts.All] all} {[_ contacts.Any] any}}} {after_html "[_ contacts.lt_of_the_following_cond]
"}}
}
} else {
set object_type_options [list]
foreach object_type_temp [list party person organization] {
lappend object_type_options [list $object_type_pretty_name($object_type_temp) $object_type_temp]
}
append form_elements {
- {object_type:text(select) {label {Search for}} {options $object_type_options} {html {onChange "javascript:acs_FormRefresh('advanced_search')"}}}
+ {object_type:text(select) {label {#contacts.Search_for#}} {options $object_type_options} {html {onChange "javascript:acs_FormRefresh('advanced_search')"}}}
}
}
Index: openacs-4/packages/contacts/www/searches.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/searches.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/contacts/www/searches.xql 14 Jun 2005 06:08:28 -0000 1.1
+++ openacs-4/packages/contacts/www/searches.xql 14 Jun 2005 06:58:42 -0000 1.2
@@ -9,7 +9,7 @@
owner_id
from ( select distinct owner_id
from contact_searches
- where title is not null
+ where ( title is not null or owner_id = :user_id )
and owner_id in ( select party_id from parties )) distinct_owners
order by CASE WHEN owner_id = :user_id THEN '0000000000000000000' ELSE upper(contact__name(owner_id)) END