diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index 8b47ad72d..d94025f7f 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -7,7 +7,7 @@ class App.ControllerForm extends App.Controller @form = @formGen() # @log 'form', @form if @el - @el.append( @form ) + @el.prepend( @form ) html: => @form.html() diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1631dbc66..c34ebe2b2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -116,10 +116,10 @@ curl http://localhost/api/users.json -v -u #{login}:#{password} -H "Content-Type def create user = User.new( User.param_cleanup(params) ) + user.updated_by_id = (current_user && current_user.id) || 1 user.created_by_id = (current_user && current_user.id) || 1 begin - user.save # if it's a signup, add user to customer role if user.created_by_id == 1 @@ -155,6 +155,8 @@ curl http://localhost/api/users.json -v -u #{login}:#{password} -H "Content-Type end end + user.save + # send inviteation if needed if params[:invite] diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 0e874e9b9..8bda202bb 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -73,8 +73,8 @@ class CreateBase < ActiveRecord::Migration t.references :email_address, :null => true t.column :name, :string, :limit => 100, :null => false t.column :assignment_timeout, :integer, :null => true - t.column :follow_up_possible, :string, :limit => 100, :default => 'yes', :null => true - t.column :follow_up_assignment, :boolean, :default => 1 + t.column :follow_up_possible, :string, :limit => 100, :null => false, :default => 'yes' + t.column :follow_up_assignment, :boolean, :null => false, :default => true t.column :active, :boolean, :null => false, :default => true t.column :note, :string, :limit => 250, :null => true t.column :updated_by_id, :integer, :null => false @@ -132,6 +132,18 @@ class CreateBase < ActiveRecord::Migration add_index :authorizations, [:user_id] add_index :authorizations, [:username] + create_table :translations do |t| + t.column :locale, :string, :limit => 10, :null => false + t.column :source, :string, :limit => 255, :null => false + t.column :target, :string, :limit => 255, :null => false + t.column :target_initial, :string, :limit => 255, :null => false + t.column :updated_by_id, :integer, :null => false + t.column :created_by_id, :integer, :null => false + t.timestamps + end + add_index :translations, [:source] + add_index :translations, [:locale] + end end diff --git a/db/migrate/20120101000010_create_ticket.rb b/db/migrate/20120101000010_create_ticket.rb index 5f1817cd6..e96606fdd 100644 --- a/db/migrate/20120101000010_create_ticket.rb +++ b/db/migrate/20120101000010_create_ticket.rb @@ -210,7 +210,7 @@ class CreateTicket < ActiveRecord::Migration t.column :link_object_target_value, :integer, :null => false t.timestamps end - add_index :links, [:link_object_source_id, :link_object_source_value, :link_object_target_id, :link_object_target_value, :link_types_id], :unique => true, :name => 'links_uniq_total' + add_index :links, [:link_object_source_id, :link_object_source_value, :link_object_target_id, :link_object_target_value, :link_type_id], :unique => true, :name => 'links_uniq_total' end def self.down diff --git a/db/migrate/20120101000100_create_translation.rb b/db/migrate/20120101000100_create_translation.rb deleted file mode 100644 index f1603c2a3..000000000 --- a/db/migrate/20120101000100_create_translation.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateTranslation < ActiveRecord::Migration - def up - create_table :translations do |t| - t.column :locale, :string, :limit => 10, :null => false - t.column :source, :string, :limit => 255, :null => false - t.column :target, :string, :limit => 255, :null => false - t.column :target_initial, :string, :limit => 255, :null => false - t.column :updated_by_id, :integer, :null => false - t.column :created_by_id, :integer, :null => false - t.timestamps - end - add_index :translations, [:source] - add_index :translations, [:locale] - end - - def down - drop_table :translations - end -end diff --git a/db/migrate/20121008081936_postmaster_filter_create.rb b/db/migrate/20120101000100_postmaster_filter_create.rb similarity index 100% rename from db/migrate/20121008081936_postmaster_filter_create.rb rename to db/migrate/20120101000100_postmaster_filter_create.rb diff --git a/db/migrate/20121019140507_text_module_create.rb b/db/migrate/20120101000110_text_module_create.rb similarity index 100% rename from db/migrate/20121019140507_text_module_create.rb rename to db/migrate/20120101000110_text_module_create.rb diff --git a/db/migrate/20120825005823_group_update.rb b/db/migrate/20120825005823_group_update.rb deleted file mode 100644 index e5778cdc6..000000000 --- a/db/migrate/20120825005823_group_update.rb +++ /dev/null @@ -1,22 +0,0 @@ -class GroupUpdate < ActiveRecord::Migration - def up - # t.references :signature, :null => true - add_column :groups, :signature_id, :integer, :null => true - add_column :groups, :assignment_timeout, :integer, :null => true - add_column :groups, :follow_up_possible, :string, :limit => 100, :default => 'yes', :null => true - add_column :groups, :follow_up_assignment, :boolean, :default => 1 - - create_table :signatures do |t| - t.column :name, :string, :limit => 100, :null => false - t.column :body, :string, :limit => 5000, :null => true - t.column :active, :boolean, :null => false, :default => true - t.column :note, :string, :limit => 250, :null => true - t.column :created_by_id, :integer, :null => false - t.timestamps - end - add_index :signatures, [:name], :unique => true - end - - def down - end -end diff --git a/db/migrate/20120904192450_overview_update.rb b/db/migrate/20120904192450_overview_update.rb deleted file mode 100644 index e0840a434..000000000 --- a/db/migrate/20120904192450_overview_update.rb +++ /dev/null @@ -1,8 +0,0 @@ -class OverviewUpdate < ActiveRecord::Migration - def up - add_column :overviews, :role_id, :integer, :null => true - end - - def down - end -end diff --git a/db/migrate/20120917161903_create_change_by_id.rb b/db/migrate/20120917161903_create_change_by_id.rb deleted file mode 100644 index b4830c08b..000000000 --- a/db/migrate/20120917161903_create_change_by_id.rb +++ /dev/null @@ -1,43 +0,0 @@ -class CreateChangeById < ActiveRecord::Migration - def up - add_column :channels, :updated_by_id, :integer, :null => true - add_column :overviews, :created_by_id, :integer, :null => true - add_column :overviews, :updated_by_id, :integer, :null => true - add_column :users, :updated_by_id, :integer, :null => true - add_column :signatures, :updated_by_id, :integer, :null => true - add_column :groups, :updated_by_id, :integer, :null => true - add_column :roles, :updated_by_id, :integer, :null => true - add_column :organizations, :updated_by_id, :integer, :null => true - add_column :ticket_state_types, :updated_by_id, :integer, :null => true - add_column :ticket_state_types, :created_by_id, :integer, :null => true - add_column :ticket_states, :updated_by_id, :integer, :null => true - add_column :ticket_states, :created_by_id, :integer, :null => true - add_column :ticket_priorities, :updated_by_id, :integer, :null => true - add_column :ticket_priorities, :created_by_id, :integer, :null => true - add_column :tickets, :updated_by_id, :integer, :null => true - add_column :ticket_article_types, :updated_by_id, :integer, :null => true - add_column :ticket_article_types, :created_by_id, :integer, :null => true - add_column :ticket_article_senders, :updated_by_id, :integer, :null => true - add_column :ticket_article_senders, :created_by_id, :integer, :null => true - add_column :ticket_articles, :updated_by_id, :integer, :null => true - add_column :networks, :updated_by_id, :integer, :null => true - add_column :networks, :created_by_id, :integer, :null => true - add_column :network_category_types, :updated_by_id, :integer, :null => true - add_column :network_category_types, :created_by_id, :integer, :null => true - add_column :network_privacies, :updated_by_id, :integer, :null => true - add_column :network_privacies, :created_by_id, :integer, :null => true - add_column :network_categories, :updated_by_id, :integer, :null => true - add_column :network_categories, :created_by_id, :integer, :null => true - add_column :network_items, :updated_by_id, :integer, :null => true - add_column :network_item_comments, :updated_by_id, :integer, :null => true - add_column :network_item_plus, :updated_by_id, :integer, :null => true - add_column :network_category_subscriptions, :updated_by_id, :integer, :null => true - add_column :network_item_subscriptions, :updated_by_id, :integer, :null => true - add_column :templates, :updated_by_id, :integer, :null => true - add_column :translations, :created_by_id, :integer, :null => true - add_column :translations, :updated_by_id, :integer, :null => true - end - - def down - end -end diff --git a/db/migrate/20120930160201_signature_update.rb b/db/migrate/20120930160201_signature_update.rb deleted file mode 100644 index 5ca02b7f5..000000000 --- a/db/migrate/20120930160201_signature_update.rb +++ /dev/null @@ -1,21 +0,0 @@ -class SignatureUpdate < ActiveRecord::Migration - def up - - create_table :email_addresses do |t| - t.column :realname, :string, :limit => 250, :null => false - t.column :email, :string, :limit => 250, :null => false - t.column :active, :boolean, :null => false, :default => true - t.column :note, :string, :limit => 250, :null => true - t.column :updated_by_id, :integer, :null => false - t.column :created_by_id, :integer, :null => false - t.timestamps - end - add_index :email_addresses, [:email], :unique => true - - add_column :groups, :email_address_id, :integer, :null => true - - end - - def down - end -end diff --git a/db/migrate/20121018074741_users_update.rb b/db/migrate/20121018074741_users_update.rb deleted file mode 100644 index 039becaf3..000000000 --- a/db/migrate/20121018074741_users_update.rb +++ /dev/null @@ -1,8 +0,0 @@ -class UsersUpdate < ActiveRecord::Migration - def up - add_column :users, :last_login, :timestamp, :null => true - end - - def down - end -end diff --git a/db/migrate/20121103114535_overview_update_2.rb b/db/migrate/20121103114535_overview_update_2.rb deleted file mode 100644 index f5d14caf7..000000000 --- a/db/migrate/20121103114535_overview_update_2.rb +++ /dev/null @@ -1,8 +0,0 @@ -class OverviewUpdate2 < ActiveRecord::Migration - def up - add_column :overviews, :group_by, :string, :limit => 250, :null => true - end - - def down - end -end diff --git a/db/seeds.rb b/db/seeds.rb index 1d4d6279b..04fcd47b2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1556,7 +1556,9 @@ Network::Category.create( :allow_comments => true, :network_category_type_id => Network::Category::Type.where(:name => 'Idea').first.id, :network_privacy_id => Network::Privacy.where(:name => 'logged in').first.id, - :allow_comments => true + :allow_comments => true, + :updated_by_id => 1, + :created_by_id => 1, ) Network::Category.create( :name => 'Bug Reports', @@ -1572,7 +1574,8 @@ item = Network::Item.create( :title => 'Example Announcement', :body => 'Some announcement....', :network_category_id => Network::Category.where(:name => 'Announcements').first.id, - :created_by_id => User.where(:login => '-').first.id + :updated_by_id => 1, + :created_by_id => 1, ) Network::Item::Comment.create( :network_item_id => item.id,