#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    18
    Rep 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
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,279
    Rep Power
    968
    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"?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    18
    Rep Power
    0

    client side script is javascript


    client side script is javascript
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,279
    Rep Power
    968
    Exactly, so I'm not really sure how your question relates to ColdFusion, since JavaScript is a totally separate subject.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    18
    Rep 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
  10. #6
  11. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,279
    Rep Power
    968
    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#
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    18
    Rep 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:
    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">&nbsp;</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>&nbsp;</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>
  14. #8
  15. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,279
    Rep Power
    968
    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.

IMN logo majestic logo threadwatch logo seochat tools logo