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.2 -r1.3 --- openacs-4/packages/contacts/tcl/contact-message-procs.tcl 1 Jul 2005 00:35:35 -0000 1.2 +++ openacs-4/packages/contacts/tcl/contact-message-procs.tcl 2 Aug 2005 20:42:23 -0000 1.3 @@ -44,6 +44,7 @@ {-description ""} {-content:required} {-content_format "text/plain"} + {-locale ""} } { save a contact message } { @@ -63,13 +64,13 @@ db_dml insert_into_message_items { insert into contact_message_items - ( item_id, owner_id, message_type ) + ( item_id, owner_id, message_type, locale ) values - ( :item_id, :owner_id, :message_type ) + ( :item_id, :owner_id, :message_type, :locale ) } } else { db_dml update_message_item { - update contact_message_items set owner_id = :owner_id, message_type = :message_type where item_id = :item_id + update contact_message_items set owner_id = :owner_id, message_type = :message_type, locale = :locale where item_id = :item_id } } Index: openacs-4/packages/contacts/tcl/contacts-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-install-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/contacts/tcl/contacts-install-procs.tcl 15 Jul 2005 21:01:52 -0000 1.11 +++ openacs-4/packages/contacts/tcl/contacts-install-procs.tcl 2 Aug 2005 20:42:23 -0000 1.12 @@ -26,34 +26,34 @@ rel_types::new -table_name "contact_rels" -create_table_p "f" \ "contact_rel" \ - "Contact Relationship" \ - "Contact Relationships" \ + "[_ contacts.Contact_Relationship]" \ + "[_ contacts.lt_Contact_Relationships]" \ "party" \ "0" \ "" \ "party" \ "0" \ "" - rel_types::create_role -role "organization" -pretty_name "Organization" -pretty_plural "Organizations" + rel_types::create_role -role "organization" -pretty_name "[_ contacts.Organization]" -pretty_plural "[_ contacts.Organizations]" rel_types::new -table_name "organization_rels" -create_table_p "f" \ "organization_rel" \ - "Organization Relationship" \ - "Organization Relationships" \ + "[_ contacts.lt_Organization_Relation]" \ + "[_ contacts.lt_Organization_Relation_1]" \ "group" \ "0" \ "" \ "organization" \ "0" \ "" - rel_types::create_role -role "employee" -pretty_name "Employee" -pretty_plural "Employees" - rel_types::create_role -role "employer" -pretty_name "Employer" -pretty_plural "Employers" + rel_types::create_role -role "employee" -pretty_name "[_ contacts.Employee]" -pretty_plural "[_ contacts.Employees]" + rel_types::create_role -role "employer" -pretty_name "[_ contacts.Employer]" -pretty_plural "[_ contacts.Employers]" rel_types::new -table_name "contact_rel_employment" -create_table_p "t" -supertype "contact_rel" -role_one "employee" -role_two "employer" \ "contact_rels_employment" \ - "Contact Rel Employment" \ - "Contact Rels Employment" \ + "[_ contacts.lt_Contact_Rel_Employmen]" \ + "[_ contacts.lt_Contact_Rels_Employme]" \ "person" \ "0" \ "" \ @@ -76,7 +76,7 @@ -package_key "contacts" \ -object_type "person" \ -list_name "${package_id}__$default_group" \ - -pretty_name "Person - Registered Users" \ + -pretty_name "[_ contacts.lt_Person_-_Registered_U]" \ -description "" \ -description_mime_type ""] 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.25 -r1.26 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 29 Jul 2005 02:17:39 -0000 1.25 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 2 Aug 2005 20:42:23 -0000 1.26 @@ -318,23 +318,41 @@ Upgrade a person to a user. This proc does not send an email to the newly created user. } { contact::flush -party_id $person_id - ns_log Notice "set username [contact::email -party_id $person_id]" + set user_id $person_id + set username [contact::email -party_id $person_id] + set authority_id [auth::authority::local] db_transaction { - set username [contact::email -party_id $person_id] - set user_id $person_id - set extra_vars [ns_set create] - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {user_id username} - package_instantiate_object -extra_vars $extra_vars user - # we reset the password in admin mode. this means that an email - # will not automatically be sent. - auth::password::reset -authority_id [auth::authority::local] -username $username -admin + db_dml upgrade_user {update acs_objects set object_type = 'user' where object_id = :user_id; + + insert into users + (user_id, authority_id, username, email_verified_p) + values + (:user_id, :authority_id, :username, 't'); + + insert into user_preferences + (user_id) + values + (:user_id);} + + # we reset the password in admin mode. this means that an email + # will not automatically be sent. + auth::password::reset -authority_id [auth::authority::local] -username $username -admin group::add_member \ -group_id "-2" \ -user_id $person_id \ -rel_type "membership_rel" + + # Grant the user to update the password on himself + permission::grant -party_id $user_id -object_id $user_id -privilege write + + # add him to dotlrn (I'M LAZY) + #dotlrn::user_add -user_id $user_id + } on_error { - error "There was an error in contact::person_upgrade_to_user: $errmsg" + error "There was an error in contact::person_upgrade_to_user: $errmsg" } + + # I'm too lazy to write } ad_proc -private contact::group::new { @@ -387,8 +405,8 @@ set user_id [ad_conn user_id] set group_list [list] # Filter clause - set filter_clause "" - # set filter_clause "and groups.group_id not in (select community_id from dotlrn_communities_all)" + # set filter_clause "" + set filter_clause "and groups.group_id not in (select community_id from dotlrn_communities_all)" db_foreach get_groups {} { if {$mapped_p || $all_p} {