Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/controllers/ai_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def index
@users = User.all
@trackers = Tracker.all
#puts @projects
@flows = Autoasigned.all.order "id_project desc"
@flows = Autoasigned.all.order(id_project: :desc)
end

def change
Expand All @@ -24,15 +24,15 @@ def change
flows.id_trackers = id_trackers
flows.id_user = id_user
if flows.save
flash[:notice] = 'Flow Created.'
flash[:notice] = l(:flow_created)
end
redirect_to :action => 'index'
return
end

flows.id_user = id_user
if flows.save
flash[:notice] = 'Flow Updated.'
flash[:notice] = l(:flow_updated)
end
redirect_to :action => 'index'
end
Expand All @@ -41,7 +41,7 @@ def change
def delete
id = params[:id]
Autoasigned.destroy(id)
flash[:notice] = 'Flow Deleted.'
flash[:notice] = l(:flow_deleted)
redirect_to :action => 'index'
end

Expand Down
8 changes: 4 additions & 4 deletions app/models/autoasigned.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Autoasigned < ActiveRecord::Base

attr_accessible :project, :state,:user

end
def autoassigned_params
params.require(:autoassigned).permit(:project, :state,:user)
end
end
12 changes: 6 additions & 6 deletions app/views/ai_setup/_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<table class="cal" id="time-grid-table">
<thead>
<tr>
<th class="time-grid-project">Project</th>
<th class="time-grid-issue">Type of Issue</th>
<th class="time-grid-issue">State</th>
<th class="time-grid-issue">User Responsible</th>
<th class="time-grid-issue"></th>
<th class="time-grid-project"><%= l(:label_project) %></th>
<th class="time-grid-issue"><%= l(:label_tracker) %></th>
<th class="time-grid-issue"><%= l(:label_status) %></th>
<th class="time-grid-issue"><%= l(:field_default_assigned_to) %></th>
<th class="time-grid-issue"><%= l(:label_action) %></th>
</tr>
</thead>
<tbody>
Expand All @@ -16,7 +16,7 @@
<td><%= IssueStatus.where(id:flow.id_state).first.name %></td>
<td><%= User.where(id:flow.id_user).first.name %></td>
<td class="buttons">
<%= link_to 'Delete', { :action => 'delete', :id => flow.id },method: :post,class:"icon icon-del", data: { confirm: "Delete Flow?" } %>
<%= link_to l(:button_delete), { :action => 'delete', :id => flow.id },method: :post,class:"icon icon-del", data: { confirm: l(:notice_remove_flow) } %>
</td>
</tr>
<% end %>
Expand Down
16 changes: 8 additions & 8 deletions app/views/ai_setup/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<h3>Automatic Issue Assignment</h3>
<h3><%= l(:label_auto_assignments) %></h3>
<hr>
<br>
<fieldset><legend>Modify the Issue Assignments</legend>
<fieldset><legend><%= l(:label_edit_auto_assignments) %></legend>
<%= form_tag("as-issues/change") do %>
<label>Project</label>
<label><%= l(:label_project) %></label>
<select name="id_project">
<% @projects.each do |p| %>
<option value="<%= p.id %>"> <%= p.name %></option>
<% end %>
</select>

<label>Type</label>
<label><%= l(:label_tracker) %></label>
<select name="id_trackers">
<% @trackers.each do |t| %>
<option value="<%= t.id %>"> <%= t.name %></option>
<% end %>
</select>

<label>State</label>
<label><%= l(:label_status) %></label>
<select name="id_state">
<% @states.each do |e| %>
<option value="<%= e.id %>"> <%= e.name %></option>
<% end %>
</select>

<label>User</label>
<label><%= l(:label_user) %></label>
<select name="id_user">
<% @users.each do |u| %>
<option value="<%= u.id %>"> <%= u.name %></option>
<% end %>
</select>

<input type="submit" value="SAVE"/>
<input type="submit" value="<%= l(:button_save) %>"/>
<% end %>
</fieldset>
<br>
<fieldset><legend>Assignment Flows</legend>
<fieldset><legend><%= l(:label_auto_assignment_flows) %></legend>
<%= render :partial => 'list' %>
</fieldset>
8 changes: 7 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# English strings go here for Rails i18n
en:
my_label: "My label"
label_auto_assignments: Auto Assignments
label_edit_auto_assignments: Edit auto assignments
label_auto_assignment_flows: Auto assignment flows
notice_remove_flow: Delete flow?
flow_created: Flow created.
flow_updated: Flow updated.
flow_deleted: Flow deleted.
2 changes: 1 addition & 1 deletion db/migrate/003_create_autoasigneds.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateAutoasigneds < ActiveRecord::Migration
class CreateAutoasigneds < ActiveRecord::Migration[4.2]
def change
create_table :autoasigneds do |t|
t.integer :id_project
Expand Down