Displaying 6 results from an estimated 6 matches for "servicedeskticket".
2008 Sep 25
1
question about exception
Hi
In the controller I have the function
def convert_sd_ticket_to_incident
ServiceDeskTicket.close_ticket(sd_id,created_by_id,modified_by_id)
Incident.convert_sd_ticket_to_incident(sd_id,created_by_id,modified_by_id)
end
Now in the ServiceDeskTicket model
def self.close_ticket(sd_id,created_by,modified_by)
begin
ActiveRecord::Base.transaction do
sd_ticket=self...
2008 Jun 16
2
call_backs Is it?
Hi
I have the models
1.ServiceDeskTicket with fields
id --- number --- service_desk_status_id -- created_on -- updated_on
etc
2.ServiceDeskActivity with fields
id -- service_desk_ticket_id -- description -- created_on --
updated_on
3.ServiceDeskAttachment
id -- service_desk_ticket_id -- attachment -- created_on --
updated_o...
2008 Mar 06
1
pagination for an object array
def show_details
@sd_ticket = ServiceDeskTicket.find(params[:id])
@servicedesk_cis = @sd_ticket.service_desk_cis
end
What I need is a pagination for @servicedesk_cis using the custom
pagination..How can i give offset and limit to this?
I have successfully done previously custom pagination in another def as
below
def search_sd_ticket
@s...
2008 Apr 26
0
moving pagination code to model
...1: set the variables you''ll need
page = (params[:page] ||= 1).to_i
items_per_page = 20
offset = (page - 1) * items_per_page
# step 2: instead of performing the full find, just find the
record count
@search_sd_ticket_count_result =
ServiceDeskTicket.find_where(:all,:select=>''count(*) as count1'' ) do
|sd|
end
record_count=@search_sd_ticket_count_result[0].count1.to_i
# step 3: create a Paginator, the second variable has to be
the number of ALL items on all pages...
2008 May 19
0
changed to will_paginate
...1: set the variables you''ll need
page = (params[:page] ||= 1).to_i
items_per_page = 20
offset = (page - 1) * items_per_page
# step 2: instead of performing the full find, just find the
record count
@search_sd_ticket_count_result =
ServiceDeskTicket.find_where(:all,:select=>''count(*) as count1'' ) do
|sd|
sd.number.downcase =~
"%"+@sd_ticket_number.downcase+"%" if !@sd_ticket_number.nil?
sd.service_desk_status_id==
@sd_ticket_statu...
2008 May 13
4
calling another rjs file in an if condition
Hi
I have a controller action like below.This def is called by a
submit_to_remote
def edit_service_desk_status_after_transfer
if params[:transfer_reason].empty?
#This is used in the :failure of submit_to_remote
else
@sd_ticket = ServiceDeskTicket.find(params[:sd_id])
ActiveRecord::Base.transaction do
@sd_status_history = ServiceDeskStatusHistory.new
@sd_status_history.service_desk_ticket_id = @sd_ticket.id
@sd_status_history.service_desk_status_id =
@sd_ticket.service_desk_status_id
@sd_status...