The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ColdFusion Development
|
Displaying tickets history in same page
Discuss Displaying tickets history in same page in the ColdFusion Development forum on Dev Shed. Displaying tickets history in same page ColdFusion Development forum discussing CFML coding practices, tips on CFML, and other CFML related topics. Find out why ColdFusion is the tool of choice for many e-commerce developers.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 8th, 2013, 06:27 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 18
Time spent in forums: 10 h 48 m 52 sec
Reputation Power: 0
|
|
|
Displaying tickets history in same page
Hi,
i have a problem while developing the ticketing system in coldfusion.
when i click on update button after the ticket is raised,the ticket history is displaying in new window.but instead i want to display in the same window.
can any one help me on this
Thank you
vamc
|

March 8th, 2013, 07:58 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
If the ticket history is being shown in a new browser window, then that should have nothing to do with ColdFusion (which is a server-side platform). This sounds like a client-side issue. Is the link or form using target="_blank"?
|

March 8th, 2013, 08:36 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 18
Time spent in forums: 10 h 48 m 52 sec
Reputation Power: 0
|
|
|
client side script is javascript
client side script is javascript
|

March 8th, 2013, 09:11 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
Exactly, so I'm not really sure how your question relates to ColdFusion, since JavaScript is a totally separate subject.
|

March 11th, 2013, 05:56 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 18
Time spent in forums: 10 h 48 m 52 sec
Reputation Power: 0
|
|
|
yes.my problem is here.when i click on update button the page getting refreshed and i lost my url variables(i am passing my ticket ID through URL from ticketList page)so that i am not able to update my text values in Database.
the error occurs like below.. your Element ID is undefined in URL.
<cfquery datasource="#request.dsn#" name="getData">
SELECT * FROM supportTickets1 WHERE ticketID = #val(url.ID)#</cfquery>
Thank you,
vamc
|

March 11th, 2013, 08:31 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
You'd need to pass any existing URL variables along with when the update URL is called. One option is to look at CGI.query_string, which should contain whatever the query string values are for the current page. You can append that to the update URL. Something like:
update.cfm?#cgi.query_string#
|

March 11th, 2013, 09:41 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 18
Time spent in forums: 10 h 48 m 52 sec
Reputation Power: 0
|
|
Hi .. thank you but i didn't understand properly .i will include my code please give me suggestion
Code:
the below code is in my frmTicketList.cfm
<td class="lbll" width="10%"><a href="frmTicketView.cfm?ID=#Val(TicketNumber)#">#ticketnumber#</a></td>
<td class="lbll" width="10%">#DateFormat(DateRaised,"mm-dd-yyyy")#</a></td>
<td class="lbll" width="15%">#Summary#</a></td>
<td class="lbll" width="10%">#RaisedBy#</a></td>
<td class="lbll" width="10%" >#AssignedTo#</a></td>
<td class="lbll" width="10%">#Status#</a></td>
Code:
Original
- Code |
|
|
|
the below code in my frmTicketList.cfm in this i have to update the ticket information using update button.and i have to display ticket history .please correct me if i am wrong
Code:
<Div style="width: 100%;height:85%;overflow:auto;position:absolute">
<cfquery datasource="#request.dsn#" name="getData">
SELECT *
FROM supportTickets1
WHERE ticketID = #val(url.ID)#
</cfquery>
<cfquery datasource="#request.dsn#" name="getDataHistory">
SELECT *
FROM supportTicketsHistory1
WHERE ticketID = #val(url.ID)#
</cfquery>
<cfquery datasource="#request.dsn#" name="getTicketStatus">
SELECT *
FROM SupportStatusType
</cfquery>
<cfquery datasource="#request.dsn#" name="getTypes">
SELECT [TicketTypeID],[TicketType]
FROM supportTicketType
</cfquery>
<cfquery datasource="#request.dsn#" name="getDataHistoryOfMainTicket">
SELECT *
FROM supportTicketsHistory1
WHERE ticketID = #val(url.ID)#
order by ticketID desc
</cfquery>
<table width="90%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #9999FF;">
<tr>
<td colspan="3"><h2 class="SectionHead">Ticket Summary Information</h2></td>
</tr>
<tr>
<td width="30%" valign="top"><strong>Ticket Number</strong></td>
<td width="78%"><div style="float:left;"><cfoutput>#getData.ticketID#</cfoutput><strong> raised on </strong><cfoutput>#DateTimeFormat(getData.DATERAISED,'mm/dd/yyyy hh:nn:ss tt')#</cfoutput> <strong>raised by </strong><cfoutput>#getData.RAISEDBY#</cfoutput></div><div style="float:right;padding-right:20px;"><cfquery datasource="#request.dsn#" name="getTime">
select sum(convert(float,timespent)) as total from
supportTicketsHistory1
where
ticketNumber = #getData.ticketID#
</cfquery></td>
<td width="50%">Total Tme Spent Till Now: <cfoutput><strong>#getTime.total#</strong><br /><input type="hidden" name="getExactDays" value="#getTime.total#" id="getExactDays" />
</cfoutput></div></td>
</tr>
<tr>
<td colspan="3"><div class="SectionHead">Ticket History Information</div></td>
</tr>
<tr>
<td colspan="3" align="center"> </td>
</tr>
<tr>
<td colspan="3">
<table align="center" width="100%" cellpadding="1" cellspacing="2">
<tr>
<td><strong>Status</strong></td>
<td><strong>Ticket Type</strong></td>
<td><strong>Assigned To</strong></td>
<td width="34%"><strong>Updated Description</strong></td>
<td width="9%"><strong>Time Spent</strong></td>
<td width="12%"><strong>Last Updated</strong></td>
<td width="9%"><strong>Updated By</strong></td>
</tr>
<form name="frmTicketview" action="frmTicketView.cfm" method="post">
<cfoutput>
<tr>
<td><select name="status" id="status">
<cfloop query="getTicketStatus">
<option value="#statusID#" <cfif getTicketStatus.statusID EQ getDataHistoryOfMainTicket.status>selected</cfif>>#status#</option>
</cfloop>
</select></td>
<td><select name="TicketType" id="TicketType">
<option value="" selected>(SELECT ONE)</option>
<cfloop query="getTypes">
<option value="#TicketTypeID#" <cfif getTypes.TicketTypeID EQ getDataHistoryOfMainTicket.tickettype>selected</cfif>>#TicketType#</option>
</cfloop>
</select></td>
<td><select name="assignedto" id="assignedto">
<option value="" selected>(SELECT ONE)</option>
<option value="Development" <cfif getDataHistoryOfMainTicket.assignedto eq 'Development'>selected</cfif>>Development</option>
<option value="Testing" <cfif getDataHistoryOfMainTicket.assignedto eq 'Testing'>selected</cfif>>Testing</option>
<option value="Design" <cfif getDataHistoryOfMainTicket.assignedto eq 'Design'>selected</cfif>>Design</option>
</select></td>
<td width="34%"><textarea name="comments" id="comments"></textarea></td>
<td width="9%"><input type="text" name="timespent" id="timespent" style="width:60px;" class="lastRecord"></td>
<td> </td>
<td width="9%"><input name="updTickets" type="submit" value="Update" OnSubmit="Validation()"/></td>
</tr>
</cfoutput>
</table>
</form>
</table>
</td>
</tr>
</table>
<script language="javascript">
function Validation()
{
if(document.frmTicketview.comments.value == "")
{
alert('Please Enter Description');
document.frmTicketview.comments.focus();
return false;
}
if(document.frmTicketview.timespent.value == "null")
{
alert("Please Enter Time Spent");
document.frmTicketview.timespent.focus();
return false;
}
}
</script>
<cfif isDefined('form.updTickets')>
<cfquery datasource="#request.dsn#" name="AddTicket">
INSERT INTO supportTicketsHistory1(ticketNumber, Summary, RaisedBy,
TicketType, LastUpdatedComment,LastUpdatedDate)
VALUES('#val(url.ID)#','#summary#','#raisedby#','#tickettype#',
'#comments#','#dateFormat(now(),"mm/dd/yy")#')
</cfquery>
<cfquery datasource="#request.dsn#" name="UpdateTicket">
UPDATE supportTickets1 SET
LastUpdatedDate = '#dateFormat(now(),"mm/dd/yy")#',
Summary = 'summary',
RaisedBy = '#raisedby#',
TicketType = '#tickettype#',
LastUpdatedComment = '#comments#'
WHERE ticketID = #val(url.ticketID)#
</cfquery>
</cfif>
</div>
|

March 11th, 2013, 11:48 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
I'm not sure how much simpler I can say it. You've got to pass the URL values you want to keep when you submit the form.
<form name="frmTicketview" action="frmTicketView.cfm?id=#url.id#" method="post">
Or whatever url variable names or values you want to pass through to the next page.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|