matthewg
committed
on 20 Feb 06
Adding envelope pdf exports
/tcl/contact-search-condition-type-procs.tcl (+5 -4)
681 681             return [_ contacts.Contact]
682 682         }
683 683     }
684 684 }
685 685
686 686
687 687
688 688
689 689
690 690 ad_proc -private contacts::search::condition_type::group {
691 691     -request:required
692 692     {-var_list ""}
693 693     {-form_name ""}
694 694     {-party_id ""}
695 695     {-revision_id ""}
696 696     {-prefix "contact"}
697 697     {-object_type ""}
698 698 } {
699 699     Return all widget procs. Each list element is a list of the first then pretty_name then the widget
700 700 } {
701       set prefix "contact"
702 701     set operand  [ns_queryget "${prefix}operand"]
703 702     set group_id [ns_queryget "${prefix}group_id"]
704 703
705 704     switch $request {
706 705         ad_form_widgets {
707 706             set form_elements [list]
708 707             set operand_options [list \
709 708                                      [list "[_ contacts.contact_is_in_-]" "in"] \
710 709                                      [list "[_ contacts.contact_is_not_in_-]" "not_in"] \
711 710                                     ]
712 711
713 712             set group_options_old [contact::groups -expand "all" -privilege_required "read"]
714 713             set group_options [list]
715 714             foreach group $group_options_old {
716 715                 set group_name [lang::util::localize [lindex $group 0]]
717 716                 set group_id [lindex $group 1]
718 717                 set group_numbers [lindex $group 2]
719 718                 lappend group_options [list "$group_name" $group_id $group_numbers]
720 719             }
721 720
 
724 723             return $form_elements
725 724         }
726 725         form_var_list {
727 726             if { [exists_and_not_null operand] && [exists_and_not_null group_id] } {
728 727                 return [list $operand $group_id]
729 728             } else {
730 729                 return {}
731 730             }
732 731         }
733 732         sql - pretty {
734 733             set operand [lindex $var_list 0]
735 734             set group_id [lindex $var_list 1]
736 735             if { $request == "pretty" } {
737 736                 set group_pretty [lang::util::localize [db_string select_group_name { select group_name from groups where group_id = :group_id }]]
738 737             } else {
739 738                 set group_pretty ""
740 739             }
741 740             switch $operand {
742 741                 in {
743 742                     set output_pretty "[_ contacts.lt_The_contact_is_in_the]"
744                       set output_code "group_id = $group_id"
  743 #                    set output_code "group_id = $group_id"
  744                     set output_code "party_id in ( select gdmm.member_id from group_distinct_member_map gdmm where group_id = $group_id )"
745 745                 }
746 746                 not_in {
747 747                     set output_pretty "[_ contacts.lt_The_contact_is_NOT_in]"
748                       set output_code "group_id != $group_id"
  748 #                    set output_code "group_id != $group_id"
  749                     set output_code "party_id not in ( select gdmm.member_id from group_distinct_member_map gdmm where group_id = $group_id )"
749 750                 }
750 751             }
751 752             if { $request == "pretty" } {
752 753                 return $output_pretty
753 754             } else {
754 755                 return $output_code
755 756             }
756 757         }
757 758         type_name {
758 759             return [_ contacts.Group]
759 760         }
760 761     }
761 762 }
762 763
763 764
764 765
765 766 ad_proc -private contacts::search::condition_type::relationship {
766 767     -request:required
767 768     {-var_list ""}
768 769     {-form_name ""}