change url to avoid conflict

This commit is contained in:
BOYA,CHIU 2021-07-15 19:19:13 +08:00
parent b06747ad6d
commit b7dd80449d
14 changed files with 42 additions and 40 deletions

View File

@ -207,7 +207,7 @@ class Admin::TicketsController < OrbitAdminController
rescue e
end
end
# url = "/admin/tickets/#{tq.ticket.id.to_s}#response_#{response.id.to_s}"
# url = "/admin/tickets-manage/#{tq.ticket.id.to_s}#response_#{response.id.to_s}"
# Fiber.new{
# params[:user_tags].each do |user_id|
# WebsocketRails["tag_notifications_for_#{user_id}".to_sym].trigger(:new_notification_recieved, {"ticket_link" => "<a href='#{url}'>#{tq.ticket.subject}</a>", "total_ticket_count" => Ticket.get_ticket_unread_count_for_user(user_id), "blink_message" => "#{current_user.name} tagged you!"})

View File

@ -40,7 +40,7 @@ module TicketsHelper
end
def send_email(useremail,ticket,response, username)
url = "#{request.protocol}#{request.host_with_port}/#{I18n.locale}/admin/tickets/#{ticket.id.to_s}#response_#{response.id.to_s}"
url = "#{request.protocol}#{request.host_with_port}/#{I18n.locale}/admin/tickets-manage/#{ticket.id.to_s}#response_#{response.id.to_s}"
email = Email.new(:mail_to => useremail, :mail_subject => "Tagged : #{ticket.subject}.", :template => "email/ticket_tag_email.html.erb", :template_data => {"url" => url, "mention" => current_user.name, "name" => username})
email.deliver
end

View File

@ -17,7 +17,7 @@
</div>
<% if params[:reopen] != "true" && @ticket.ticket_queries.count == (query_counter + 1) %>
<div id="form_container" class="ticket-editor">
<form method="post" action="/admin/ticket/submit_response" id="reopen-form" for="query-response">
<form method="post" action="/admin/tickets-manage/submit_response" id="reopen-form" for="query-response">
<textarea class="ckeditor" name="ticket_query_response" data-fv-validation="required;" data-fv-messages="Cannot be empty;"></textarea>
<div class="ticket-internal-response-wrap">
<div class="ticket-internal-response">

View File

@ -16,7 +16,7 @@
</div>
<div class="ticket-response-delete-wrap">
<% if !user.nil? && user.id.to_s == current_user.id.to_s %>
<a class="ticket-response-delete" href="/admin/ticket/delete_response" data-response-id="<%= response.id.to_s %>">
<a class="ticket-response-delete" href="/admin/tickets-manage/delete_response" data-response-id="<%= response.id.to_s %>">
<i class="ticket-response-delete-icon fa fa-trash"></i>
Delete
</a>

View File

@ -4,7 +4,7 @@
Search tickets
</h3>
<span class="search-box">
<form action="<%= !(defined? form_action).nil? ? form_action : "/admin/tickets/search" %>" method="get" id="search-form">
<form action="<%= !(defined? form_action).nil? ? form_action : "/admin/tickets-manage/search" %>" method="get" id="search-form">
<select id="smart-field-select" class="ticket-search-option">
<option value="">General</option>
<% @smart_search_fields.each do |ssf| %>

View File

@ -28,7 +28,7 @@
<% end %>
</td>
<td class="span6">
<a href="/admin/tickets/<%= ticket_by_c.id.to_s %>"><%= ticket_by_c.subject %></a>
<a href="/admin/tickets-manage/<%= ticket_by_c.id.to_s %>"><%= ticket_by_c.subject %></a>
</td>
<td class="span3">
<% t = DateTime.parse(ticket_by_c.created_at.to_s) %>

View File

@ -34,7 +34,7 @@
</h4>
<%= render :partial => "ticket", :collection => @tickets[category] %>
<div class="ticket-section-view-all">
<a class="ticket-section-view-all-btn" href="/admin/tickets/category/<%= category.id.to_s %>">
<a class="ticket-section-view-all-btn" href="/admin/tickets-manage/category/<%= category.id.to_s %>">
<i class="ticket-section-view-all-icon fa fa-share"></i>
View all tickets from <%= category.title %>
</a>

View File

@ -17,16 +17,16 @@
}
</style>
<% end %>
<%= render :partial => "search_form", locals: {:form_action => "/admin/tickets/my_tickets"} %>
<%= render :partial => "search_form", locals: {:form_action => "/admin/tickets-manage/my_tickets"} %>
<div class="ticket-container">
<h3 class="ticket-section-heading type--normal">
<i class="ticket-section-heading-icon fa fa-clock-o"></i>
Tickets
<div class="pull-right past-link">
<% if params[:type] == "history" %>
<a href="/admin/tickets/my_tickets">View my current tickets</a>
<a href="/admin/tickets-manage/my_tickets">View my current tickets</a>
<% else %>
<a href="/admin/tickets/my_tickets?type=history">View my past tickets</a>
<a href="/admin/tickets-manage/my_tickets?type=history">View my past tickets</a>
<% end %>
</div>
</h3>
@ -38,7 +38,7 @@
</h4>
<%= render :partial => "ticket", :collection => @tickets[category] %>
<div class="ticket-section-view-all">
<a class="ticket-section-view-all-btn" href="/admin/tickets/category/<%= category.id.to_s %>?takenby=<%= current_user.id.to_s %>">
<a class="ticket-section-view-all-btn" href="/admin/tickets-manage/category/<%= category.id.to_s %>?takenby=<%= current_user.id.to_s %>">
<i class="ticket-section-view-all-icon fa fa-share"></i>
View all tickets from <%= category.title %>
</a>

View File

@ -13,7 +13,7 @@
</h4>
<%= render :partial => "ticket", :collection => @tickets[category] %>
<div class="ticket-section-view-all">
<a class="ticket-section-view-all-btn" href="/admin/tickets/category/<%= category.id.to_s %>/?<%= request.original_fullpath.split("?")[1] %>">
<a class="ticket-section-view-all-btn" href="/admin/tickets-manage/category/<%= category.id.to_s %>/?<%= request.original_fullpath.split("?")[1] %>">
<i class="ticket-section-view-all-icon fa fa-share"></i>
View all tickets from <%= category.title %>
</a>

View File

@ -29,7 +29,7 @@
<i class="ticket-external-link-icon fa fa-external-link"></i>
<%= @ticket.registered_site.title %>
</a>
<a href="/admin/tickets/search?keywords=sitename%3A+<%= @ticket.registered_site.title %>" target="_blank" class="btn btn-normal">
<a href="/admin/tickets-manage/search?keywords=sitename%3A+<%= @ticket.registered_site.title %>" target="_blank" class="btn btn-normal">
<i class="ticket-external-link-icon fa fa-search"></i>
Search tickets from <b><i><%= @ticket.registered_site.title %></i></b>
</a>
@ -63,26 +63,26 @@
<ul class="t-list-unstyled dropdown-menu" role="menu">
<% if @ticket.status == "open" %>
<li>
<a class="ticket-start t-item" href="/admin/tickets/<%= @ticket.id.to_s %>/start" data-ticket-id="<%= @ticket.id.to_s %>">
<a class="ticket-start t-item" href="/admin/tickets-manage/<%= @ticket.id.to_s %>/start" data-ticket-id="<%= @ticket.id.to_s %>">
<i class="fa fa-times-circle"></i>
Start
</a>
</li>
<li>
<a class="ticket-close t-item" href="/admin/tickets/<%= @ticket.id.to_s %>/close" data-ticket-id="<%= @ticket.id.to_s %>">
<a class="ticket-close t-item" href="/admin/tickets-manage/<%= @ticket.id.to_s %>/close" data-ticket-id="<%= @ticket.id.to_s %>">
<i class="fa fa-eye-slash"></i>
Close
</a>
</li>
<% elsif @ticket.status == "commenced" %>
<li>
<a class="ticket-start t-item" data-confirm="Are you sure?" href="/admin/tickets/<%= @ticket.id.to_s %>/leave" data-ticket-id="<%= @ticket.id.to_s %>">
<a class="ticket-start t-item" data-confirm="Are you sure?" href="/admin/tickets-manage/<%= @ticket.id.to_s %>/leave" data-ticket-id="<%= @ticket.id.to_s %>">
<i class="fa fa-times-circle"></i>
Leave
</a>
</li>
<li>
<a class="ticket-close t-item" href="/admin/tickets/<%= @ticket.id.to_s %>/close" data-ticket-id="<%= @ticket.id.to_s %>">
<a class="ticket-close t-item" href="/admin/tickets-manage/<%= @ticket.id.to_s %>/close" data-ticket-id="<%= @ticket.id.to_s %>">
<i class="fa fa-eye-slash"></i>
Close
</a>
@ -93,7 +93,7 @@
<% if params[:reopen] == "true" %>
<a href="#" class="reopen-back-btn t-item" >Cancel</a>
<% else %>
<a href="/admin/tickets/<%= @ticket.id.to_s %>?reopen=true" class="t-btn">Reopen</a>
<a href="/admin/tickets-manage/<%= @ticket.id.to_s %>?reopen=true" class="t-btn">Reopen</a>
<% end %>
</li>
<% else %>
@ -103,7 +103,7 @@
<% end %>
<% end %>
<li>
<a class="ticket-delete t-item" data-method="delete" data-confirm="Are you sure?" href="/admin/tickets/<%= @ticket.id.to_s %>" data-ticket-id="<%= @ticket.id.to_s %>">
<a class="ticket-delete t-item" data-method="delete" data-confirm="Are you sure?" href="/admin/tickets-manage/<%= @ticket.id.to_s %>" data-ticket-id="<%= @ticket.id.to_s %>">
<i class="fa fa-trash-o"></i>
Delete
</a>
@ -127,7 +127,7 @@
<% if @ticket.status != "closed" %>
<div class="onoffswitch ticket-toggle-urgent" title="">
<span class="ticket-tooltip-wrap"></span>
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox <%= "active" if @ticket.is_urgent? %>" id="myonoffswitch" data-url="/admin/tickets/<%= @ticket.id.to_s %>/toggleurgent">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox <%= "active" if @ticket.is_urgent? %>" id="myonoffswitch" data-url="/admin/tickets-manage/<%= @ticket.id.to_s %>/toggleurgent">
<label class="onoffswitch-label" for="myonoffswitch">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
@ -166,7 +166,7 @@
<% if params[:reopen] == "true"%>
<% if @ticket.status == "closed" %>
<div id="form_container" class="ticket-editor">
<form method="post" action="/admin/tickets/<%= @ticket.id.to_s %>/reopen" id="reopen-form" for="query">
<form method="post" action="/admin/tickets-manage/<%= @ticket.id.to_s %>/reopen" id="reopen-form" for="query">
<textarea class="ckeditor" name="ticket_query" data-fv-validation="required;" data-fv-messages="Cannot be empty;"></textarea>
</form>
<input type="submit" id="reopen-form-submit" class="btn btn-primary" value="Reopen" />

View File

@ -3,7 +3,7 @@
<%= stylesheet_link_tag "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" %>
<%= stylesheet_link_tag "tickets/ticket_index" %>
<% end %>
<%= render :partial => "search_form", locals: {:form_action => "/admin/tickets/tagged_tickets"} %>
<%= render :partial => "search_form", locals: {:form_action => "/admin/tickets-manage/tagged_tickets"} %>
<div class="ticket-container">
<div class="ticket-section">
<h3 class="ticket-section-heading type--ugrent">
@ -18,7 +18,7 @@
</h4>
<%= render :partial => "ticket", :collection => @unread_tickets[category] %>
<div class="ticket-section-view-all">
<a class="ticket-section-view-all-btn" href="/admin/tickets/category/<%= category.id.to_s %>">
<a class="ticket-section-view-all-btn" href="/admin/tickets-manage/category/<%= category.id.to_s %>">
<i class="ticket-section-view-all-icon fa fa-share"></i>
View all tickets from <%= category.title %>
</a>
@ -38,7 +38,7 @@
</h4>
<%= render :partial => "ticket", :collection => @read_tickets[category] %>
<div class="ticket-section-view-all">
<a class="ticket-section-view-all-btn" href="/admin/tickets/category/<%= category.id.to_s %>">
<a class="ticket-section-view-all-btn" href="/admin/tickets-manage/category/<%= category.id.to_s %>">
<i class="ticket-section-view-all-icon fa fa-share"></i>
View all tickets from <%= category.title %>
</a>

View File

@ -8,15 +8,15 @@
<div>
<h3>
<%= @category.title %><%= " - history" if params[:type] == "history" %>
<%= render :partial => "search_form", locals: {:form_action => "/admin/tickets/category/#{@category.id.to_s}"} %>
<%= render :partial => "search_form", locals: {:form_action => "/admin/tickets-manage/category/#{@category.id.to_s}"} %>
</h3>
<% h = request.original_fullpath.split("?")[1] %>
<% if params[:type] == "history" %>
<% h = h.gsub("type=history","").chomp("&") %>
<span style="position:relative;margin-top:-30px;" class="pull-right"><a href="/admin/tickets/category/<%= @category.id.to_s %><%= h != ""? "?#{h}" : "" %>">View current</a></span>
<span style="position:relative;margin-top:-30px;" class="pull-right"><a href="/admin/tickets-manage/category/<%= @category.id.to_s %><%= h != ""? "?#{h}" : "" %>">View current</a></span>
<% else %>
<% h = h.nil? ? "type=history" : "#{h}&type=history" %>
<span style="position:relative;margin-top:-30px;" class="pull-right"><a href="/admin/tickets/category/<%= @category.id.to_s %>?<%= h %>">View history</a></span>
<span style="position:relative;margin-top:-30px;" class="pull-right"><a href="/admin/tickets-manage/category/<%= @category.id.to_s %>?<%= h %>">View history</a></span>
<% end %>
</div>
<% else %>

View File

@ -10,15 +10,17 @@ Rails.application.routes.draw do
get "/xhr/tickets", to: 'admin/tickets_api#gettickets'
get "/xhr/ticket/types", to: 'admin/tickets_api#tickettypes'
delete "/xhr/ticket/:ticket_id", to: 'admin/tickets_api#destroy'
namespace :admin do
get "tickets/search" => 'tickets#search'
post "ticket/submit_response" => 'tickets#submit_response'
delete "ticket/delete_response" => 'tickets#delete_response'
get "tickets/category/:category_id" => 'tickets#tickets_by_category'
get "tickets/my_tickets" => 'tickets#my_tickets'
get "tickets/tagged_tickets" => 'tickets#tagged_tickets'
namespace :admin do
scope "tickets-manage", :controller => 'official_module' do
get "search"
post "submit_response"
delete "delete_response"
get "category/:category_id" => 'tickets#tickets_by_category'
get "my_tickets"
get "tagged_tickets"
end
post "comments/read" => 'tickets#mark_response_read'
resources :tickets do
resources :tickets, path: "tickets-manage" do
get "start"
get "leave"
get "changecategory"

View File

@ -11,32 +11,32 @@ module Tickets
side_bar do
head_label_i18n 'tickets.tickets', icon_class: "icons-ticket"
available_for "users"
active_for_controllers (['admin/tickets'])
active_for_controllers (['admin/tickets-manage'])
head_link_path "admin_tickets_path"
context_link 'tickets.all',
:link_path=>"admin_tickets_path" ,
:priority=>1,
:active_for_action=>{'admin/tickets'=>"index"},
:active_for_action=>{'admin/tickets-manage'=>"index"},
:available_for => 'users'
context_link 'tickets.my_tickets',
:link_path=>"admin_tickets_my_tickets_path" ,
:priority=>2,
:active_for_action=>{'admin/tickets'=>"my_tickets"},
:active_for_action=>{'admin/tickets-manage'=>"my_tickets"},
:available_for => 'users'
context_link 'tickets.tickets_tagged',
:link_path=>"admin_tickets_tagged_tickets_path" ,
:priority=>2,
:active_for_action=>{'admin/tickets'=>"tagged_tickets"},
:active_for_action=>{'admin/tickets-manage'=>"tagged_tickets"},
:available_for => 'users'
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'ticket').id}",
:priority=>3,
:active_for_action=>{'admin/tickets'=>'categories'},
:active_for_action=>{'admin/tickets-manage'=>'categories'},
:active_for_category => 'Ticket',
:available_for => 'managers'
end