Index: openacs-4/packages/contacts/tcl/contacts-populate-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-populate-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/contacts/tcl/contacts-populate-procs.tcl 15 Jul 2005 21:01:52 -0000 1.6 +++ openacs-4/packages/contacts/tcl/contacts-populate-procs.tcl 28 Jul 2005 13:42:54 -0000 1.7 @@ -40,19 +40,12 @@ set registered_user_group_id [contacts::default_group -package_id $package_id] - # This is a check for the customer and supplier id if P/O is installed. - if {[apm_package_enabled_p intranet-core]} { - set supplier_id [db_string freelancer_group "select group_id from groups where group_name = 'Freelancers'"] - set customers_id [db_string customers_group "select group_id from groups where group_name = 'Customers'"] - } else { - set supplier_id [group::new \ - -group_name "Supplier" "group"] - set customers_id [group::new \ + set supplier_id [db_string freelancer_group "select group_id from groups where group_name = 'Supplier'"] + +# set supplier_id [group::new -group_name "Supplier" "group"] + set customers_id [group::new \ -group_name "Customers" "group"] - } - - contact::group::map -group_id $supplier_id -package_id $contacts_package_id contact::group::map -group_id $customers_id -package_id $contacts_package_id # Hopefully all is now setup to map the groups accordingly. @@ -646,527 +639,6 @@ -attribute_id $attribute_id \ -option "Agency - PR"] - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "company_notes" \ - -datatype "text" \ - -pretty_name "Notes on Company" \ - -pretty_plural "Notes on Company" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textarea" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "70" \ - -required_p "f" \ - -section_heading "" - - # PERSON - SUPPLY - - set list_id [ams::list::new \ - -package_key "contacts" \ - -object_type "person" \ - -list_name "${contacts_package_id}__${supplier_id}" \ - -pretty_name "Person - Supplier" \ - -description "" \ - -description_mime_type ""] - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "bankaccountnumber" \ - -datatype "string" \ - -pretty_name "Bank Account Number" \ - -pretty_plural "Bank Account Numbers" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "10" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "bankcode" \ - -datatype "string" \ - -pretty_name "Bank Code" \ - -pretty_plural "Bank Codes" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "20" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "bankname" \ - -datatype "string" \ - -pretty_name "Name of Bank" \ - -pretty_plural "Name of Banks" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "30" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "languages" \ - -datatype "string" \ - -pretty_name "Languages" \ - -pretty_plural "Languages" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "multiselect" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "50" \ - -required_p "f" \ - -section_heading "" - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "English:UK"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "English_US"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "French"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "German"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Spanish"] - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "availability" \ - -datatype "text" \ - -pretty_name "Availability" \ - -pretty_plural "Availabilities" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textarea" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "60" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "subjectarea" \ - -datatype "string" \ - -pretty_name "Subject Areas" \ - -pretty_plural "Subject Areas" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "multiselect" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "70" \ - -required_p "f" \ - -section_heading "" - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Advertisement"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Computers - Webbased Technologies"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Engineering"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Law"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Public Relations"] - - set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "freelancernotes" \ - -datatype "text" \ - -pretty_name "Notes on Freelancer" \ - -pretty_plural "Notes on Freelancer" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textarea" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "71" \ - -required_p "f" \ - -section_heading "" - - # Organization - Supplier - - set list_id [ams::list::new \ - -package_key "contacts" \ - -object_type "organization" \ - -list_name "${contacts_package_id}__${supplier_id}" \ - -pretty_name "Organization - Supplier" \ - -description "" \ - -description_mime_type ""] - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "bankaccountnumber" \ - -datatype "string" \ - -pretty_name "Bank Account No." \ - -pretty_plural "Bank Account Numbers*" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "1" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "bankcode" \ - -datatype "string" \ - -pretty_name "Bank Code" \ - -pretty_plural "Bank Codes*" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "2" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "bankname" \ - -datatype "string" \ - -pretty_name "Name of Bank" \ - -pretty_plural "Name of Banks*" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "3" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "speciliazedlanguages" \ - -datatype "string" \ - -pretty_name "Specialized Languages" \ - -pretty_plural "Speciliazed Languages*" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "multiselect" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "4" \ - -required_p "f" \ - -section_heading "" - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "English_UK"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "English_US"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "French"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "German"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Spanish"] - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "specializedsubjectareas" \ - -datatype "string" \ - -pretty_name "Specialized Subject Areas" \ - -pretty_plural "Specialized Subject Areas*" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "multiselect" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "5" \ - -required_p "f" \ - -section_heading "" - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Advertisement"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Computers \ -- Webbased Technologies"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Engineering"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Law"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "Public Relations"] - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "accountmgr_supplier" \ - -datatype "string" \ - -pretty_name "Account Manager Supplier" \ - -pretty_plural "Account Managers Supplier" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textbox" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "6" \ - -required_p "f" \ - -section_heading "" - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "collaboration_notes" \ - -datatype "text" \ - -pretty_name "Notes on Collaboration" \ - -pretty_plural "Notes on Collaboration" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textarea" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "7" \ - -required_p "f" \ - -section_heading "" - # Organization - Customer set list_id [ams::list::new \ @@ -1253,74 +725,6 @@ -required_p "f" \ -section_heading "" - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "keyaccountmanager" \ - -datatype "string" \ - -pretty_name "Key Account Manager" \ - -pretty_plural "Key Account Managers" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "select" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "30" \ - -required_p "f" \ - -section_heading "" - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "GL"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "RW"] - - set option_id [ams::option::new \ - -attribute_id $attribute_id \ - -option "TK"] - - set attribute_id [attribute::new \ - -object_type "organization" \ - -attribute_name "customernotes" \ - -datatype "text" \ - -pretty_name "Notes on Customer" \ - -pretty_plural "Notes on Customer" \ - -table_name "" \ - -column_name "" \ - -default_value "" \ - -min_n_values "1" \ - -max_n_values "1" \ - -sort_order "1" \ - -storage "generic" \ - -static_p "f" \ - -if_does_not_exist] - - ams::attribute::new \ - -attribute_id $attribute_id \ - -widget "textarea" \ - -dynamic_p "t" - - ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "40" \ - -required_p "f" \ - -section_heading "" - callback contacts::populate::organization::customer_attributes -list_id $list_id # Person - Customer