"$customerid", 'sessionid'=>"$sessionid", 'ticketid' => "$ticketid")); $commentresult = $client->call('get_ticket_comments', $params, $Server_Path, $Server_Path); $ticketscount = count($result); $commentscount = count($commentresult); for($i=0;$i<$ticketscount;$i++) { if($result[$i]['ticketid'] == $ticketid) { $ticket_position_in_array = $i; //Get the creator of this ticket $creator = $client->call('get_ticket_creator', $params, $Server_Path, $Server_Path); //If the ticket is created by this customer or status is not Closed then allow him to Close this ticket otherwise not if($creator == 0 && $result[$i]['status'] != $mod_strings['LBL_STATUS_CLOSED']) { $ticket_close_link = ''.$mod_strings['LBL_CLOSE_TICKET'].'   '; } } } $i = $ticket_position_in_array; if($result[$i]['ticketid'] == $ticketid) { $ticket_status = $result[$i]['status']; $list = '
  '.$mod_strings['LBL_TICKET_INFORMATION'].'


'; //This is to display the existing comments if any if($commentscount >= 1 && is_array($commentresult)) { $list .= ' '; } $list .= ' '; //Provide the Add Comment option if the ticket is not Closed if($ticket_status != $mod_strings['LBL_STATUS_CLOSED']) { $list .= ' '; } $list .= ' '; //Get the attachments list and form in the tr tag $files_array = getTicketAttachmentsList($ticketid); $attachments_count = count($files_array); if(is_array($files_array)) { for($j=0;$j<$attachments_count;$j++) { $filename = $files_array[$j]['filename']; $filetype = $files_array[$j]['filetype']; $filesize = $files_array[$j]['filesize']; $fileid = $files_array[$j]['fileid']; //To display the attachments title $attachments_title = ''; if($j == 0) $attachments_title = ''.$mod_strings['LBL_ATTACHMENT_S'].' : '; $list .= ' '; } } //To display the file upload error if($upload_status != '') { $list .= ''; } //Provide the Add Comment option if the ticket is not Closed if($ticket_status != $mod_strings['LBL_STATUS_CLOSED']) { //To display the File Browse option to upload attachment $list .= ' '; } $list .= '
'.$mod_strings['LBL_TICKET_INFORMATION'].'
'.$ticket_close_link.'
 
'.$mod_strings['LBL_TITLE'].' '.$result[$i]['title'].'
'.$mod_strings['LBL_TICKET_ID'].' '.$result[$i]['ticketid'].' '.$mod_strings['LBL_PRODUCT_NAME'].' '.$result[$i]['productname'].'
'.$mod_strings['LBL_PRIORITY'].' '.getTranslatedString($result[$i]['priority']).' '.$mod_strings['LBL_SEVERITY'].' '.getTranslatedString($result[$i]['severity']).'
'.$mod_strings['LBL_STATUS'].' '.getTranslatedString($result[$i]['status']).' '.$mod_strings['LBL_CATEGORY'].' '.getTranslatedString($result[$i]['category']).'
'.$mod_strings['LBL_CREATED_TIME'].' '.$result[$i]['createdtime'].' '.$mod_strings['LBL_MODIFIED_TIME'].' '.$result[$i]['modifiedtime'].'
'.$mod_strings['LBL_DESCRIPTION'].' '.nl2br($result[$i]['description']).'
'.$mod_strings['LBL_RESOLUTION'].' '.nl2br($result[$i]['solution']).'
 
'.$mod_strings['LBL_COMMENTS'].'
'; //Form the comments in between tr tags for($j=0;$j<$commentscount;$j++) { $list .= ' '; } $list .= '
'.($commentscount-$j).' '.$commentresult[$j]['comments'].'
'.$mod_strings['LBL_COMMENT_BY'].' : '.$commentresult[$j]['owner'].' '.$mod_strings['LBL_ON'].' '.$commentresult[$j]['createdtime'].'
 
'.$mod_strings['LBL_ADD_COMMENT'].'
   
 
'.$mod_strings['LBL_ATTACHMENTS'].'
'.$attachments_title.' '.ltrim($filename,$ticketid.'_').'
'.$mod_strings['LBL_FILE_UPL_ERROR'].' : '.$upload_status.'
'.$mod_strings['LBL_ATTACH_FILE'].' :
'; echo $list; } else { $list = '

'.$mod_strings['LBL_NO_DETAILS_EXIST']; echo $list; } // Puneeth : Added on 10 Dec 2007 $filevalidation_script = << function getFileNameOnly(filename) { var onlyfilename = filename; // Normalize the path (to make sure we use the same path separator) var filename_normalized = filename.replace(/\\\\/g, '/'); if(filename_normalized.lastIndexOf("/") != -1) { onlyfilename = filename_normalized.substring(filename_normalized.lastIndexOf("/") + 1); } return onlyfilename; } /* Function to validate the filename */ function validateFilename(form_ele) { if (form_ele.value == '') return true; var value = getFileNameOnly(form_ele.value); // Color highlighting logic var err_bg_color = "#FFAA22"; if (typeof(form_ele.bgcolor) == "undefined") { form_ele.bgcolor = form_ele.style.backgroundColor; } // Validation starts here var valid = true; /* Filename length is constrained to 255 at database level */ if (value.length > 255) { alert(alert_arr.LBL_FILENAME_LENGTH_EXCEED_ERR); valid = false; } if (!valid) { form_ele.style.backgroundColor = err_bg_color; return false; } form_ele.style.backgroundColor = form_ele.bgcolor; form_ele.form[form_ele.name + '_hidden'].value = value; return true; } JSFILEVALIDATION; echo $filevalidation_script; //Puneeth : End ?>