Author: tchemit Date: 2011-05-20 14:26:34 +0200 (Fri, 20 May 2011) New Revision: 185 Url: http://nuiton.org/repositories/revision/jredmine/185 Log: Anomalie #923: Fichier routes.rb manquant et mal document?\195?\169 dans le README.rdoc Anomalie #1428: Jredmine 1.1.4 sur Redmine 1.1 Modified: trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb trunk/jredmine-client/src/main/redmine/jredmine/config/routes.rb trunk/jredmine-client/src/site/apt/index.apt Modified: trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc =================================================================== --- trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc 2011-05-20 11:01:47 UTC (rev 184) +++ trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc 2011-05-20 12:26:34 UTC (rev 185) @@ -25,15 +25,14 @@ where X is a project identifier and Y a version name -You have to add those lines to config/routes.rb += install -# jredmine: ping, login , logout, with no project context... -map.connect 'jredmine/:action', :controller => 'jredmine' ,:action => ['ping', 'login', 'logout', 'get_projects', 'get_issue_statuses', 'get_issue_priorities'] -map.connect 'jredmine/:action.:format', :controller => 'jredmine' ,:action => ['get_projects', 'get_issue_statuses', 'get_issue_priorities'], :format => ['xml', 'json'] +To install the plugin, just put it in the vendor/plugins directory and restart the redmine (or apache) -# jredmine/action/?? (:project_id) -map.connect 'jredmine/:action/:project_id', :controller => 'jredmine' -map.connect 'jredmine/:action.:format/:project_id', :controller => 'jredmine', :format => ['xml', 'json'] += configure +Once the plugin is available in the forge, you can configure for each project +if you want to expose jredmine service. + Modified: trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb =================================================================== --- trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2011-05-20 11:01:47 UTC (rev 184) +++ trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2011-05-20 12:26:34 UTC (rev 185) @@ -445,15 +445,15 @@ end end - def find_project() + def find_project( id = params[:pid] ) begin - @project = Project.find(params[:project_id]) + @project = Project.find(pid) allowed = User.current.allowed_to?({:controller => 'jredmine', :action => "allow_jredmine"}, @project) if !allowed - render_status 401, "No permission to access project nor jredmine service" + render_status 401, "No permission to access project #{pid} nor jredmine service configured for this project" end rescue ActiveRecord::RecordNotFound - render_status 404, "#{params[:project_id]} is not a project" + render_status 404, "#{pid} is not a project" return false end end Modified: trunk/jredmine-client/src/main/redmine/jredmine/config/routes.rb =================================================================== --- trunk/jredmine-client/src/main/redmine/jredmine/config/routes.rb 2011-05-20 11:01:47 UTC (rev 184) +++ trunk/jredmine-client/src/main/redmine/jredmine/config/routes.rb 2011-05-20 12:26:34 UTC (rev 185) @@ -26,17 +26,12 @@ map.with_options :controller => 'jredmine' do |red| - # jredmine : actions with no project context : login , logout,... + # jredmine : actions with no project context red.connect 'jredmine/:action', :action => ['ping', 'login', 'logout', 'get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities'] - red.connect 'jredmine/:action.:format', :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities'], :format => ['xml', 'json'] + + # jredmine/action/:pid : actions with project context + red.connect 'jredmine/:action/:pid', :pid => /.+/ - # jredmine/action/:project_id : actions with project context - red.connect 'jredmine/:action/:project_id', :action => ['add_version', 'update_version', 'add_news', 'add_attachment', 'add_version_attachment', 'add_issue_time', 'update_issue_time'], :project_id => /.+/ - - # jredmine/action/:project_id : actions with project context and format result - red.connect 'jredmine/:action.json/:project_id', :action => ['get_project_versions', 'get_version', 'get_version_issues', 'get_version_opened_issues', 'get_version_attachment', 'get_issue_times'] - red.connect 'jredmine/:action/:project_id', :action => ['get_project_versions', 'get_version', 'get_version_issues', 'get_version_opened_issues', 'get_version_attachment', 'get_issue_times'] - end # jredmine: ping, login , logout, with no project context... Modified: trunk/jredmine-client/src/site/apt/index.apt =================================================================== --- trunk/jredmine-client/src/site/apt/index.apt 2011-05-20 11:01:47 UTC (rev 184) +++ trunk/jredmine-client/src/site/apt/index.apt 2011-05-20 12:26:34 UTC (rev 185) @@ -61,6 +61,8 @@ | |-- images | |-- javascripts | `-- stylesheets + |-- config + | `-- routes.rb |-- db | `-- migrate |-- init.rb @@ -83,23 +85,6 @@ * dézippage dans le répertoire vendor/plugins - * ajouter au fichier <config/routes.rb> les lignes suivantes : - --------------------------------------------------------------------------------- -# jredmine : ping, login , logout, with no project context... -map.connect 'jredmine/:action', :controller => 'jredmine' ,:action => ['ping',\ - 'login', 'logout', 'get_projects', 'get_user_projects', 'get_issue_statuses', \ -'get_issue_priorities'] -map.connect 'jredmine/:action.:format', :controller => 'jredmine' ,:action => \ -['get_projects', 'get_user_projects', 'get_issue_statuses', \ - 'get_issue_priorities'], :format => ['xml', 'json'] - -# jredmine/action/?? (:project_id) -map.connect 'jredmine/:action/:project_id', :controller => 'jredmine' -map.connect 'jredmine/:action.:format/:project_id', :controller => 'jredmine',\ -:format => ['xml', 'json'] --------------------------------------------------------------------------------- - * relancer votre instance de redmine (ou apache). * Configuration des permissions du plugin dans le serveur Redmine