Index: app/helpers/projects_helper.rb =================================================================== --- app/helpers/projects_helper.rb (revision 1441) +++ app/helpers/projects_helper.rb (working copy) @@ -35,6 +35,7 @@ {:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural}, {:name => 'versions', :action => :manage_versions, :partial => 'projects/settings/versions', :label => :label_version_plural}, {:name => 'categories', :action => :manage_categories, :partial => 'projects/settings/issue_categories', :label => :label_issue_category_plural}, + {:name => 'mediawiki', :action => :manage_wiki, :partial => 'projects/settings/mediawiki', :label => :label_mediawiki}, {:name => 'wiki', :action => :manage_wiki, :partial => 'projects/settings/wiki', :label => :label_wiki}, {:name => 'repository', :action => :manage_repository, :partial => 'projects/settings/repository', :label => :label_repository}, {:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural} Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 1441) +++ app/helpers/application_helper.rb (working copy) @@ -507,4 +507,18 @@ def has_content?(name) (@has_content && @has_content[name]) || false end + + def mediawiki_url(project, issue = nil, discussion = false) + url = project.mediawikiurl + "/" + if discussion + url += "Talk:" + end + if project.mediawikinamespace != "" + url += project.mediawikinamespace + "/" + end + if issue != nil + url += issue.tracker.name + "/" + issue.id.to_s + end + return url + end end Index: app/controllers/issues_controller.rb =================================================================== --- app/controllers/issues_controller.rb (revision 1441) +++ app/controllers/issues_controller.rb (working copy) @@ -145,6 +145,11 @@ :value => (params[:custom_fields] ? params[:custom_fields][x.id.to_s] : nil)) } @issue.custom_values = @custom_values if @issue.save +# if @issue.project.is_mediawiki +# url = mediawiki_url(@issue.project, @issue, false) + "?action=submit" +# logger.debug("Url for post: #{url}\n") +# logger.debug("Content: #{@issue.description}\n") +# end attach_files(@issue, params[:attachments]) flash[:notice] = l(:notice_successful_create) Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added') Index: app/controllers/projects_controller.rb =================================================================== --- app/controllers/projects_controller.rb (revision 1441) +++ app/controllers/projects_controller.rb (working copy) @@ -139,6 +139,19 @@ end end + def editmediawiki + if request.post? + @project.attributes = params[:project] + if @project.save + flash[:notice] = l(:notice_successful_update) + redirect_to :action => 'settings', :id => @project, :tab => 'mediawiki' + else + settings + render :action => 'settings' + end + end + end + def modules @project.enabled_module_names = params[:enabled_modules] redirect_to :action => 'settings', :id => @project, :tab => 'modules' Index: app/views/issues/_form.rhtml =================================================================== --- app/views/issues/_form.rhtml (revision 1441) +++ app/views/issues/_form.rhtml (working copy) @@ -8,11 +8,15 @@
>

<%= f.text_field :subject, :size => 80, :required => true %>

+<% if @project.is_mediawiki %> +

Description will have to be filled out on MW when this bug is saved

+<% else %>

<%= f.text_area :description, :required => true, :cols => 60, :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), :accesskey => accesskey(:edit), :class => 'wiki-edit' %>

+<% end %>
Index: app/views/issues/show.rhtml =================================================================== --- app/views/issues/show.rhtml (revision 1441) +++ app/views/issues/show.rhtml (working copy) @@ -56,10 +56,18 @@
+<% if @issue.project.is_mediawiki %> +

<%= link_to(l(:field_description), mediawiki_url(@issue.project, @issue, false), {:target => "_tab" })%>

+
+ +<%= link_to(image_tag("edit.png", :border=>0), mediawiki_url(@issue.project, @issue, false) + "&action=edit", {:target => "_tab"}) %> +
+<% else %>

<%=l(:field_description)%>

<%= textilizable @issue, :description, :attachments => @issue.attachments %>
+<% end %> <% if @issue.attachments.any? %> <%= link_to_attachments @issue.attachments, :delete_url => (authorize_for('issues', 'destroy_attachment') ? {:controller => 'issues', :action => 'destroy_attachment', :id => @issue} : nil) %> @@ -81,12 +89,20 @@
<% end %> +<% if @issue.project.is_mediawiki %> +
+

<%= link_to(l(:field_discussion), mediawiki_url(@issue.project, @issue, true), {:target => "_tab"}) %>

+ +<%= link_to(image_tag("edit.png", :border=>0), mediawiki_url(@issue.project, @issue, true) + "&action=edit§ion=new", {:target => "_tab"}) %> +
+<% else %> <% if @journals.any? %>

<%=l(:label_history)%>

<%= render :partial => 'history', :locals => { :journals => @journals } %>
<% end %> +<% end %>
<% if authorize_for('issues', 'edit') %> Index: app/views/issues/_edit.rhtml =================================================================== --- app/views/issues/_edit.rhtml (revision 1441) +++ app/views/issues/_edit.rhtml (working copy) @@ -28,10 +28,14 @@ <% end %> +
<%= l(:field_notes) %> + <% if @issue.project.is_mediawiki %> + <%= link_to(l(:text_notesonwiki), mediawiki_url(@issue.project, @issue, true) + "&action=edit§ion=new", :target => "_tab") %> + <% else %> <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %> - <%= wikitoolbar_for 'notes' %> - + <%= wikitoolbar_for 'notes' %> + <% end %>

<%=l(:label_attachment_plural)%>
<%= render :partial => 'attachments/form' %>

Index: lang/en.yml =================================================================== --- lang/en.yml (revision 1441) +++ lang/en.yml (working copy) @@ -97,6 +97,7 @@ field_name: Name field_description: Description +field_discussion: Discussion field_summary: Summary field_is_required: Required field_firstname: Firstname @@ -123,6 +124,9 @@ field_notes: Notes field_is_closed: Issue closed field_is_default: Default value +field_is_mediawiki: Uses Mediawiki +field_mediawikiurl: Base url for Mediawiki +field_mediawikinamespace: Namespace for this project field_tracker: Tracker field_subject: Subject field_due_date: Due date @@ -510,6 +514,7 @@ label_chronological_order: In chronological order label_reverse_chronological_order: In reverse chronological order label_planning: Planning +label_mediawiki: MediaWiki button_login: Login button_submit: Submit @@ -553,6 +558,10 @@ status_registered: registered status_locked: locked +text_example: Example +text_notesonwiki: Notes are implemented using MediaWiki discussion pages. +text_mediawikiurl: e.g. http://wiki.redmine.com/index.php +text_mediawikinamespace: If blank, issue namespaces (i.e. Bug / Feature / Support) will be directly under the root namespace text_select_mail_notifications: Select actions for which email notifications should be sent. text_regexp_info: eg. ^[A-Z0-9]+$ text_min_max_length_info: 0 means no restriction Index: config/environment.rb =================================================================== --- config/environment.rb (revision 1441) +++ config/environment.rb (working copy) @@ -100,3 +100,5 @@ require 'redmine' + + Index: lib/redmine.rb =================================================================== --- lib/redmine.rb (revision 1441) +++ lib/redmine.rb (working copy) @@ -17,7 +17,7 @@ Redmine::AccessControl.map do |map| map.permission :view_project, {:projects => [:show, :activity]}, :public => true map.permission :search_project, {:search => :index}, :public => true - map.permission :edit_project, {:projects => [:settings, :edit]}, :require => :member + map.permission :edit_project, {:projects => [:settings, :edit, :editmediawiki]}, :require => :member map.permission :select_project_modules, {:projects => :modules}, :require => :member map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy]}, :require => :member map.permission :manage_versions, {:projects => [:settings, :add_version], :versions => [:edit, :destroy]}, :require => :member