Index: openacs-4/packages/contacts/tcl/contact-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-message-procs.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/contacts/tcl/contact-message-procs.tcl 5 Oct 2006 14:15:20 -0000 1.32 +++ openacs-4/packages/contacts/tcl/contact-message-procs.tcl 28 Oct 2006 16:51:50 -0000 1.33 @@ -275,7 +275,12 @@ -format $format] if { $mailing_address ne "" } { if {$with_name_p} { - set mailing_address "- [contact::name -party_id $party_id] -\n$mailing_address" + if {[person::person_p -party_id $party_id]} { + set mailing_address "- [contact::name -party_id $party_id] -\n$mailing_address" + } else { + set name "[contact::name -party_id $party_id] \n [ams::value -object_id $revision_id -attribute_name company_name_ext -format $format]" + set mailing_address "$name \n$mailing_address" + } } break } @@ -289,7 +294,10 @@ if { $mailing_address ne "" } { # We should display the company name. Currently handled outside this. if {$with_name_p} { - set mailing_address "[contact::name -party_id [lindex $employer 0]]\n- [contact::name -party_id $party_id] -\n $mailing_address" + set employer_id [lindex $employer 0] + set employer_rev_id [contact::live_revision -party_id $employer_id] + set name "[contact::name -party_id $employer_id]\n[ams::value -object_id $employer_rev_id -attribute_name company_name_ext -format $format]" + set mailing_address "$name\n- [contact::name -party_id $party_id] -\n$mailing_address" } break } Index: openacs-4/packages/contacts/tcl/contact-search-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-widget-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/tcl/contact-search-widget-procs.tcl 16 May 2006 16:42:41 -0000 1.4 +++ openacs-4/packages/contacts/tcl/contact-search-widget-procs.tcl 28 Oct 2006 16:51:50 -0000 1.5 @@ -88,6 +88,10 @@ template::element::set_error $element(form_id) $element_id "[_ contacts.Enter_a_query]" return [list] } + } else { + if {[string is integer $value] && [db_string party_p {select 1 from parties where party_id = :value} -default 0]} { + return $value + } } if { [string equal $value ":search:"] } { @@ -152,6 +156,7 @@ } set person_ids [list] set organization_ids [list] + # search in persons if { $persons_p } { set person_ids [db_list search_persons {}] @@ -228,6 +233,5 @@ if { $email ne "" } { append option " <${email}>" } - append option " \#$party_id" return $option } Index: openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl,v diff -u -r1.47 -r1.48 --- openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl 12 Jun 2006 07:54:21 -0000 1.47 +++ openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl 28 Oct 2006 16:51:50 -0000 1.48 @@ -488,67 +488,162 @@ return [list "Avery 5160 (1in x 2.5in, 30 per sheet)" avery5160] } template { - if { $for == "avery5160" } { - return { - - - - + switch $for { + "avery5160" { + return { + + + + + } + } + "brother" { + return { + + + + + + } + } + + } + } + } + } + +ad_proc -public -callback contact::label -impl brother { + {-request:required} + {-for ""} +} { +} { + switch $request { + ad_form_option { + return [list "Brother Etiketten (29mm x 90mm)" brother] + } + template { + switch $for { + "brother" { + return { + + + + + } + } + } } }