diff --git a/config/mongoid.yml b/config/mongoid.yml deleted file mode 100644 index 7e8d9e5cf..000000000 --- a/config/mongoid.yml +++ /dev/null @@ -1,24 +0,0 @@ -defaults: &defaults - host: localhost - # slaves: - # - host: slave1.local - port: 27017 - # - host: slave2.local - # port: 27019 - -development: - <<: *defaults - database: test_site -test: - <<: *defaults - database: test_site - -# set these environment variables on your prod server -production: - # host: <%= ENV['MONGOID_HOST'] %> - # port: <%= ENV['MONGOID_PORT'] %> - # username: <%= ENV['MONGOID_USERNAME'] %> - # password: <%= ENV['MONGOID_PASSWORD'] %> - # database: <%= ENV['MONGOID_DATABASE'] %> - <<: *defaults - database: test_site diff --git a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb index 743520dba..d77f582e7 100644 --- a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb +++ b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb @@ -44,7 +44,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Post.new(uri.request_uri) body = { - # 'auth_token' => '3kjlfksjDFJ', + # 'auth_token' => '3kjlfksjDFJ', 'name' => current_question.name, 'title' => current_question.title, 'identity' => current_question.identity, @@ -53,6 +53,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController 'tax' => current_question.tax, 'content' => current_question.content, } + request.set_form_data(body) request.add_field 'X-Auth-Token', '3kjlfksjDFJ' response = http.request(request) @@ -61,7 +62,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController new_status = "轉介其他單位" + "(" + response.code + ")" current_reply.update_attributes(status: new_status) else - new_status = "轉介其他單位" + "(" + "success!" + ")" + new_status = "轉介其他單位" + "(" + " Success!" + ")" current_reply.update_attributes(status: new_status) end diff --git a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_requests_controller.rb b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_requests_controller.rb index ce98c0a98..3580fc283 100644 --- a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_requests_controller.rb +++ b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_requests_controller.rb @@ -7,23 +7,28 @@ class Panel::Ask::BackEnd::AskRequestsController < OrbitBackendController def transfer_request if request.headers["HTTP_X_AUTH_TOKEN"] == '3kjlfksjDFJ' - if !AskCategory.where(key: "transfered_question").any? - @ask_category = AskCategory.new(name: "transfered_question", key: "transfered_question") + if !AskCategory.where(key: "transferred_question").any? + @ask_category = AskCategory.new(key: "transferred_question") + @ask_category.name_translations = { "zh_tw" => "轉介的問題", "en" => "Transferred Question" } @ask_category.save! end - category = AskCategory.where(key: "transfered_question") + + category = AskCategory.where(key: "transferred_question") + @transfered_question = AskQuestion.new( - name: params['name'], + name: params['name'], identity: params['identity'], - email: params['email'], - phone: params['phone'], - tax: params['tax'], - title: params['title'], - content: params['content'], + email: params['email'], + phone: params['phone'], + tax: params['tax'], + title: params['title'], + content: params['content'], ask_category_id: category.first.id) + @transfered_question.ask_reply = AskReply.new - @transfered_question.ask_reply.update_attributes(status: "待處理(轉)") + @transfered_question.ask_reply.update_attributes(status: "待處理 (轉)") @transfered_question.save + render :nothing => true else render :status => 500 diff --git a/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb b/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb index f22ed63ce..e96e4710a 100644 --- a/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb +++ b/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb @@ -1,7 +1,7 @@