Subversion Repositories SmartDukaan

Rev

Rev 3422 | Rev 3519 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#set($messages = $action.getActionErrors())
#if($messages && $messages.size() != 0)
    #foreach($message in $messages)
        $message <br/>
    #end
#else
#set($ticket = $action.getTicket())
#set($ticketId = $ticket.getId())
<div >
<div id="mail-div" class="hidden">
    <form id="mail-form">
        <table >
            <colgroup >
                <col width="10%"/>
                <col width="90%"/>
            </colgroup>
            <tbody >
                #if($ticket.isSetCustomerId())
                #set($customerEmailId = $action.getUser($ticket.getCustomerId()).getEmail())
                #else
                #set($customerEmailId = $ticket.getCustomerEmailId())
                #end
                <tr >
                    <td ><span >Reply to:</span></td>
                    <td >$customerEmailId</td>
                </tr>
                <tr >
                    <td ><span >Subject:</span></td>
                    <td ><textarea name="subject" rows="1" class="required" cols="75">$action.getSubject()</textarea></td>
                </tr>
                <tr >
                    <td ><span >Body:</span></td>
                    <td ><textarea name="body" rows="12" class="required" cols="75"></textarea></td>
                </tr>
                <tr >
                    <td ><input type="hidden" name="customerEmailId" value="$customerEmailId"/></td>
                    <td ><input type="submit" value="Send mail and save ticket"/></td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<div id="bottom-infopane-upper">
    <form id="update-ticket-form" ticketId="$ticketId" _method="put" method="post" action="">
        <table>
            <colgroup>
                <col width="200px"/>
                <col width="250px"/>
                <col width="120px"/>
                <col width="200px"/>
                <col width="300px"/>
            </colgroup>
            #if($ticket.isSetCustomerId())
            #else
                <tr >
                    <td >Customer Name: </td>
                    <td >
                        #if($ticket.isSetCustomerName())
                            <input type="text" name="customerName" value="$ticket.getCustomerName()"/>
                        #else
                            <input type="text" name="customerName"/>
                        #end
                    </td>
                    <td ></td>
                    <td >Customer Mobile No: </td>
                    <td >
                        #if($ticket.isSetCustomerMobileNumber())
                            <input type="text" name="customerMobileNumber" value="$ticket.getCustomerMobileNumber()"/>
                        #else
                            <input type="text" name="customerMobileNumber"/>
                        #end
                    </td>
                </tr>
            #end
            <tr >
                <td ><label>Description:</label></td>
                <td colspan="4"><textarea id="description" class="required" name="description" rows="2" cols="90">$ticket.getDescription()</textarea></td>
            </tr>
            <tr >
                <td ><label>Category:</label></td>
                <td >
                <select name="category" class="width10">
                    #foreach( $category in $action.getTicketCategories() )
                        #if($category.name() == $ticket.getCategory().name())
                            <option value="$category.name()" selected="selected">$category.name()</option>
                        #else
                            <option value="$category.name()">$category.name()</option>
                        #end
                    #end
                </select>
                </td>
                <td></td>
                <td ><label>Order Id:</label></td>
                <td >
                    #if($ticket.isSetOrderId())
                        $ticket.getOrderId()
                    #else
                        N/A
                    #end
                </td>
            </tr>
            <tr >
                <td ><label>Assignee:</label></td>
                #if($action.isAssigneeEditable())
                    <td >
                    <select name="assigneeEmailId" class="width10">
                        #foreach( $agent in $action.getAllAgents() )
                            #if($agent.getId() == $ticket.getAssigneeId())
                                <option value="$agent.getEmailId()" selected="selected">$agent.getEmailId()</option>
                            #else
                                <option value="$agent.getEmailId()">$agent.getEmailId()</option>
                            #end
                        #end
                    </select>
                    </td>
                #else
                    #if ($ticket.isSetAssigneeId())
                        #set($assigneeEmailId = $action.getAgent($ticket.getAssigneeId()).getEmailId())
                        <td >$assigneeEmailId
                            <input type="hidden" name="assigneeEmailId" value="$assigneeEmailId"/>
                        </td>
                    #else
                        <td >N/A
                            <input type="hidden" name="assigneeEmailId" value=""/>
                        </td>
                    #end
                #end
                <td ></td>
                <td ><label>Created by:</label></td>
                <td >$action.getAgent($ticket.getCreatorId()).getEmailId()</td>
            </tr>
            <tr >
                <td ><label>Status:</label></td>
                <td >
                <select name="status" class="width10">
                    #foreach( $status in $action.getTicketStatuses() )
                        #if($status.name() == $ticket.getStatus().name())
                            <option value="$status.name()" selected="selected">$status.name()</option>
                        #else
                            <option value="$status.name()">$status.name()</option>
                        #end
                    #end
                </select>
                </td>
                <td ></td>
                <td ><label>Priority:</label></td>
                <td >
                <select name="priority" class="width10">
                    #foreach( $priority in $action.getTicketPriorities() )
                        #if($priority.name() == $ticket.getPriority().name())
                            <option value="$priority.name()" selected="selected">$priority.name()</option>
                        #else
                            <option value="$priority.name()">$priority.name()</option>
                        #end
                    #end
                </select>
                </td>
            </tr>
            <tr >
                <td ><label>Activity Type:</label></td>
                <td colspan="4">
                <select id="activity-type" name="activityType" class="width-activity-type">
                    #foreach( $type in $action.getActivityTypes() )
                        #if($type.name() == "OTHER")
                            <option value="$type.name()" selected="selected">$type.name()</option>
                        #else
                            <option value="$type.name()">$type.name()</option>
                        #end
                    #end
                </select>
                </td>
                </td>
            </tr>
            <tr >
                <td ><label>Activity description:</label></td>
                <td colspan="4"><textarea class="required" name="activityDescription" rows="2" cols="90"></textarea></td>
            </tr>
            <tr >
                <td colspan="2"></td>
                <td colspan="2"><input type="submit" value="Save" /></td>
                <td ><input type="hidden" name="userId" value="$ticket.getCustomerId()"/></td>
            </tr>
        </table>
    </form>
</div>
<h2 >Activities</h2>
<div id="bottom-infopane-lower">
    <table id="activity-table" class="display">
        <thead >
            <tr class="table-tr-header">
                <th >Activity Id</th>
                <th >Type</th>
                <th >Description</th>
                <th >Timestamp</th>
                <th >Created by</th>
                <th >Assignee</th>
                <th >Category</th>
                <th >Status</th>
                <th >Priority</th>
                <th >Ticket Description</th>
                <!--th >Customer Name</th>
                <th >Customer Email Id</th>
                <th >Customer Mobile No</th-->
            </tr>
        </thead>
        <tbody >
        #foreach($activity in $action.getActivities())
            #set($date = $action.convertDate($activity.getCreationTimestamp()))
            #set($trClass = "table-tr-odd")
            #if($velocityCount % 2 == 0)
                #set($trClass = "table-tr-even")
            #end
            <tr class="$trClass">
                <td class="truncated-text-for-activity-table">$activity.getId()</td>
                <td class="truncated-text-for-activity-table">$activity.getType().name()</td>
                <td class="truncated-text-for-activity-table"><pre>$activity.getDescription()</pre></td>
                <td class="truncated-text-for-activity-table">$date</td>
                <td class="truncated-text-for-activity-table">$action.getAgent($activity.getCreatorId()).getEmailId()</td>
                #if($activity.isSetTicketAssigneeId())
                    <td class="truncated-text-for-activity-table">$action.getAgent($activity.getTicketAssigneeId()).getEmailId()</td>
                #else
                    <td class="truncated-text-for-activity-table">N/A</td>
                #end
                <td class="truncated-text-for-activity-table">$activity.getTicketCategory().name()</td>
                <td class="truncated-text-for-activity-table">$activity.getTicketStatus().name()</td>
                <td class="truncated-text-for-activity-table">$activity.getTicketPriority().name()</td>
                <td class="truncated-text-for-activity-table">$activity.getTicketDescription()</td>
                <!--td class="truncated-text-for-activity-table">
                #if($activity.getCustomerName())
                    $activity.getCustomerName()
                #else
                    N/A
                #end
                </td>
                <td class="truncated-text-for-activity-table">
                #if($activity.getCustomerEmailId())
                    $activity.getCustomerEmailId()
                #else
                    N/A
                #end
                </td>
                <td class="truncated-text-for-activity-table">
                #if($activity.getCustomerMobileNumber())
                    $activity.getCustomerMobileNumber()
                #else
                    N/A
                #end
                </td-->                
            </tr>
        #end
        </tbody>
    </table>
</div>
</div>
#end
<script >
$(document).ready(
    function () {
        $(".truncated-text-for-activity-table").truncate({
            width : 65,
            addtitle : true
        });
    }
);
</script>