• 颈椎贴 at 2013年09月05日

    #32 楼 @zj0713001 是啊,有个把月研究其他东西去了,ruby 被搁置了,正准备重新捡起来呢,发了个 mail 给您,结果。。。只好来这悄悄的借用一下他人地盘。。。

  • 颈椎贴 at 2013年09月05日
  • #31 楼 @ChanceDoor 前面我贴出来的那一串错误信息,不会是系统让我搞来搞去搞坏了吧?

  • #31 楼 @ChanceDoor 谢谢你,正在下载 ing

  • #28 楼 @ChanceDoor 我昨天装上后,感觉就多了”联系人“模块,但是页面内的内容好少,不细看几乎看不出啥变化。

  • #29 楼 @ChanceDoor 我昨天照那段话操作了,先卸载了之前的安装。

    第一部分,这块没明白他什么意思,我跳过没处理。 Unzip plugin into ./plugins/. This would result in a directory-path like: ./plugins/redmine_contacts/init.rb

    从第二部分开始,执行了这句话。结果报错,我尝试按照提示修改都没成功。 bundle install --without development test

    今天想在返回到昨天的状态,按照昨天的操作再来一次,结果执行昨天操作的语句: rake redmine:plugins:migrate RAILS_ENV=production

    新报了这个错误:

    C:\Documents and Settings\Administrator\桌面>cd c:\Sites\redmine-2.3.0

    C:\Sites\redmine-2.3.0>cmd C:\RailsInstaller\Ruby1.9.3\setup_environment.bat Microsoft Windows XP 版本 5.1.2600 版权所有 1985-2001 Microsoft Corp.

    C:\Sites\redmine-2.3.0>rake redmine:plugins:migrate RAILS_ENV=production [31mCould not find rmagick-2.13.2 in any of the sources[0m [33mRun bundle install to install missing gems.[0m

    C:\Sites\redmine-2.3.0>gem install rmagick Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb checking for Ruby version >= 1.8.5... yes 无效驱动器规格。 Unable to get ImageMagick version *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

    Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/RailsInstaller/Ruby1.9.3/bin/ruby

    Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9 .1/gems/rmagick-2.13.2 for inspection. Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rmagick-2 .13.2/ext/RMagick/gem_make.out

    C:\Sites\redmine-2.3.0>bundle install rmagick bundle install requires at least 0 argument: "bundle install".

    C:\Sites\redmine-2.3.0>

  • #25 楼 @zj0713001 感觉我白天装的插件好像缺少一些东西,我把他卸了。

    在 CRM 网站上看到这段话:

    Installation Unzip plugin into ./plugins/. This would result in a directory-path like: ./plugins/redmine_contacts/init.rb

    Install dependent ruby gems by following command: bundle install --without development test

    Migrate database and copy assets by following command: bundle exec rake redmine:plugins NAME=redmine_contacts RAILS_ENV=production

    You now need to restart Redmine so that it shows the newly installed plugin in the list of installed plugins ("Administration -> Plugins"). Go to "Administration -> Contacts" and setup plugin global settings.

    是不是应该按照这样来安装?

    第一块这段话没理解,init.rb 这个文件有什么讲究么?

    Unzip plugin into ./plugins/. This would result in a directory-path like: ./plugins/redmine_contacts/init.rb

  • #25 楼 @zj0713001 嗯,初来匝道,就受到你这位大牛帮助,让我不知如何表达感激之情...

  • #23 楼 @zj0713001 你对我的帮助,让我很感动啊。

  • #21 楼 @zj0713001 http://www.redminecrm.com/projects/crm/pages/1

    我从这个页面下载的 CRM 插件

  • #18 楼 @zj0713001 再问一下,我现在装上后出来的界面样子和网上介绍的差距很大,有没有可能我安装的这一系列操作有问题,导致安装不完整?很多东西出不来?

  • #18 楼 @zj0713001 明白了。谢谢你。 :$

  • #16 楼 @zj0713001 就是说我这里的 rails 版本,已经不需要做这步: 1、下载插件,将插件的文件夹复制到 redmine 安装目录下的/vendor/plugins 目录下。

    该插件已经做成 gem,放到文件夹内的 gemfile 里了?

    所以之前提示信息要装那个 gem 文件?

  • #13 楼 @zj0713001 你说打成 gem,放在 gemfile 里是具体某一个 gemfile 么?

    我发现我这里,在 rails 路径下以及 redmine 的根目录和各插件里都有 gemfile 文件,

    他们的作用是不是各不相同的?你说的是不是在 rails 路径下的 gemfile?

  • #12 楼 @ChanceDoor 谢谢你,安装好像成功了,但是我这里显示的内容感觉好少啊,不知道这里有没有人也用过 redmine 的,看看我折腾的对不对。

    没有像网上查到的插件介绍的图片那么丰富

    也没找到 deals 这项内容,不知道是不是我还没找到配置的地方。

  • #6 楼 @tuliang 安装 gem 后,再次更新插件,这次提示如下信息。

    看信息我理解是要删除我的 Rails 4.0??要怎么另存为或者处理什么 Gemfile 或者 myplugin.rb 文件么?

    DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them i n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from at C:/Sites/redmine-2.3.0/Rakefile:7)

  • #8 楼 @ChanceDoor 谢谢你的建议,英文我的硬伤啊 @_@,将来努力补补。

  • #5 楼 @subsky 运行 rake exec bundle install 提示一样的信息。

  • #3 楼 @mouse_lin 我还是小菜,不知道怎么装他提示的 gem :$

  • #1 楼 @mouse_lin 可是我现在没时间换系统,等活干完,我自己重新搞个系统再来好好学习。

  • #3 楼 @zj0713001 很高兴看到你的回帖,今天我解决了第一个问题,这些要归功于这里前辈们对我的帮助,特别是之前你对我的耐心指点,在此表示感谢 ^_^

  • #1 楼 @tuliang 感谢你的热心帮助,

    是不是他取自我本地的 controllers 文件夹下,所用到的 controllers 文件中开头定义的类名WktimeController中的除 Controller 外的部分? (class WktimeController < ApplicationController)

  • #40 楼 @zj0713001 你说的启动 development 模式是用这个命令?我这结果是不是失败?是命令不对么?

    C:\Sites\redmine-2.3.0>rails s => Booting WEBrick => Rails 3.2.13 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/l ib/mysql2/client.rb:44:in connect': Access denied for user 'root'@'localhost' ( using password: NO) (Mysql2::Error) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11- x86-mingw32/lib/mysql2/client.rb:44:ininitialize' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in new' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:inmysql2_conn ection' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in new_connection' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in checkout_new_connection' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in block (2 levels) in checkout' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in loop' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3 .2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in block in checkout' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:inmon_s ynchronize'

  • #42 楼 @_samqiu 你写过啊,如果你有空也方便的话交流交流,多多指点。

  • #38 楼 @zj0713001 那怎么启动能显示 sql?

    我真是弱爆了,基础用语都不知道.......@_@

  • #36 楼 @zj0713001 你说的 guides 是什么?,没找到。

    我找的 log 里面看不出 sql,麻烦你帮我看看

    Connecting to database specified by database.yml OpenIdAuthentication.store is nil. Using in-memory store. Creating scope :sorted. Overwriting existing method Group.sorted. Creating scope :sorted. Overwriting existing method User.sorted. Started GET "/wktime/index?utf8=%E2%9C%93&getusers_url=%2Fwktime%2Fgetusers&tab=wktime&project_id=2&user_id=0&status=all&period_type=1&period=current_year" for 127.0.0.1 at 2013-07-17 13:26:01 +0800 Processing by WktimeController#index as HTML Parameters: {"utf8"=>"✓", "getusers_url"=>"/wktime/getusers", "tab"=>"wktime", "project_id"=>"2", "user_id"=>"0", "status"=>"all", "period_type"=>"1", "period"=>"current_year"} Current user: xwj (id=5) DEPRECATION WARNING: Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments. (called from initialize at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:28) DEPRECATION WARNING: Paginator#items_per_page will be removed. Use #per_page instead. (called from items_per_page at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:94) DEPRECATION WARNING: Paginator#current will be removed. Use .offset instead of .current.offset. (called from current at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:99) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered common/_tabs.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_date_range.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_list.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_te_index.html.erb (109.4ms) Rendered plugins/redmine_wktime/app/views/wktime/index.html.erb within layouts/base (265.6ms) Completed 200 OK in 2078ms (Views: 359.4ms | ActiveRecord: 46.9ms) Started GET "/wktime/edit?project_Id=2&startday=2013-04-21&tab=wktime&user_id=3" for 127.0.0.1 at 2013-07-17 13:26:09 +0800 Processing by WktimeController#edit as HTML Parameters: {"project_Id"=>"2", "startday"=>"2013-04-21", "tab"=>"wktime", "user_id"=>"3"} Current user: xwj (id=5) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_row_template.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_header.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row_header.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_issue_header.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues.html.erb (171.9ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_footer.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/edit.html.erb within layouts/base (203.1ms) Completed 200 OK in 328ms (Views: 234.4ms | ActiveRecord: 15.6ms) Connecting to database specified by database.yml OpenIdAuthentication.store is nil. Using in-memory store. Creating scope :sorted. Overwriting existing method Group.sorted. Creating scope :sorted. Overwriting existing method User.sorted. Started GET "/wktime/index?utf8=%E2%9C%93&getusers_url=%2Fwktime%2Fgetusers&tab=wktime&project_id=2&user_id=0&status=all&period_type=1&period=current_year" for 127.0.0.1 at 2013-07-17 13:29:03 +0800 Processing by WktimeController#index as / Parameters: {"utf8"=>"✓", "getusers_url"=>"/wktime/getusers", "tab"=>"wktime", "project_id"=>"2", "user_id"=>"0", "status"=>"all", "period_type"=>"1", "period"=>"current_year"} Current user: xwj (id=5) DEPRECATION WARNING: Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments. (called from initialize at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:28) DEPRECATION WARNING: Paginator#items_per_page will be removed. Use #per_page instead. (called from items_per_page at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:94) DEPRECATION WARNING: Paginator#current will be removed. Use .offset instead of .current.offset. (called from current at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:99) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered common/_tabs.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_date_range.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_list.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_te_index.html.erb (140.6ms) Rendered plugins/redmine_wktime/app/views/wktime/index.html.erb within layouts/base (406.2ms) Completed 200 OK in 2172ms (Views: 468.8ms | ActiveRecord: 78.1ms) Started GET "/wktime/index?utf8=%E2%9C%93&getusers_url=%2Fwktime%2Fgetusers&tab=wktime&project_id=2&user_id=0&status=all&period_type=1&period=current_year" for 127.0.0.1 at 2013-07-17 13:29:08 +0800 Processing by WktimeController#index as / Parameters: {"utf8"=>"✓", "getusers_url"=>"/wktime/getusers", "tab"=>"wktime", "project_id"=>"2", "user_id"=>"0", "status"=>"all", "period_type"=>"1", "period"=>"current_year"} Current user: xwj (id=5) DEPRECATION WARNING: Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments. (called from initialize at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:28) DEPRECATION WARNING: Paginator#items_per_page will be removed. Use #per_page instead. (called from items_per_page at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:94) DEPRECATION WARNING: Paginator#current will be removed. Use .offset instead of .current.offset. (called from current at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:99) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered common/_tabs.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_date_range.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_list.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_te_index.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/index.html.erb within layouts/base (15.6ms) Completed 200 OK in 47ms (Views: 31.2ms | ActiveRecord: 0.0ms) Started GET "/wktime/edit?project_Id=2&startday=2013-04-21&tab=wktime&user_id=3" for 127.0.0.1 at 2013-07-17 13:29:12 +0800 Processing by WktimeController#edit as HTML Parameters: {"project_Id"=>"2", "startday"=>"2013-04-21", "tab"=>"wktime", "user_id"=>"3"} Current user: xwj (id=5) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_row_template.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_header.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row_header.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_issue_header.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues.html.erb (62.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_footer.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/edit.html.erb within layouts/base (109.4ms) Completed 200 OK in 281ms (Views: 187.5ms | ActiveRecord: 31.2ms) Connecting to database specified by database.yml OpenIdAuthentication.store is nil. Using in-memory store. Creating scope :sorted. Overwriting existing method Group.sorted. Creating scope :sorted. Overwriting existing method User.sorted. Started GET "/wktime/index?utf8=%E2%9C%93&getusers_url=%2Fwktime%2Fgetusers&tab=wktime&project_id=2&user_id=0&status=all&period_type=1&period=current_year" for 127.0.0.1 at 2013-07-17 13:32:35 +0800 Processing by WktimeController#index as / Parameters: {"utf8"=>"✓", "getusers_url"=>"/wktime/getusers", "tab"=>"wktime", "project_id"=>"2", "user_id"=>"0", "status"=>"all", "period_type"=>"1", "period"=>"current_year"} Current user: xwj (id=5) DEPRECATION WARNING: Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments. (called from initialize at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:28) DEPRECATION WARNING: Paginator#items_per_page will be removed. Use #per_page instead. (called from items_per_page at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:94) DEPRECATION WARNING: Paginator#current will be removed. Use .offset instead of .current.offset. (called from current at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:99) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered common/_tabs.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_date_range.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_list.html.erb (31.2ms) Rendered plugins/redmine_wktime/app/views/wktime/_te_index.html.erb (109.4ms) Rendered plugins/redmine_wktime/app/views/wktime/index.html.erb within layouts/base (390.6ms) Completed 200 OK in 2203ms (Views: 437.5ms | ActiveRecord: 78.1ms) Started GET "/wktime/index?utf8=%E2%9C%93&getusers_url=%2Fwktime%2Fgetusers&tab=wktime&project_id=2&user_id=0&status=all&period_type=1&period=current_year" for 127.0.0.1 at 2013-07-17 13:32:39 +0800 Processing by WktimeController#index as / Parameters: {"utf8"=>"✓", "getusers_url"=>"/wktime/getusers", "tab"=>"wktime", "project_id"=>"2", "user_id"=>"0", "status"=>"all", "period_type"=>"1", "period"=>"current_year"} Current user: xwj (id=5) DEPRECATION WARNING: Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments. (called from initialize at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:28) DEPRECATION WARNING: Paginator#items_per_page will be removed. Use #per_page instead. (called from items_per_page at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:94) DEPRECATION WARNING: Paginator#current will be removed. Use .offset instead of .current.offset. (called from current at C:/Sites/redmine-2.3.0/lib/redmine/pagination.rb:99) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_tab_content.html.erb (0.0ms) Rendered common/_tabs.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_date_range.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_list.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_te_index.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/index.html.erb within layouts/base (15.6ms) Completed 200 OK in 47ms (Views: 31.2ms | ActiveRecord: 0.0ms) Started GET "/wktime/edit?project_Id=2&startday=2013-04-21&tab=wktime&user_id=3" for 127.0.0.1 at 2013-07-17 13:32:42 +0800 Processing by WktimeController#edit as HTML Parameters: {"project_Id"=>"2", "startday"=>"2013-04-21", "tab"=>"wktime", "user_id"=>"3"} Current user: xwj (id=5) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_row_template.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_header.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row_header.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_issue_header.html.erb (15.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_wktime_cf_in_row.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues.html.erb (109.4ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_footer.html.erb (0.0ms) Rendered plugins/redmine_wktime/app/views/wktime/edit.html.erb within layouts/base (156.2ms) Completed 200 OK in 281ms (Views: 171.9ms | ActiveRecord: 62.5ms)

  • #33 楼 @hooopo 别说这话,你这一说,让我觉得更惭愧,我是问的有点多,你也是实话实说而已 :P 我前面那么一说只是自己觉得水平太菜,这么多不懂,没有说你的意思。

  • #31 楼 @zj0713001 先请教一下,根据你前几天回的帖,我调试了一下,发现你说的没错。edit 这段代码里面

    
    
    def   edit
        respond_to do |format|
            format.html {
                @prev_template = false
                @new_custom_field_values = getNewCustomField
                setup
                findWkTE(@startday)
                @editable = @wktime.nil? || @wktime.status == 'n' || @wktime.status == 'r'
                @entries = findEntries()
                set_project_issues(@entries)
    '这个if条件里面的内容没有执行因为 @entries结果集非空
    ===============================================
                if @entries.blank? && !params[:prev_template].blank?
                    @prev_entries = prevTemplate(@user.id)
    
                    if !@prev_entries.blank?
                        set_project_issues(@prev_entries)
                        @prev_template = true
                    end
    
                end
    ================================================
    
                render :layout => !request.xhr?
            } 
            format.api  {
            }
        end
      end
    
    

    我想查看 @entries结果集调用的 sql 语句,几天都没找到门,看到@entries集合调用了 finEntries 方法但是也没找到 sql 语句,我自己调试加了一个@selected_project.id参数,结果报错。又看了 findEntriesByCond 方法,看到它就完全不懂啥意思了:$

    
    def findEntries
            setup
            # cond = getCondition('spent_on', @user.id, @startday, @startday+6, @selected_project.id) 
            cond = getCondition('spent_on', @user.id, @startday, @startday+6)        
            findEntriesByCond(cond)
        end
    
     def findEntriesByCond(cond)
            TimeEntry.find(:all, :conditions => cond,
                :order => 'project_id, issue_id, activity_id, spent_on')
        end
    
  • #31 楼 @zj0713001 收到,谢谢你^_^ 发论坛我是有点怕问题太多,影响广大观众,已经有人说我是十万个为什么了 :$

  • #40 楼 @fsword 嗯,我知道我的信息里面能看出来,我@_samqiu 是想问问他是不是曾经接触过,有点他乡遇故知的感觉。