##// END OF EJS Templates
Introduce virtual MenuNodes (#15880)....
Introduce virtual MenuNodes (#15880). They are characterized by having a blank url. they will only be rendered if the user is authorized to see at least one of its children. they render as links which do nothing when clicked. Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@15501 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r14954:42b5c332b2c2
r15119:53710d80fc88
Show More
trackers_controller.rb
107 lines | 3.1 KiB | text/x-ruby | RubyLexer
/ app / controllers / trackers_controller.rb
Jean-Philippe Lang
Trackers controller refactoring....
r2462 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/trackers_controller.rb....
r6685 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/trackers_controller.rb....
r6685 #
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class TrackersController < ApplicationController
Jean-Philippe Lang
Adds an admin layout that displays the admin menu in the sidebar....
r3062 layout 'admin'
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/trackers_controller.rb....
r6685
Jean-Philippe Lang
Adds API response to /trackers to get the list of all available trackers (#7181)....
r7757 before_filter :require_admin, :except => :index
before_filter :require_admin_or_api_request, :only => :index
accept_api_auth :index
Jean-Philippe Lang
Initial commit...
r2
Eric Davis
Refactor: Merged TrackersController#list and #index...
r3323 def index
Jean-Philippe Lang
Remove pagination on trackers, roles and issue statuses (#12909)....
r14891 @trackers = Tracker.sorted.to_a
Jean-Philippe Lang
Adds API response to /trackers to get the list of all available trackers (#7181)....
r7757 respond_to do |format|
Jean-Philippe Lang
Remove pagination on trackers, roles and issue statuses (#12909)....
r14891 format.html { render :layout => false if request.xhr? }
format.api
Jean-Philippe Lang
Adds API response to /trackers to get the list of all available trackers (#7181)....
r7757 end
Jean-Philippe Lang
Initial commit...
r2 end
def new
Jean-Philippe Lang
Resourcified trackers....
r7768 @tracker ||= Tracker.new(params[:tracker])
Jean-Philippe Lang
Merged rails-4.1 branch (#14534)....
r13100 @trackers = Tracker.sorted.to_a
Jean-Philippe Lang
Replaces find(:all) calls....
r10687 @projects = Project.all
Jean-Philippe Lang
Resourcified trackers....
r7768 end
def create
Jean-Philippe Lang
Initial commit...
r2 @tracker = Tracker.new(params[:tracker])
Jean-Philippe Lang
Removed conditions on HTTP methods....
r10735 if @tracker.save
Jean-Philippe Lang
Added the ability to copy an existing workflow when creating a new tracker....
r396 # workflow copy
Jean-Philippe Lang
Fixed: error when creating a tracker without copying an existing wokflow...
r595 if !params[:copy_workflow_from].blank? && (copy_from = Tracker.find_by_id(params[:copy_workflow_from]))
Jean-Philippe Lang
Workflow enhancement: editable and required fields configurable by role, tracker and status (#703, #3521)....
r9794 @tracker.workflow_rules.copy(copy_from)
Jean-Philippe Lang
Added the ability to copy an existing workflow when creating a new tracker....
r396 end
Jean-Philippe Lang
notice messages translation...
r15 flash[:notice] = l(:notice_successful_create)
Jean-Philippe Lang
Use named routes in controllers....
r10754 redirect_to trackers_path
Jean-Philippe Lang
Adds projects association on tracker form (#2578)....
r2333 return
Jean-Philippe Lang
Initial commit...
r2 end
Jean-Philippe Lang
Resourcified trackers....
r7768 new
render :action => 'new'
Jean-Philippe Lang
Initial commit...
r2 end
def edit
Jean-Philippe Lang
Resourcified trackers....
r7768 @tracker ||= Tracker.find(params[:id])
Jean-Philippe Lang
Replaces find(:all) calls....
r10687 @projects = Project.all
Jean-Philippe Lang
Resourcified trackers....
r7768 end
Toshi MARUYAMA
remove trailing white-space from app/controllers/trackers_controller.rb...
r10624
Jean-Philippe Lang
Resourcified trackers....
r7768 def update
Jean-Philippe Lang
Initial commit...
r2 @tracker = Tracker.find(params[:id])
Jean-Philippe Lang
Removed conditions on HTTP methods....
r10735 if @tracker.update_attributes(params[:tracker])
Jean-Philippe Lang
Lists can be reordered with drag and drop (#12909)....
r14954 respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_to trackers_path(:page => params[:page])
}
format.js { render :nothing => true }
end
else
respond_to do |format|
format.html {
edit
render :action => 'edit'
}
format.js { render :nothing => true, :status => 422 }
end
Jean-Philippe Lang
Initial commit...
r2 end
end
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/trackers_controller.rb....
r6685
Jean-Philippe Lang
Initial commit...
r2 def destroy
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 @tracker = Tracker.find(params[:id])
unless @tracker.issues.empty?
Azamat Hackimov
New strings to localization (#5225)...
r3513 flash[:error] = l(:error_can_not_delete_tracker)
Jean-Philippe Lang
added svn:eol-style native property on /app files...
r330 else
@tracker.destroy
Jean-Philippe Lang
Initial commit...
r2 end
Jean-Philippe Lang
Use named routes in controllers....
r10754 redirect_to trackers_path
Toshi MARUYAMA
remove trailing white-spaces from app/controllers/trackers_controller.rb....
r6685 end
Jean-Philippe Lang
Adds a view for editing all trackers fields....
r10100
def fields
if request.post? && params[:trackers]
params[:trackers].each do |tracker_id, tracker_params|
tracker = Tracker.find_by_id(tracker_id)
if tracker
tracker.core_fields = tracker_params[:core_fields]
tracker.custom_field_ids = tracker_params[:custom_field_ids]
tracker.save
end
end
flash[:notice] = l(:notice_successful_update)
Jean-Philippe Lang
Use named routes in controllers....
r10754 redirect_to fields_trackers_path
Jean-Philippe Lang
Adds a view for editing all trackers fields....
r10100 return
end
Jean-Philippe Lang
Merged rails-4.1 branch (#14534)....
r13100 @trackers = Tracker.sorted.to_a
Jean-Philippe Lang
Adds a view for editing all trackers fields....
r10100 @custom_fields = IssueCustomField.all.sort
end
Jean-Philippe Lang
Initial commit...
r2 end