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 -r1.18 -r1.19 --- openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 14 Jun 2005 06:40:50 -0000 1.18 +++ openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 14 Jun 2005 11:29:27 -0000 1.19 @@ -120,6 +120,8 @@ -- top level group -- Add relationship type Add to Selected Group(s) + Add new %object_type% in Selected Group(s) + Add new %object_type% in Group(s) Advanced searches are very powerful but in return they require very specific input... 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. %attribute_pretty% area code is: <strong>%option_pretty%</strong> @@ -242,7 +244,7 @@ You have not specified a valid contact type You have specified an invalid Object Type You have specified an invalid size for the textarea - Your administrator must map and add a default group in the <a href=\"admin\">admin pages</a> + Your administrator must map and add a default group in the <a href="admin">admin pages</a> Your need to provide some contacts to send a message Your provided an invalid Message Type zip/postal does not start with -> Index: openacs-4/packages/contacts/tcl/contacts-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 12 Jun 2005 19:30:14 -0000 1.13 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 14 Jun 2005 11:29:27 -0000 1.14 @@ -245,6 +245,7 @@ {-privilege_required "read"} {-output "list"} {-all:boolean} + {-no_member_count:boolean} } { } { set user_id [ad_conn user_id] @@ -267,7 +268,11 @@ list { set list_output [list] foreach group $group_list { - lappend list_output [list [lindex $group 0] [lindex $group 1] [lindex $group 2]] + if {$no_member_count_p} { + lappend list_output [list [lindex $group 0] [lindex $group 1]] + } else { + lappend list_output [list [lindex $group 0] [lindex $group 1] [lindex $group 2]] + } } return $list_output } Index: openacs-4/packages/contacts/www/contact-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/contact-add.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/contacts/www/contact-add.tcl 14 Jun 2005 07:26:48 -0000 1.12 +++ openacs-4/packages/contacts/www/contact-add.tcl 14 Jun 2005 11:29:27 -0000 1.13 @@ -7,7 +7,7 @@ } { {object_type "person"} - {group_id "-2"} + {group_ids ""} } -validate { valid_type -requires {object_type} { if { [lsearch [list organization person] $object_type] < 0 } { @@ -16,6 +16,12 @@ } } +set group_list [contact::groups] + +if {[empty_string_p $group_ids] && [llength $group_list] > 0} { + ad_returnredirect "[export_vars -base "../select-groups" -url {object_type}]" +} + set path_info [ad_conn path_info] if { $path_info == "add/person" } { set object_type "person" @@ -33,15 +39,12 @@ set default_group_id [contacts::default_group -package_id $package_id] set application_group_id [application_group::group_id_from_package_id -package_id [ad_conn subsite_id]] -set group_ids [list $default_group_id] - -if {![empty_string_p group_id] && $group_id != $default_group_id} { - lappend group_ids $group_id - lappend form_elements {group_id:text(hidden) {value $group_id}} +if {[lsearch $group_ids $default_group_id] == -1} { + lappend group_ids $default_group_id } # Save Group Information -if {$default_group_id != $application_group_id} { +if {[lsearch $group_ids $application_group_id] == -1} { lappend group_ids $application_group_id } @@ -267,7 +270,7 @@ if { [exists_and_not_null formbutton\:save_add_another] } { ad_returnredirect [export_vars -base "contact-add" -url {object_type group_id}] } else { - ad_returnredirect [export_vars -base "." -url {{query_id $group_id}}] + ad_returnredirect [export_vars -base "../" -url {{query_id $group_id}}] } ad_script_abort } Index: openacs-4/packages/contacts/www/select-groups.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/select-groups.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/contacts/www/select-groups.adp 14 Jun 2005 11:29:27 -0000 1.1 @@ -0,0 +1,10 @@ + + +@title@ +@context@ + + + + + + Index: openacs-4/packages/contacts/www/select-groups.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/select-groups.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/contacts/www/select-groups.tcl 14 Jun 2005 11:29:27 -0000 1.1 @@ -0,0 +1,45 @@ +ad_page_contract { + List and manage contacts. + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id: select-groups.tcl,v 1.1 2005/06/14 11:29:27 maltes Exp $ +} { + {object_type} +} + + +set title "[_ contacts.Add_new_in_Group]" +set user_id [ad_conn user_id] +set context [list $title] +set package_id [ad_conn package_id] + +set form_elements { + object_type:text(hidden) +} + +set group_options [contact::groups -privilege_required "create"] +if { [llength $group_options] == "0" } { + ad_return_error "[_ contacts.lt_Insufficient_Permissi]" "[_ contacts.lt_You_do_not_have_permi]" +} + +append form_elements { + {group_ids:text(checkbox),multiple {label "[_ contacts.Add_to_Groups]"} {options $group_options}} +} +set edit_buttons [list [list "[_ contacts.lt_Add_new_in_Selected_Group]" create]] + +ad_form \ + -name group-parties-add \ + -cancel_label "[_ contacts.Cancel]" \ + -cancel_url "." \ + -edit_buttons $edit_buttons \ + -form $form_elements \ + -on_request { + } -on_submit { + ad_returnredirect [export_vars -base "add/${object_type}" -url {object_type group_ids}] + } -after_submit { + ad_returnredirect [export_vars -base "add/${object_type}" -url {object_type group_ids}] + ad_script_abort + } + +