From 2f61b3e0c9110d7658723c98f1a3351a3dc60893 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Nov 2012 18:28:23 +0800 Subject: [PATCH] member plugin list add new --- .../back_end/writing_books_controller.rb | 17 +- .../personal_book/app/models/writing_book.rb | 4 +- .../back_end/writing_books/_form.html.erb | 10 + .../personal_book/plugin/_profile.html.erb | 3 + vendor/built_in_modules/personal_book/init.rb | 2 +- .../back_end/diplomas_controller.rb | 17 +- .../personal_diploma/app/models/diploma.rb | 4 +- .../back_end/diplomas/_form.html.erb | 10 + .../personal_diploma/plugin/_profile.html.erb | 3 + .../built_in_modules/personal_diploma/init.rb | 2 +- .../back_end/experiences_controller.rb | 17 +- .../app/models/experience.rb | 4 +- .../back_end/experiences/_form.html.erb | 10 + .../plugin/_profile.html.erb | 3 + .../personal_experience/init.rb | 2 +- .../back_end/honors_controller.rb | 16 +- .../personal_honor/app/models/honor.rb | 4 +- .../back_end/honors/_form.html.erb | 10 + .../personal_honor/plugin/_profile.html.erb | 3 + .../built_in_modules/personal_honor/init.rb | 2 +- .../back_end/writing_journals_controller.rb | 22 +- .../app/models/writing_journal.rb | 7 +- .../back_end/writing_journals/_form.html.erb | 225 +++++++++------- .../personal_journal/plugin/_profile.html.erb | 3 + .../built_in_modules/personal_journal/init.rb | 2 +- .../personal_lab/back_end/labs_controller.rb | 18 +- .../personal_lab/app/models/lab.rb | 4 +- .../personal_lab/back_end/labs/_form.html.erb | 10 + .../personal_lab/plugin/_profile.html.erb | 3 + vendor/built_in_modules/personal_lab/init.rb | 2 +- .../back_end/writing_patents_controller.rb | 19 +- .../app/models/writing_patent.rb | 4 +- .../back_end/writing_patents/_form.html.erb | 10 + .../personal_patent/plugin/_profile.html.erb | 3 + .../built_in_modules/personal_patent/init.rb | 2 +- .../back_end/projects_controller.00.rb | 244 ------------------ .../back_end/projects_controller.rb | 17 +- .../personal_project/app/models/project.rb | 4 +- .../back_end/projects/_form.html.erb | 10 + .../personal_project/plugin/_profile.html.erb | 3 + .../built_in_modules/personal_project/init.rb | 2 +- .../back_end/researchs_controller.rb | 17 +- .../personal_research/app/models/research.rb | 4 +- .../back_end/researchs/_form.html.erb | 10 + .../plugin/_profile.html.erb | 3 + .../personal_research/init.rb | 2 +- .../back_end/writing_seminars_controller.rb | 17 +- .../app/models/writing_seminar.rb | 4 +- .../back_end/writing_seminars/_form.html.erb | 10 + .../personal_seminar/plugin/_profile.html.erb | 3 + .../built_in_modules/personal_seminar/init.rb | 2 +- 51 files changed, 426 insertions(+), 403 deletions(-) delete mode 100644 vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.00.rb diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb index 3e0dc5ea..48ebf333 100644 --- a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb +++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb @@ -179,12 +179,23 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl @writing_book = WritingBook.new(params[:writing_book]) - @writing_book.create_user_id = current_user.id - @writing_book.update_user_id = current_user.id + if params[:writing_book][:user_id] + @writing_book.create_user_id = params[:writing_book][:user_id] + @writing_book.update_user_id = params[:writing_book][:user_id] + else + @writing_book.create_user_id = current_user.id + @writing_book.update_user_id = current_user.id + end respond_to do |format| if @writing_book.save - format.html { redirect_to(panel_personal_book_back_end_writing_books_url) } + + if params[:writing_book][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_book][:user_id],:show_plugin_profile=>'Book')) } + else + format.html { redirect_to(panel_personal_book_back_end_writing_books_url) } + end + format.xml { render :xml => @writing_book, :status => :created, :location => @writing_book } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_book/app/models/writing_book.rb b/vendor/built_in_modules/personal_book/app/models/writing_book.rb index 7547d0db..bc5fbdb3 100644 --- a/vendor/built_in_modules/personal_book/app/models/writing_book.rb +++ b/vendor/built_in_modules/personal_book/app/models/writing_book.rb @@ -32,8 +32,8 @@ class WritingBook field :publication_date, :type => Date field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_form.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_form.html.erb index f6488330..40a7d02c 100644 --- a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_form.html.erb +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_form.html.erb @@ -47,6 +47,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_book.year")%> @@ -218,6 +227,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb index 5fd23486..7905433e 100644 --- a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb @@ -50,6 +50,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_plugin_writing_book_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_book/init.rb b/vendor/built_in_modules/personal_book/init.rb index ed14ab87..dc49113a 100644 --- a/vendor/built_in_modules/personal_book/init.rb +++ b/vendor/built_in_modules/personal_book/init.rb @@ -2,7 +2,7 @@ module PersonalBook OrbitApp.registration "Book",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:i18n=>'admin.personal_book' end diff --git a/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb b/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb index 6105e594..8ed95657 100644 --- a/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb +++ b/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb @@ -83,12 +83,23 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll @diploma = Diploma.new(params[:diploma]) - @diploma.create_user_id = current_user.id - @diploma.update_user_id = current_user.id + if params[:diploma][:user_id] + @diploma.create_user_id = params[:diploma][:user_id] + @diploma.update_user_id = params[:diploma][:user_id] + else + @diploma.create_user_id = current_user.id + @diploma.update_user_id = current_user.id + end respond_to do |format| if @diploma.save - format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) } + + if params[:diploma][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:diploma][:user_id],:show_plugin_profile=>'Diploma')) } + else + format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) } + end + format.xml { render :xml => @diploma, :status => :created, :location => @diploma } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_diploma/app/models/diploma.rb b/vendor/built_in_modules/personal_diploma/app/models/diploma.rb index 7897e1da..bdbab61e 100644 --- a/vendor/built_in_modules/personal_diploma/app/models/diploma.rb +++ b/vendor/built_in_modules/personal_diploma/app/models/diploma.rb @@ -24,8 +24,8 @@ class Diploma field :end_date , :type => Date field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_form.html.erb b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_form.html.erb index 58c10c28..832adf7d 100644 --- a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_form.html.erb +++ b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_form.html.erb @@ -30,6 +30,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :start_date ,t("personal_diploma.start_date")%> @@ -121,6 +130,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
\ No newline at end of file diff --git a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/plugin/_profile.html.erb b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/plugin/_profile.html.erb index 14a70523..c7bab476 100644 --- a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/plugin/_profile.html.erb @@ -50,6 +50,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_plugin_diploma_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_diploma/init.rb b/vendor/built_in_modules/personal_diploma/init.rb index 9d1b4232..5f5f61f2 100644 --- a/vendor/built_in_modules/personal_diploma/init.rb +++ b/vendor/built_in_modules/personal_diploma/init.rb @@ -2,7 +2,7 @@ module PersonalDiploma OrbitApp.registration "Diploma",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_diploma/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_diploma/plugin/profile",:i18n=>'admin.personal_diploma' end diff --git a/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb b/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb index d9f1e3e0..438ff6d5 100644 --- a/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb +++ b/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb @@ -133,12 +133,23 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo @experience = Experience.new(params[:experience]) - @experience.create_user_id = current_user.id - @experience.update_user_id = current_user.id + if params[:experience][:user_id] + @experience.create_user_id = params[:experience][:user_id] + @experience.update_user_id = params[:experience][:user_id] + else + @experience.create_user_id = current_user.id + @experience.update_user_id = current_user.id + end respond_to do |format| if @experience.save - format.html { redirect_to(panel_personal_experience_back_end_experiences_url) } + + if params[:experience][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:experience][:user_id],:show_plugin_profile=>'Experience')) } + else + format.html { redirect_to(panel_personal_experience_back_end_experiences_url) } + end + format.xml { render :xml => @experience, :status => :created, :location => @experience } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_experience/app/models/experience.rb b/vendor/built_in_modules/personal_experience/app/models/experience.rb index 1e3acfc3..0f5f48f6 100644 --- a/vendor/built_in_modules/personal_experience/app/models/experience.rb +++ b/vendor/built_in_modules/personal_experience/app/models/experience.rb @@ -24,8 +24,8 @@ class Experience field :keywords field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_form.html.erb b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_form.html.erb index a09eccee..18d01956 100644 --- a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_form.html.erb +++ b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_form.html.erb @@ -31,6 +31,15 @@
+ <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %> +
<%= f.label :experience_category ,t("personal_experience.experience_category")%> <%= f.select :experience_category_id, @experience_categorys.collect {|t| [ t.title, t.id ]} %> @@ -118,6 +127,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
\ No newline at end of file diff --git a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/plugin/_profile.html.erb b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/plugin/_profile.html.erb index f4af0c55..c589512c 100644 --- a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/plugin/_profile.html.erb @@ -51,6 +51,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_plugin_experience_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_experience/init.rb b/vendor/built_in_modules/personal_experience/init.rb index 21ae0c52..67eafc10 100644 --- a/vendor/built_in_modules/personal_experience/init.rb +++ b/vendor/built_in_modules/personal_experience/init.rb @@ -2,7 +2,7 @@ module PersonalExperience OrbitApp.registration "Experience",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_experience/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_experience/plugin/profile",:i18n=>'admin.personal_experience' end diff --git a/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb b/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb index 173e4424..18fe5255 100644 --- a/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb +++ b/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb @@ -135,10 +135,24 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController @honor.create_user_id = current_user.id @honor.update_user_id = current_user.id + + if params[:honor][:user_id] + @honor.create_user_id = params[:honor][:user_id] + @honor.update_user_id = params[:honor][:user_id] + else + @honor.create_user_id = current_user.id + @honor.update_user_id = current_user.id + end respond_to do |format| if @honor.save - format.html { redirect_to(panel_personal_honor_back_end_honors_url) } + + if params[:honor][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:honor][:user_id],:show_plugin_profile=>'Honor')) } + else + format.html { redirect_to(panel_personal_honor_back_end_honors_url) } + end + format.xml { render :xml => @honor, :status => :created, :location => @honor } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_honor/app/models/honor.rb b/vendor/built_in_modules/personal_honor/app/models/honor.rb index 86eff156..a0954ac6 100644 --- a/vendor/built_in_modules/personal_honor/app/models/honor.rb +++ b/vendor/built_in_modules/personal_honor/app/models/honor.rb @@ -22,8 +22,8 @@ class Honor field :keywords field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_form.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_form.html.erb index a8e13d91..0ce7b634 100644 --- a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_form.html.erb +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_form.html.erb @@ -30,6 +30,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_honor.year")%> @@ -81,6 +90,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/plugin/_profile.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/plugin/_profile.html.erb index 5b69c7b0..9bfd9d39 100644 --- a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/plugin/_profile.html.erb @@ -51,6 +51,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_plugin_honor_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_honor/init.rb b/vendor/built_in_modules/personal_honor/init.rb index d066cce5..4eabf85c 100644 --- a/vendor/built_in_modules/personal_honor/init.rb +++ b/vendor/built_in_modules/personal_honor/init.rb @@ -2,7 +2,7 @@ module PersonalHonor OrbitApp.registration "Honor",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_honor/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_honor/plugin/profile",:i18n=>'admin.personal_honor' end diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb index a505b031..b9e250da 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb @@ -217,13 +217,25 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC @writing_journal = WritingJournal.new(params[:writing_journal]) - @writing_journal.create_user_id = current_user.id - @writing_journal.update_user_id = current_user.id - + if params[:writing_journal][:user_id] + @writing_journal.create_user_id = params[:writing_journal][:user_id] + @writing_journal.update_user_id = params[:writing_journal][:user_id] + else + @writing_journal.create_user_id = current_user.id + @writing_journal.update_user_id = current_user.id + end + respond_to do |format| if @writing_journal.save - format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } - format.xml { render :xml => @writing_journal, :status => :created, :location => @writing_journal } + + if params[:writing_journal][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_journal][:user_id],:show_plugin_profile=>Journal)) } + else + format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } + end + + format.xml { render :xml => @writing_journal, :status => :created, :location => @writing_journal } + else format.html { render :action => "new" } format.xml { render :xml => @writing_journal.errors, :status => :unprocessable_entity } diff --git a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb index e381ed2c..2f0eafe4 100644 --- a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb +++ b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb @@ -26,15 +26,16 @@ class WritingJournal field :isbn field :vol_no field :issue_no - field :form_to + field :form_to_start + field :form_to_end field :total_pages field :keywords field :abstract field :publication_date, :type => Date field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb index cc181f91..fd64e1fe 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb @@ -25,38 +25,6 @@ <%= f.text_area :note, :size => "60x3" %>
- -
-
- -
-

<%= f.label :level_type ,t("personal_journal.level_type")%>

-
- <% @level_types.each do |level_type| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'writing_journal[journal_level_type_ids][]', level_type.id, @writing_journal.journal_level_type_ids.include?(level_type.id)%> - <%= level_type.title %> - <%= hidden_field_tag 'writing_journal[journal_level_type_ids][]', '' %> - <% end %> - <% end %> -
-
- -
-
- -
-

<%= f.label :author_type ,t("personal_journal.author_type")%>

-
- <% @author_types.each do |author_type| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'writing_journal[journal_author_type_ids][]', author_type.id, @writing_journal.journal_author_type_ids.include?(author_type.id)%> - <%= author_type.title %> - <%= hidden_field_tag 'writing_journal[journal_author_type_ids][]', '' %> - <% end %> - <% end %> -
-
@@ -83,15 +51,24 @@
- + + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %> +
<%= f.label :year ,t("personal_journal.year")%> - <%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]'} ) %> + <%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "span6"} ) %>
<%= f.label :language, t("personal_journal.language") %> - <%= f.select :language, WritingJournal::LANGUAGE_TYPES, :prompt => 'Select' %> + <%= f.select :language, WritingJournal::LANGUAGE_TYPES, :prompt => 'Select', :class => "span6" %>
+ +
+
+ <%= f.label :author_type ,t("personal_journal.author_type")%> + +
+ +
+
-
- <%= f.label :paper_type ,t("personal_journal.paper_type")%> - <%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]} %> +
+ <%= f.label :paper_type ,t("personal_journal.paper_type")%> + <%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span7" %> +
+
+ + + + <%= f.label :isbn, t("personal_journal.isbn") %> + <%= f.text_field :isbn , :class => "span12" %> +
+ + <%= f.label :keywords, t("personal_journal.keywords") %> + <%= f.text_field :keywords , :class => "span12" %> +
<%= f.label :publication_date ,t("personal_journal.publication_date")%> <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
- -
- <%= f.label :isbn, t("personal_journal.isbn") %> - <%= f.text_field :isbn %> -
- -
- <%= f.label :vol_no, t("personal_journal.vol_no") %> - <%= f.text_field :vol_no %> -
- -
- <%= f.label :issue_no, t("personal_journal.issue_no") %> - <%= f.text_field :issue_no %> -
- -
- <%= f.label :form_to, t("personal_journal.form_to") %> - <%= f.text_field :form_to %> -
- -
- <%= f.label :total_pages, t("personal_journal.total_pages") %> - <%= f.text_field :total_pages %> -
- -
- <%= f.label :url, t("personal_journal.url") %> - <%= f.text_field :url %> -
-
- <%= f.label :keywords, t("personal_journal.keywords") %> - <%= f.text_field :keywords %> -
+ <%= f.label :url, t("personal_journal.url") %> + <%= f.text_field :url , :class => "span12" %> +
-
@@ -234,6 +266,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb index cc0a2117..50bf55b6 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb @@ -49,6 +49,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_plugin_writing_journal_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_journal/init.rb b/vendor/built_in_modules/personal_journal/init.rb index 64ec7169..bdba532e 100644 --- a/vendor/built_in_modules/personal_journal/init.rb +++ b/vendor/built_in_modules/personal_journal/init.rb @@ -2,7 +2,7 @@ module PersonalJournal OrbitApp.registration "Journal",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_journal/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_journal/plugin/profile",:i18n=>'admin.personal_journal' end diff --git a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb index 0f6537c4..d0eef644 100644 --- a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb +++ b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb @@ -89,13 +89,23 @@ class Panel::PersonalLab::BackEnd::LabsController < OrbitBackendController get_tags @lab = Lab.new(params[:lab]) - - @lab.create_user_id = current_user.id - @lab.update_user_id = current_user.id + + if params[:lab][:user_id] + @lab.create_user_id = params[:lab][:user_id] + @lab.update_user_id = params[:lab][:user_id] + else + @lab.create_user_id = current_user.id + @lab.update_user_id = current_user.id + end respond_to do |format| if @lab.save - format.html { redirect_to(panel_personal_lab_back_end_labs_url) } + if params[:lab][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:lab][:user_id],:show_plugin_profile=>'Lab')) } + else + format.html { redirect_to(panel_personal_lab_back_end_labs_url) } + end + format.xml { render :xml => @lab, :status => :created, :location => @lab } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_lab/app/models/lab.rb b/vendor/built_in_modules/personal_lab/app/models/lab.rb index c2f0bb8d..4ff508d8 100644 --- a/vendor/built_in_modules/personal_lab/app/models/lab.rb +++ b/vendor/built_in_modules/personal_lab/app/models/lab.rb @@ -25,8 +25,8 @@ class Lab field :facility field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_form.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_form.html.erb index 41efdcf6..50db0aef 100644 --- a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_form.html.erb +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_form.html.erb @@ -30,6 +30,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_lab.year")%> @@ -176,6 +185,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/plugin/_profile.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/plugin/_profile.html.erb index b9d73a49..856ad86e 100644 --- a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/plugin/_profile.html.erb @@ -53,6 +53,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_back_end_lab_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_plugin_lab_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_lab/init.rb b/vendor/built_in_modules/personal_lab/init.rb index eba998dd..146b3353 100644 --- a/vendor/built_in_modules/personal_lab/init.rb +++ b/vendor/built_in_modules/personal_lab/init.rb @@ -2,7 +2,7 @@ module PersonalLab OrbitApp.registration "Lab",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_lab/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_lab/plugin/profile",:i18n=>'admin.personal_lab' end diff --git a/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb b/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb index 9a1938f8..479dc01c 100644 --- a/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb +++ b/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb @@ -133,12 +133,23 @@ class Panel::PersonalPatent::BackEnd::WritingPatentsController < OrbitBackendCon @writing_patent = WritingPatent.new(params[:writing_patent]) - @writing_patent.create_user_id = current_user.id - @writing_patent.update_user_id = current_user.id - + if params[:writing_patent][:user_id] + @writing_patent.create_user_id = params[:writing_patent][:user_id] + @writing_patent.update_user_id = params[:writing_patent][:user_id] + else + @writing_patent.create_user_id = current_user.id + @writing_patent.update_user_id = current_user.id + end + respond_to do |format| if @writing_patent.save - format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } + + if params[:writing_patent][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_patent][:user_id],:show_plugin_profile=>'Patent')) } + else + format.html { redirect_to(panel_personal_patent_back_end_writing_patents_url) } + end + format.xml { render :xml => @writing_patent, :status => :created, :location => @writing_patent } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb b/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb index 93d1b60a..146320a5 100644 --- a/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb +++ b/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb @@ -25,8 +25,8 @@ class WritingPatent field :publish_date , :type => Date field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_form.html.erb b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_form.html.erb index 46bf416f..ca862304 100644 --- a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_form.html.erb +++ b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_form.html.erb @@ -30,6 +30,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_patent.year")%> @@ -165,6 +174,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/plugin/_profile.html.erb b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/plugin/_profile.html.erb index ffcc9335..8b1142b1 100644 --- a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/plugin/_profile.html.erb @@ -51,6 +51,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_back_end_writing_patent_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_plugin_writing_patent_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_patent/init.rb b/vendor/built_in_modules/personal_patent/init.rb index f39e25d5..112777a7 100644 --- a/vendor/built_in_modules/personal_patent/init.rb +++ b/vendor/built_in_modules/personal_patent/init.rb @@ -2,7 +2,7 @@ module PersonalPatent OrbitApp.registration "Patent",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_patent/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_patent/plugin/profile",:i18n=>'admin.personal_patent' end diff --git a/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.00.rb b/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.00.rb deleted file mode 100644 index 91d919b1..00000000 --- a/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.00.rb +++ /dev/null @@ -1,244 +0,0 @@ -class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendController - include AdminHelper - include OrbitControllerLib::DivisionForDisable - - before_filter :authenticate_user! - before_filter :force_order_for_visitor,:only=>[:index,:show] - before_filter :force_order_for_user,:except => [:index,:show] - # before_filter :for_app_manager,:except => [:index,:show] - before_filter :only => [ :new,:create,:edit,:update,:create] do |controller| - controller.get_categorys('ProjectCategory') - end - - def index - - get_categorys("ProjectCategory",params[:project_project_category_id]) - @filter = params[:filter] - new_filter = params[:new_filter] - - if @filter && params[:clear] - @filter.delete(params[:type]) - elsif @filter && new_filter - if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) - @filter[new_filter[:type]].delete(new_filter[:id].to_s) - elsif @filter.has_key?(new_filter[:type]) - @filter[new_filter[:type]] << new_filter[:id].to_s - else - @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) - end - elsif new_filter - @filter = {new_filter[:type] => [new_filter[:id].to_s]} - end - - - @project_categorys = get_categories_for_index("ProjectCategory") - @project_category_ids = @project_categorys.collect{|t| t.id.to_s} + [nil] - - @projects = (params[:sort] || @filter) ? get_sorted_and_filtered("project",:project_category_id.in => @project_category_ids) : get_viewable("project",:project_category_id.in => @project_category_ids) - - get_tags - - respond_to do |format| - format.html # index.html.erb - format.xml { render :xml => @projects } - format.js - end - end - - def project_setting - - @project_types = ProjectCategory.all - - get_tags - - @set_project_type = ProjectCategory.new(:display => 'List') - @project_type_url = panel_personal_project_back_end_projects_path - - - end - - def project_category_quick_add - @set_project_type = ProjectCategory.new(:display => 'List') - @project_type_url = panel_personal_project_back_end_projects_path - @set_project_type.id = params[:id] - - respond_to do |format| - format.js - end - - end - - def project_category_quick_edit - - @set_project_type = ProjectCategory.find(params[:project_id]) - @project_type_url = panel_personal_project_back_end_project_path(@set_project_type) - - respond_to do |format| - format.js - end - end - - # GET /projects/1 - # GET /projects/1.xml - def show - @project = Project.find(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.xml { render :xml => @project } - end - end - - # GET /projects/new - # GET /projects/new.xml - def new - - @project = Project.new - - @project_categorys = ProjectCategory.all - - get_tags - - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @project } - end - end - - # GET /projects/1/edit - def edit - @project = Project.find(params[:id]) - - @project_categorys = ProjectCategory.all - - get_tags - end - - # POST /projects - # POST /projects.xml - def create - - if params[:project_category] - - @project_category = WritingPatentCategory.new(params[:project_category]) - - respond_to do |format| - if @project_category.save - format.js { render 'create_project_setting' } - end - end - - else - - - @project_categorys = ProjectCategory.all - get_tags - - @project = Project.new(params[:project]) - - @project.create_user_id = current_user.id - @project.update_user_id = current_user.id - - respond_to do |format| - if @project.save - format.html { redirect_to(panel_personal_project_back_end_projects_url) } - format.xml { render :xml => @project, :status => :created, :location => @project } - else - format.html { render :action => "new" } - format.xml { render :xml => @project.errors, :status => :unprocessable_entity } - end - end - end - - end - - # PUT /projects/1 - # PUT /projects/1.xml - def update - - if params[:project_category] - - @project_category = ProjectCategory.find(params[:id]) - - respond_to do |format| - - if @project_category.update_attributes(params[:project_category]) - # format.html { redirect_to(panel_announcement_back_end_bulletins_url) } - format.js { render 'update_project_setting' } - end - end - - else - - @project = Project.find(params[:id]) - - @project.update_user_id = current_user.id - - params[:project][:tag_ids] ||=[] - - respond_to do |format| - if @project.update_attributes(params[:project]) - format.html { redirect_to(panel_personal_project_back_end_projects_url) } - # format.js { render 'toggle_enable' } - format.xml { head :ok } - else - format.html { render :action => "edit" } - format.xml { render :xml => @project.errors, :status => :unprocessable_entity } - end - end - end - - end - - # DELETE /projects/1 - # DELETE /projects/1.xml - def destroy - @project = Project.find(params[:id]) - @project.destroy - - respond_to do |format| - format.html { redirect_to(panel_personal_project_back_end_projects_url) } - # format.xml { head :ok } - format.js - end - end - - def delete - if params[:ids] - projects = Project.any_in(:_id => params[:ids]).delete_all - end - redirect_to panel_personal_project_back_end_projects_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) - end - - protected - - - # def get_index_categories(id = nil) - # @bulletin_categorys = [] - # if(is_manager? || is_admin?) - # @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all) - # elsif is_sub_manager? - # @bulletin_categorys = BulletinCategory.all - # end - # @bulletin_categorys - # end - - - # def get_categorys(id = nil) - # @project_categorys = [] - # if(is_manager? || is_admin?) - # @project_categorys = (id ? Project.admin_manager_all.find(id).to_a : Project.admin_manager_all)) - # elsif is_sub_manager? - # @project_categorys = Project.all.authed_for_user(current_user,'edit') - # end - # if @project_categorys.empty? && params[:action] != "index" - # flash[:alert] = t("announcement.error.no_avilb_cate_for_posting") - # redirect_to :action => :index - # end - # end - - def get_tags - module_app = ModuleApp.first(:conditions => {:key => 'personal_project'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}) - end - -end diff --git a/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb b/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb index 95cfbbbb..c0cf1491 100644 --- a/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb +++ b/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb @@ -133,12 +133,23 @@ class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendControll @project = Project.new(params[:project]) - @project.create_user_id = current_user.id - @project.update_user_id = current_user.id + if params[:project][:user_id] + @project.create_user_id = params[:project][:user_id] + @project.update_user_id = params[:project][:user_id] + else + @project.create_user_id = current_user.id + @project.update_user_id = current_user.id + end respond_to do |format| if @project.save - format.html { redirect_to(panel_personal_project_back_end_projects_url) } + + if params[:project][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:project][:user_id],:show_plugin_profile=>'Research Project')) } + else + format.html { redirect_to(panel_personal_project_back_end_projects_url) } + end + format.xml { render :xml => @project, :status => :created, :location => @project } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_project/app/models/project.rb b/vendor/built_in_modules/personal_project/app/models/project.rb index 82bfe6a4..339a1bd5 100644 --- a/vendor/built_in_modules/personal_project/app/models/project.rb +++ b/vendor/built_in_modules/personal_project/app/models/project.rb @@ -27,8 +27,8 @@ class Project field :period_end_date, :type => Date field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_form.html.erb b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_form.html.erb index b5a174fb..5744ac0c 100644 --- a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_form.html.erb +++ b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_form.html.erb @@ -30,6 +30,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_project.year")%> @@ -181,6 +190,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/plugin/_profile.html.erb b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/plugin/_profile.html.erb index ad3c5490..99487b76 100644 --- a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/plugin/_profile.html.erb @@ -51,6 +51,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_back_end_project_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_plugin_project_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_project/init.rb b/vendor/built_in_modules/personal_project/init.rb index 31b52081..633ed0ac 100644 --- a/vendor/built_in_modules/personal_project/init.rb +++ b/vendor/built_in_modules/personal_project/init.rb @@ -2,7 +2,7 @@ module PersonalProject OrbitApp.registration "Research Project",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_project/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_project/plugin/profile",:i18n=>'admin.personal_project' end diff --git a/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/back_end/researchs_controller.rb b/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/back_end/researchs_controller.rb index 3489c3f1..4d89f1c1 100644 --- a/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/back_end/researchs_controller.rb +++ b/vendor/built_in_modules/personal_research/app/controllers/panel/personal_research/back_end/researchs_controller.rb @@ -77,12 +77,23 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro @research = Research.new(params[:research]) - @research.create_user_id = current_user.id - @research.update_user_id = current_user.id + if params[:research][:user_id] + @research.create_user_id = params[:research][:user_id] + @research.update_user_id = params[:research][:user_id] + else + @research.create_user_id = current_user.id + @research.update_user_id = current_user.id + end respond_to do |format| if @research.save - format.html { redirect_to(panel_personal_research_back_end_researchs_url) } + + if params[:research][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:research][:user_id],:show_plugin_profile=>'Research')) } + else + format.html { redirect_to(panel_personal_research_back_end_researchs_url) } + end + format.xml { render :xml => @research, :status => :created, :location => @research } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_research/app/models/research.rb b/vendor/built_in_modules/personal_research/app/models/research.rb index 8ac1bfd9..968dc151 100644 --- a/vendor/built_in_modules/personal_research/app/models/research.rb +++ b/vendor/built_in_modules/personal_research/app/models/research.rb @@ -22,8 +22,8 @@ class Research field :keywords field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_form.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_form.html.erb index cccd79e9..cf7451bf 100644 --- a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_form.html.erb +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_form.html.erb @@ -30,6 +30,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_research.year")%> @@ -155,6 +164,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/plugin/_profile.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/plugin/_profile.html.erb index 5fb91c11..833005eb 100644 --- a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/plugin/_profile.html.erb @@ -50,6 +50,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_back_end_research_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_research_plugin_research_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_research/init.rb b/vendor/built_in_modules/personal_research/init.rb index b2c35ef1..18bc59f6 100644 --- a/vendor/built_in_modules/personal_research/init.rb +++ b/vendor/built_in_modules/personal_research/init.rb @@ -2,7 +2,7 @@ module PersonalResearch OrbitApp.registration "Research",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_research/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_research/plugin/profile",:i18n=>'admin.personal_research' end diff --git a/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb b/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb index 5b3c4815..5a8da417 100644 --- a/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb +++ b/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb @@ -179,12 +179,23 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC @writing_seminar = WritingSeminar.new(params[:writing_seminar]) - @writing_seminar.create_user_id = current_user.id - @writing_seminar.update_user_id = current_user.id + if params[:writing_seminar][:user_id] + @writing_seminar.create_user_id = params[:writing_seminar][:user_id] + @writing_seminar.update_user_id = params[:writing_seminar][:user_id] + else + @writing_seminar.create_user_id = current_user.id + @writing_seminar.update_user_id = current_user.id + end respond_to do |format| if @writing_seminar.save - format.html { redirect_to(panel_personal_seminar_back_end_writing_seminars_url) } + + if params[:writing_seminar][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_seminar][:user_id],:show_plugin_profile=>'Seminar')) } + else + format.html { redirect_to(panel_personal_seminar_back_end_writing_seminars_url) } + end + format.xml { render :xml => @writing_seminar, :status => :created, :location => @writing_seminar } else format.html { render :action => "new" } diff --git a/vendor/built_in_modules/personal_seminar/app/models/writing_seminar.rb b/vendor/built_in_modules/personal_seminar/app/models/writing_seminar.rb index ae2048f9..00c8b8ac 100644 --- a/vendor/built_in_modules/personal_seminar/app/models/writing_seminar.rb +++ b/vendor/built_in_modules/personal_seminar/app/models/writing_seminar.rb @@ -31,8 +31,8 @@ class WritingSeminar field :publication_date, :type => Date field :url field :note - field :create_user_id - field :update_user_id + field :create_user_id, :type => BSON::ObjectId + field :update_user_id, :type => BSON::ObjectId # field :is_top, :type => Boolean, :default => false # field :is_hot, :type => Boolean, :default => false diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_form.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_form.html.erb index 22f04f60..c0b3b293 100644 --- a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_form.html.erb +++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_form.html.erb @@ -63,6 +63,15 @@
+ + <% if !params[:user_id].blank? %> + +
+ <%= t("著作人")%> + <%= User.from_id(params[:user_id]).name rescue ''%> +
+ + <% end %>
<%= f.label :year ,t("personal_seminar.year")%> @@ -220,6 +229,7 @@
+ <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/_profile.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/_profile.html.erb index 449b9833..590ecdda 100644 --- a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/_profile.html.erb @@ -51,6 +51,9 @@ +<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_seminar_back_end_writing_seminar_path(:user_id => @user.id), :class => 'btn btn-primary pull-right' %> + +
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_seminar_plugin_writing_seminar_path, :class => 'btn btn-primary pull-right' %>
diff --git a/vendor/built_in_modules/personal_seminar/init.rb b/vendor/built_in_modules/personal_seminar/init.rb index d4ab5bb8..1bd9e9d0 100644 --- a/vendor/built_in_modules/personal_seminar/init.rb +++ b/vendor/built_in_modules/personal_seminar/init.rb @@ -2,7 +2,7 @@ module PersonalSeminar OrbitApp.registration "Seminar",:type=> 'ModuleApp' do base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/personal_seminar/plugin/profile" + personal_plugin :enable => true,:path=>"panel/personal_seminar/plugin/profile",:i18n=>'admin.personal_seminar' end