Index: openacs-4/packages/dotlrn/tcl/dotlrn-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-callback-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/dotlrn/tcl/dotlrn-callback-procs.tcl 19 Jul 2005 22:20:26 -0000 1.1.2.2 +++ openacs-4/packages/dotlrn/tcl/dotlrn-callback-procs.tcl 31 Jul 2005 22:33:50 -0000 1.1.2.3 @@ -15,9 +15,10 @@ {-form:required} {-object_type:required} {-party_id} + {-group_ids ""} } { Callback to hook into the contacts system. If you create a new - organization within contacts you are offered the option to create + organization of the group "Customer" within contacts you generate a new .LRN club for it (assuming that each organization contacts deserves it's own club. } { @@ -34,11 +35,11 @@ } if {$already_linked_p == "f"} { - ad_form -extend -name $form -form { - {create_club_p:text(radio) \ - {label "[_ dotlrn.Create_Club]"} \ - {options {{[_ acs-kernel.common_Yes] "t"} {[_ acs-kernel.common_no] "f"}}} \ - {values "f"} + if {[lsearch $group_ids [group::get_id -group_name "Customers"]] > -1} { + ad_form -extend -name $form -form { + {create_club_p:text(hidden) \ + {value "t"} + } } } } @@ -51,6 +52,7 @@ {-name:required} } { Callback to create a new club for a new organization in Contacts. + It also registers all employees of the organization within the club } { upvar create_club_p create_club_p @@ -65,6 +67,12 @@ # Link the file storage directly to the contact set fs_id [fs::get_root_folder -package_id [dotlrn_community::get_package_id_from_package_key -package_key "file-storage" -community_id $club_id]] application_data_link::new -this_object_id $contact_id -target_object_id $fs_id + + # Get list of employees and register them within the community + set employee_list [contact::util::get_employees -organization_id $contact_id] + foreach employee_id $employee_list { + dotlrn_club::add_user -community_id $club_id -user_id $employee_id + } } }