diff --git a/app/controllers/profile_admin/membership_editor_controller.rb b/app/controllers/profile_admin/membership_editor_controller.rb index db10062..3683a1e 100644 --- a/app/controllers/profile_admin/membership_editor_controller.rb +++ b/app/controllers/profile_admin/membership_editor_controller.rb @@ -4,17 +4,17 @@ class MembershipEditorController < ProfileAdminController @memberships = current_user.person.memberships end - def new_enteprise + def new_enterprise @enterprise = Enterprise.new() @vitual_communities = Environment.find(:all) @validation_entities = Organization.find(:all) end - def create_enteprise + def create_enterprise @enterprise = Enterprise.new(params[:enterprise]) @enterprise.organization_info = OrganizationInfo.new(params[:organization]) if @enterprise.save - @enterprise.people << @person + @enterprise.affiliate(@person, Role.find_by_name('owner')) flash[:notice] = _('The enterprise was succesfully created, the validation entity will cotact you as soon as your enterprise is approved') redirect_to :action => 'index' else @@ -29,5 +29,4 @@ class MembershipEditorController < ProfileAdminController def search @tagged_enterprises = Enterprise.search(params[:query]) end - end diff --git a/app/views/membership_editor/_form.rhtml b/app/views/membership_editor/_form.rhtml new file mode 100644 index 0000000..c435e07 --- /dev/null +++ b/app/views/membership_editor/_form.rhtml @@ -0,0 +1,32 @@ +
+<%= text_field 'enterprise', 'name', 'size' => 20 %>
+<%= text_field 'enterprise', 'address', 'size' => 50 %>
+<%= text_field 'enterprise', 'contact_phone', 'size' => 20 %>
+<%= text_field 'organization_info', 'contact_person', 'size' => 20 %>
+<%= text_field 'organization_info', 'acronym', 'size' => 20 %>
+<%= text_field 'organization_info', 'foundation_year', 'size' => 20 %>
+<%= text_field 'organization_info', 'legal_form', 'size' => 20 %>
+<%= text_field 'organization_info', 'economic_activity', 'size' => 20 %>
+<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %>
+<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %>
+<%= text_field 'enterprise', 'tag_list', 'size' => 20 %>
<%= _('Fill the form and hit the Register button then the enterprise will be submitted for evaluation at the validation entitiy of your choice (within your state), when the enterprise is aproved you will be able to activate its profile') %>
+ +<% form_tag :action => 'create_enterprise' do %> +
+ <%= text_field 'enterprise', 'identifier', 'size' => 20 %>
<%= submit_tag _('Register') %> +<%= link_to _('Cancel'), :action => 'index' %>
+<% end %> diff --git a/app/views/membership_editor/search.rhtml b/app/views/membership_editor/search.rhtml new file mode 100644 index 0000000..0387a8e --- /dev/null +++ b/app/views/membership_editor/search.rhtml @@ -0,0 +1,3 @@ +