Commit 012be24d770e8a7480ddfaf444548883d2b6928c
1 parent
b4bacb9e
Exists in
master
and in
28 other branches
ActionItem6: added the choice of a validation entity for the enterprise
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@315 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
13 additions
and
3 deletions
Show diff stats
app/controllers/enterprise_controller.rb
app/models/enterprise.rb
1 | -#An enterprise is a kind of profile. According to the system concept, only enterprises can offer products/services | |
1 | +#An enterprise is a kind of organization. According to the system concept, only enterprises can offer products/services and ahave to be validated by an validation entity | |
2 | 2 | class Enterprise < Organization |
3 | + belongs_to :validation_entity, :class_name => 'organization' | |
3 | 4 | end | ... | ... |
app/models/organization.rb
app/views/enterprise/_form.rhtml
... | ... | @@ -24,3 +24,6 @@ |
24 | 24 | |
25 | 25 | <p><label for="management_information"><%= _('Management Information') %></label><br/> |
26 | 26 | <%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %></p> |
27 | + | |
28 | +<p><label for="validation_entity"><%= _('Validation Entity') %></label><br/> | |
29 | +<%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id] } %></p> | ... | ... |
app/views/enterprise/show.rhtml
... | ... | @@ -13,3 +13,4 @@ |
13 | 13 | <%= link_to _('Edit enterprise'), :action => 'edit', :id => @enterprise %> |
14 | 14 | <%= link_to _('Delete enterprise'), :action => 'destroy', :id => @enterprise %> |
15 | 15 | <%= link_to _('Register new enterprise'), :action => 'register_form' %> |
16 | +<%= link_to _('Affiliate'), :action => 'affiliate' %> | ... | ... |
db/migrate/003_create_profiles.rb
... | ... | @@ -9,11 +9,14 @@ class CreateProfiles < ActiveRecord::Migration |
9 | 9 | t.column :flexible_template_theme, :string, :default => "default" |
10 | 10 | t.column :flexible_template_icon_theme, :string, :default => "default" |
11 | 11 | t.column :active, :boolean, :default => false |
12 | - t.column :address, :string | |
13 | - t.column :contact_phone, :string | |
12 | + t.column :address, :string | |
13 | + t.column :contact_phone, :string | |
14 | 14 | |
15 | 15 | #person fields |
16 | 16 | t.column :user_id, :integer |
17 | + | |
18 | + #enterprise fields | |
19 | + t.column :validation_entity_id, :integer | |
17 | 20 | end |
18 | 21 | end |
19 | 22 | ... | ... |