Index: app/views/issues/index.rhtml =================================================================== --- app/views/issues/index.rhtml (revision 2245) +++ app/views/issues/index.rhtml (working copy) @@ -1,4 +1,9 @@ <% if @query.new_record? %> + <% if Setting.main_new_links_enabled? %> +
+ <%= link_to_if_authorized l(:label_issue_new), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-add' %> +
+ <% end %>

<%=l(:label_issue_plural)%>

<% html_title(l(:label_issue_plural)) %> Index: app/views/layouts/_new_issue_menu.rhtml =================================================================== --- app/views/layouts/_new_issue_menu.rhtml (revision 0) +++ app/views/layouts/_new_issue_menu.rhtml (revision 0) @@ -0,0 +1,12 @@ +<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %> +
+ +
Index: app/views/layouts/_new_timelog_menu.rhtml =================================================================== --- app/views/layouts/_new_timelog_menu.rhtml (revision 0) +++ app/views/layouts/_new_timelog_menu.rhtml (revision 0) @@ -0,0 +1,12 @@ +<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %> +
+ +
Index: app/views/layouts/base.rhtml =================================================================== --- app/views/layouts/base.rhtml (revision 2245) +++ app/views/layouts/base.rhtml (working copy) @@ -56,7 +56,9 @@ - + + + Index: app/views/settings/_general.rhtml =================================================================== --- app/views/settings/_general.rhtml (revision 2245) +++ app/views/settings/_general.rhtml (working copy) @@ -53,6 +53,9 @@

<%= check_box_tag 'settings[gravatar_enabled]', 1, Setting.gravatar_enabled? %><%= hidden_field_tag 'settings[gravatar_enabled]', 0 %>

+ +

+<%= check_box_tag 'settings[main_new_links_enabled]', 1, Setting.main_new_links_enabled? %><%= hidden_field_tag 'settings[main_new_links_enabled]', 0 %>

<%= submit_tag l(:button_save) %> Index: config/settings.yml =================================================================== --- config/settings.yml (revision 2245) +++ config/settings.yml (working copy) @@ -140,3 +140,5 @@ To change your notification preferences, please click here: http://hostname/my/account gravatar_enabled: default: 0 +main_new_links_enabled: + default: 0 Index: lang/en.yml =================================================================== --- lang/en.yml (revision 2245) +++ lang/en.yml (working copy) @@ -226,6 +226,7 @@ setting_sequential_project_identifiers: Generate sequential project identifiers setting_gravatar_enabled: Use Gravatar user icons setting_diff_max_lines_displayed: Max number of diff lines displayed +setting_main_new_links_enabled: Display global "New issue/timelog"-links in the top-menu permission_edit_project: Edit project permission_select_project_modules: Select project modules @@ -584,6 +585,7 @@ label_generate_key: Generate a key label_issue_watchers: Watchers label_example: Example +label_timelog_new: New timelog button_login: Login button_submit: Submit Index: lib/redmine.rb =================================================================== --- lib/redmine.rb (revision 2245) +++ lib/redmine.rb (working copy) @@ -108,6 +108,8 @@ Redmine::MenuManager.map :top_menu do |menu| menu.push :home, :home_path menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } + menu.push :new_issue, '#', :caption => :label_issue_new, :html => {:onclick => "toggleNewIssueMenu(event);"}, :if => Proc.new { User.current.logged? && User.current.memberships.any? && Setting.main_new_links_enabled? } + menu.push :new_timelog, '#', :caption => :label_timelog_new, :html => {:onclick => "toggleNewTimelogMenu(event);"}, :if => Proc.new { User.current.logged? && User.current.memberships.any? && Setting.main_new_links_enabled? } menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true menu.push :help, Redmine::Info.help_url, :last => true @@ -135,7 +137,8 @@ :if => Proc.new { |p| p.versions.any? } menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, - :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } + :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, + :if => Proc.new { !Setting.main_new_links_enabled? } menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil }, Index: public/javascripts/application.js =================================================================== --- public/javascripts/application.js (revision 2245) +++ public/javascripts/application.js (working copy) @@ -142,3 +142,25 @@ } } }); + +/* global new issue menu */ +function toggleNewIssueMenu(e) { + if($('new-issue-menu').style.display == 'none') { + Element.show('new-issue-menu'); + $('new-issue-menu').style.left = Event.pointerX(e)+'px'; + $('new-issue-menu').style.top = Event.pointerY(e)+'px'; + } else { + Element.hide('new-issue-menu'); + } +} + +/* global new timelog menu */ +function toggleNewTimelogMenu(e) { + if($('new-timelog-menu').style.display == 'none') { + Element.show('new-timelog-menu'); + $('new-timelog-menu').style.left = Event.pointerX(e)+'px'; + $('new-timelog-menu').style.top = Event.pointerY(e)+'px'; + } else { + Element.hide('new-timelog-menu'); + } +} Index: public/stylesheets/application.css =================================================================== --- public/stylesheets/application.css (revision 2245) +++ public/stylesheets/application.css (working copy) @@ -566,6 +566,58 @@ .task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; } .milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; } +/***** Global New Issue Menu *****/ +#new-issue-menu { position: absolute; } +#new-issue-menu ul { + list-style: none; + background-color: white; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; + border-bottom: 1px solid #777; + border-right: 1px solid #777; +} + +#new-issue-menu ul, #new-issue-menu li { + margin: 0; + padding: 0; + border: 0; +} + +#new-issue-menu li { padding: 1px; } +#new-issue-menu a { + text-decoration: none; + background-repeat: no-repeat; + background-position: 1px 50%; + padding: 2px 14px 2px 14px; + width: 100%; /* IE */ +} + +/***** Global New Timelog Menu *****/ +#new-timelog-menu { position: absolute; } +#new-timelog-menu ul { + list-style: none; + background-color: white; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; + border-bottom: 1px solid #777; + border-right: 1px solid #777; +} + +#new-timelog-menu ul, #new-timelog-menu li { + margin: 0; + padding: 0; + border: 0; +} + +#new-timelog-menu li { padding: 1px; } +#new-timelog-menu a { + text-decoration: none; + background-repeat: no-repeat; + background-position: 1px 50%; + padding: 2px 14px 2px 14px; + width: 100%; /* IE */ +} + /***** Icons *****/ .icon { background-position: 0% 40%;