Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="support-ticket-edit.html" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
<file name="support-tickets.html" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
</dwsync>

View File

@@ -0,0 +1,220 @@
{extends file="admin-layout.tpl"}
{default_translation_domain domain='supportticket.bo.default'}
{block name="no-return-functions"}
{$admin_current_location = 'tools'}
{/block}
{block name="page-title"}{intl l='support ticket'}{/block}
{block name="check-resource"}admin.module{/block}
{block name="check-access"}update{/block}
{block name="check-module"}SupportTicket{/block}
{block name="main-content"}
{form name="support_ticket.update"}
<div id="wrapper" class="container">
{if $form_error}
<div class="alert alert-danger">{$form_error_message}</div>
{/if}
<div class="general-block-decorator">
<div class="title title-without-tabs">
{intl l="support ticket edit" d="supportticket.bo.default"}
</div>
<div class="form-container">
<form method="POST" action="{$current_url}" {form_enctype form=$form} class="clearfix" >
{include "includes/inner-form-toolbar.html"
close_url = {url path="/admin/module/SupportTicket/support_ticket"}
}
{form_field form=$form field="id"}
{assign "support_ticket_id" $value}
<input type="hidden" name="{$name}" value="{$value}"/>
{/form_field}
{form_field form=$form field="success_url"}
<input type="hidden" name="{$name}" value="{url path='/admin/module/SupportTicket'}/support_ticket"/>
{/form_field}
{form_hidden_fields form=$form}
{loop name="support_ticket_update" type="support-ticket" backend_context="yes" id=$support_ticket_id lang=$edit_language_id}
<div class="row">
<div class="col-md-12">
{*
{form_field form=$form field="status"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="status"}{$message}{/form_error}
<input type="checkbox" class="form-control" name="{$name}" id="{$label_attr.for}" {if $STATUS}checked{/if} {form_field_attributes form=$form field="status"} placeholder="{intl l='The support ticket status'}" />
</div>
{/form_field}
{form_field form=$form field="customer_id"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="customer_id"}{$message}{/form_error}
<input type="number" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$CUSTOMER_ID}" {form_field_attributes form=$form field="customer_id"} placeholder="{intl l='The support ticket customer_id'}" />
</div>
{/form_field}
{form_field form=$form field="order_id"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="order_id"}{$message}{/form_error}
<input type="number" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$ORDER_ID}" {form_field_attributes form=$form field="order_id"} placeholder="{intl l='The support ticket order_id'}" />
</div>
{/form_field}
{form_field form=$form field="order_product_id"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="order_product_id"}{$message}{/form_error}
<input type="number" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$ORDER_PRODUCT_ID}" {form_field_attributes form=$form field="order_product_id"} placeholder="{intl l='The support ticket order_product_id'}" />
</div>
{/form_field}
*}
<div class="form-group">
{intl l="Status: " d="supportticket.bo.default"}
<strong>{$STATUS_TEXT}</strong>
</div>
<div class="form-group">
{loop type="customer" name="customer" id={$CUSTOMER_ID} current="no" backend_context="1" limit="1"}
{intl l="Customer: " d="supportticket.bo.default"}
<a href="{url path='/admin/customer/update' customer_id=$CUSTOMER_ID}">
{$FIRSTNAME} {$LASTNAME}
</a>
{/loop}
</div>
<div class="form-group">
{if $ADMIN_ID}
{loop type="admin" name="admin" id={$ADMIN_ID} backend_context="1" limit="1"}
{intl l="Administrator: " d="supportticket.bo.default"}
<strong>{$FIRSTNAME} {$LASTNAME}</strong>
{/loop}
{/if}
</div>
<div class="form-group">
{if $ORDER_ID}
{loop type="order" name="order" id={$ORDER_ID} backend_context="1" limit="1"}
{intl l="Order: " d="supportticket.bo.default"}
<a href="{url path='/admin/order/update' order_id=$ID}">
{$REF}
</a>
{/loop}
{/if}
</div>
<div class="form-group">
{if $ORDER_PRODUCT_ID}
{loop type="order" name="order" id={$ORDER_PRODUCT_ID} backend_context="1" limit="1"}
{intl l="Product: " d="supportticket.bo.default"}
<strong>{$TITLE}</strong>
{/loop}
{/if}
</div>
<div class="form-group">
{intl
l="created on <strong>%created_at</strong>. Last modification: <strong>%updated_at</strong>"
created_at={format_date date=$CREATE_DATE}
updated_at={format_date date=$UPDATE_DATE}
d="supportticket.bo.default"
}
{if $REPLIED_AT}
<br>{intl l='Replied on <strong>%replied_at</strong>.' replied_at={format_date date=$REPLIED_AT}}
{/if}
</div>
{form_field form=$form field="admin_id"}
<input type="hidden" name="{$name}" id="{$label_attr.for}" value="{admin attr="id"}" />
{/form_field}
{form_field form=$form field="subject"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="subject"}{$message}{/form_error}
<input type="text" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$SUBJECT}" {form_field_attributes form=$form field="subject"} placeholder="{intl l='The support ticket subject'}" />
</div>
{/form_field}
{form_field form=$form field="message"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="message"}{$message}{/form_error}
<textarea class="form-control" name="{$name}" id="{$label_attr.for}" {form_field_attributes form=$form field="message"} placeholder="{intl l='The support ticket message'}">{$MESSAGE}</textarea>
</div>
{/form_field}
{form_field form=$form field="response"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="response"}{$message}{/form_error}
<textarea class="form-control" name="{$name}" id="{$label_attr.for}" {form_field_attributes form=$form field="response"} placeholder="{intl l='The support ticket response'}">{$RESPONSE}</textarea>
</div>
{/form_field}
{form_field form=$form field="comment"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="comment"}{$message}{/form_error}
<textarea class="form-control" name="{$name}" id="{$label_attr.for}" {form_field_attributes form=$form field="comment"} placeholder="{intl l='The support ticket comment'}">{$COMMENT}</textarea>
</div>
{/form_field}
{include "includes/inner-form-toolbar.html"
hide_flags = true
close_url = {url path="/admin/module/SupportTicket/support_ticket"}
}
</div>
</div>
{/loop}
</form>
</div>
</div>
</div>
{/form}
{/block}
{block name="javascript-initialization"}
{/block}

View File

@@ -0,0 +1,370 @@
{extends file="admin-layout.tpl"}
{default_translation_domain domain='supportticket.bo.default'}
{block name="no-return-functions"}
{$admin_current_location = 'tools'}
{/block}
{block name="page-title"}{intl l='SupportTicket'}{/block}
{block name="check-resource"}admin.module{/block}
{block name="check-access"}view{/block}
{block name="check-module"}SupportTicket{/block}
{block name="main-content"}
<div id="wrapper" class="container">
{if $general_error}
<div class="alert alert-danger">
{$general_error}
</div>
{/if}
<!-- SupportTicket list -->
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed" id="support_ticket-table">
<caption class="clearfix">
{intl l="Support ticket"}
{* not implemented yet
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.module" access="CREATE" module="SupportTicket"}
<div class="pull-right">
<a class="btn btn-default btn-primary" title="{intl l='Create a new support ticket entry' d='supportticket.bo.default'}" data-target="#support_ticket-create" data-toggle="modal">
<i class="glyphicon glyphicon-plus-sign"></i>
</a>
</div>
{/loop}
*}
</caption>
<thead>
<tr>
<th>
{admin_sortable_header
current_order=$order
order='id'
reverse_order='id-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Id' d='supportticket.bo.default'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='status'
reverse_order='status-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Status' d='supportticket.bo.default'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='customer_id'
reverse_order='customer_id-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Customer' d='supportticket.bo.default'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='admin_id'
reverse_order='admin_id-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Administrator' d='supportticket.bo.default'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='order_id'
reverse_order='order_id-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Order' d='supportticket.bo.default'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='order_product_id'
reverse_order='order_product_id-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Product' d='supportticket.bo.default'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='subject'
reverse_order='subject-reverse'
path={url path='/admin/module/SupportTicket/support_ticket' target='support_ticket-table'}
label="{intl l='Subject' d='supportticket.bo.default'}"
}
</th>
<th>
{intl l="Actions"}
</th>
</tr>
</thead>
<tbody>
{loop name="support-ticket-list" type="support-ticket" order=$order}
<tr>
<td>
<a href="{url path='/admin/module/SupportTicket/support_ticket/edit' support_ticket_id=$ID}">{$ID}</a>
</td>
<td>
{$STATUS_TEXT}
{if $REPLIED_AT}<br><i title="{intl l='Replied on ' }">{format_date date=$REPLIED_AT}</i>{/if}
</td>
<td>
{loop type="customer" name="customer" id={$CUSTOMER_ID} current="no" backend_context="1"}
<a href="{url path='/admin/customer/update' customer_id=$CUSTOMER_ID}">
{$FIRSTNAME} {$LASTNAME}
</a>
{/loop}
</td>
<td>
{if $ADMIN_ID}
{loop type="admin" name="admin" id={$ADMIN_ID} backend_context="1"}
{$FIRSTNAME} {$LASTNAME}
{/loop}
{/if}
</td>
<td>
{if $ORDER_ID}
{loop type="order" name="order" id={$ORDER_ID} backend_context="1"}
<a href="{url path='/admin/order/update' order_id=$ID}">
{$REF}
</a>
{/loop}
{/if}
</td>
<td>
{if $ORDER_PRODUCT_ID}
{loop type="order" name="order" id={$ORDER_PRODUCT_ID} backend_context="1"}
{$TITLE}
{/loop}
{/if}
</td>
</td>
<td>
{$SUBJECT}
</td>
{* Actions *}
<td>
<div class="btn-group">
{loop name="auth-edit" type="auth" role="ADMIN" resource="admin.module" access="UPDATE" module="SupportTicket"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this support ticket' d='supportticket.bo.default'}" href="{url path='/admin/module/SupportTicket/support_ticket/edit' support_ticket_id=$ID}">
<i class="glyphicon glyphicon-edit"></i>
</a>
{/loop}
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.module" access="DELETE" module="SupportTicket"}
<a class="btn btn-default btn-xs support_ticket-delete" title="{intl l='Delete this support ticket' d='supportticket.bo.default'}" data-target="#support_ticket-delete" data-toggle="modal" data-id="{$ID}">
<i class="glyphicon glyphicon-trash"></i>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="support-ticket-list"}
<tr>
<td colspan="1000">
<div class="alert alert-info">
{intl l="There is no support ticket" d="supportticket.bo.default"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
{ifloop rel="support-ticket-list"}
<tfoot>
<tr>
<td colspan="7">
{include
file = "includes/pagination.html"
loop_ref = "support-ticket-list"
max_page_count = 20
page_url = "{url path="/admin/module/SupportTicket/support_ticket" order=$order target='support_ticket-table'}"
}
</td>
</tr>
</tfoot>
{/ifloop}
</table>
</div>
</div>
</div>
{* CREATE Modal *}
{* not implemented yet
{form name="support_ticket.create"}
{capture "support_ticket_create"}
{form_hidden_fields form=$form}
{render_form_field form=$form field="success_url" value={url path='/admin/module/SupportTicket/support_ticket/edit?support_ticket_id=_ID_'}}
{form_field form=$form field="status"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="status"}{$message}{/form_error}
<input type="checkbox" name="{$name}" id="{$label_attr.for}" {if $STATUS}checked{/if} {form_field_attributes form=$form field="status"} placeholder="{intl l='The support ticket status'}" />
</div>
{/form_field}
{form_field form=$form field="customer_id"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="customer_id"}{$message}{/form_error}
<input type="integer" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$CUSTOMER_ID}" {form_field_attributes form=$form field="customer_id"} placeholder="{intl l='The support ticket customer_id'}" />
</div>
{/form_field}
{form_field form=$form field="admin_id"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="admin_id"}{$message}{/form_error}
<input type="integer" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$ADMIN_ID}" {form_field_attributes form=$form field="admin_id"} placeholder="{intl l='The support ticket admin_id'}" />
</div>
{/form_field}
{form_field form=$form field="order_id"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="order_id"}{$message}{/form_error}
<input type="integer" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$ORDER_ID}" {form_field_attributes form=$form field="order_id"} placeholder="{intl l='The support ticket order_id'}" />
</div>
{/form_field}
{form_field form=$form field="order_product_id"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="order_product_id"}{$message}{/form_error}
<input type="integer" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$ORDER_PRODUCT_ID}" {form_field_attributes form=$form field="order_product_id"} placeholder="{intl l='The support ticket order_product_id'}" />
</div>
{/form_field}
{form_field form=$form field="subject"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="subject"}{$message}{/form_error}
<input type="text" class="form-control" name="{$name}" id="{$label_attr.for}" value="{$SUBJECT}" {form_field_attributes form=$form field="subject"} placeholder="{intl l='The support ticket subject'}" />
</div>
{/form_field}
{form_field form=$form field="message"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="message"}{$message}{/form_error}
<textarea class="form-control" name="{$name}" id="{$label_attr.for}"{form_field_attributes form=$form field="message"} placeholder="{intl l='The support ticket message'}">{$MESSAGE}</textarea>
</div>
{/form_field}
{form_field form=$form field="response"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="response"}{$message}{/form_error}
<textarea class="form-control" name="{$name}" id="{$label_attr.for}"{form_field_attributes form=$form field="response"} placeholder="{intl l='The support ticket response'}">{$RESPONSE}</textarea>
</div>
{/form_field}
{form_field form=$form field="comment"}
<div class="form-group"">
<label class="control-label" for="{$label_attr.for}">
{$label}
{if $required}<span class="required">*</span>{/if}
</label>
{form_error form=$form field="comment"}{$message}{/form_error}
<textarea class="form-control" name="{$name}" id="{$label_attr.for}"{form_field_attributes form=$form field="comment"} placeholder="{intl l='The support ticket comment'}">{$COMMENT}</textarea>
</div>
{/form_field}
{/capture}
{include file="includes/generic-create-dialog.html"
dialog_id = "support_ticket-create"
dialog_title = {intl l="Create an entry of support ticket" d="supportticket.bo.default"}
dialog_body = {$smarty.capture.support_ticket_create nofilter}
dialog_ok_label = {intl l="Create"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {$current_url}
form_enctype = {form_enctype form=$form}
}
{/form}
*}
{* DELETE modal *}
{capture "support_ticket_delete"}
{intl l="Do you really want to delete this support ticket entry ?" d="supportticket.bo.default"}
<input type="hidden" name="support_ticket_id" id="support_ticket_delete_id" value="" />
{/capture}
{include file="includes/generic-confirm-dialog.html"
dialog_id = "support_ticket-delete"
dialog_title = {intl l="Delete an entry of support ticket" d="supportticket.bo.default"}
dialog_message = {$smarty.capture.support_ticket_delete nofilter}
dialog_ok_label = {intl l="Delete"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {token_url path='/admin/module/SupportTicket/support_ticket/delete'}
}
{/block}
{block name="javascript-initialization"}
<script>
$(function() {
$('a.support_ticket-delete').click(function(ev) {
$('#support_ticket_delete_id').val($(this).data('id'));
});
});
</script>
{/block}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="support-ticket-administrator.html" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
<file name="support-ticket-administrator.txt" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
<file name="support-ticket-customer.html" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
<file name="support-ticket-customer.txt" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
</dwsync>

View File

@@ -0,0 +1,16 @@
{default_translation_domain domain="supportticket.email.default"}
<p>{intl l="Hi" },</p>
<p>{intl l="A customer has posted a new question : "}</p>
<h4>{$ticket->getSubject()}</h4>
<p>{$ticket->getMessage()}</p>
<p>
{intl l="You can answer to the question here : "}
{$url={url path='/admin/module/SupportTicket/support_ticket/edit' support_ticket_id=$ticket->getId()}}
<a href="{$url}">{$url}</a>
</p>
<p>{intl l="Best Regards."}</p>

View File

@@ -0,0 +1,17 @@
{default_translation_domain domain="supportticket.email.default"}
{intl l="Hi" },
{intl l="A customer has posted a new question : "}
---------------------
{$ticket->getSubject()}
---------------------
{$ticket->getMessage()}
---------------------
{intl l="You can answer to the question here : "}
{$url={url path='/admin/module/SupportTicket/support_ticket/edit' support_ticket_id=$ticket->getId()}}
{$url}
{intl l="Best Regards."}

View File

@@ -0,0 +1,20 @@
{default_translation_domain domain="supportticket.email.default"}
<p>{intl l="Hi" },</p>
<p>{intl l="You have an answer to your question : "}</p>
<h4>{intl l="Your question: "}</h4>
<h5>{$ticket->getSubject()}</h5>
<p>{$ticket->getMessage()}</p>
<h5>{intl l="The Answer: "}</h5>
<p>{$ticket->getResponse()}</p>
<p>
{$url={url path='/module/SupportTicket/support'}}
<a href="{$url}">{intl l="View your support desahboard online"}</a>
</p>
<p>{intl l="Best Regards."}</p>

View File

@@ -0,0 +1,25 @@
{default_translation_domain domain="supportticket.email.default"}
{intl l="Hi" },
{intl l="You have an answer to your question : "}
{intl l="Your question: "}
-----------------------
{$ticket->getSubject()}
-----------------------
{$ticket->getMessage()}
-----------------------
-----------------------
{intl l="The Answer: "}
-----------------------
{$ticket->getResponse()}
-----------------------
{$url={url path='/module/SupportTicket/support'}}
{intl l="View your support desahboard online"} : {$url}
{intl l="Best Regards."}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="account-additional.html" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
<file name="support-ticket.html" server="51.254.220.106//web/" local="131351950800000000" remote="131351950800000000" />
</dwsync>

View File

@@ -0,0 +1,5 @@
<p>
{intl l="You have a problem with a product or a question ?" d="supportticket.fo.default"}
<a href="{url path="/module/SupportTicket/support"}">
{intl l="Drop us a line" d="supportticket.fo.default"}</a>
</p>

View File

@@ -0,0 +1,232 @@
{extends file="layout.tpl"}
{* Security *}
{block name="no-return-functions" prepend}
{check_auth role="CUSTOMER" login_tpl="login"}
{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{$breadcrumbs = [
['title' => {intl l="Account"}, 'url'=>{url path="/account"}],
['title' => {intl l="Support" d="supportticket.fo.default"}, 'url'=>{url path="/account/comments"}]
]}
{/block}
{block name="body-class"}page-account-supportticket{/block}
{block name="main-content"}
<div class="main">
<article class="col-main" role="main" aria-labelledby="main-label">
<h1 id="main-label" class="page-header">{intl l="Support" d="supportticket.fo.default"}</h1>
{$customer_id={customer attr="id"}}
{$orders=[]}
{$products=[]}
{loop type="order" name="customer.orders" customer={$customer_id} limit="20" order="create-date-reverse"}
{$order=$ID}
{$orders[]=['id' => $ID, 'ref' => $REF]}
{loop type="order_product" name="order-products" order=$ID}
{$products[]=['id' => $ID, 'order' => $order, 'ref' => $REF, 'title' => $TITLE]}
{/loop}
{/loop}
<div class="support-ticket-new well">
<button id="support-product-form-trigger" class="btn btn-default">{intl l="New question" d="supportticket.fo.default"}</button>
<br>
{form name="support_ticket.front.create"}
<form id="support-product-form" method="post" action="{url path="/module/SupportTicket/create"}" {form_enctype form=$form}>
{form_hidden_fields form=$form}
{form_field form=$form field="customer_id"}
<input type="hidden" name="{$name}" value="{$customer_id}" />
{/form_field}
{form_field form=$form field="order_id"}
<div class="form-group">
<label>{$label}</label>
<select name="{$name}" id="support-order-id" class="form-control" {$attr}>
<option value="">{intl l="No order" d="supportticket.fo.default"}</option>
{foreach $orders as $order}
<option value="{$order.id}">{$order.ref}</option>
{/foreach}
</select>
</div>
{/form_field}
{form_field form=$form field="order_product_id"}
<div id="support-product-container" class="form-group">
<label>{$label}</label>
<select name="{$name}" id="support-product-id" class="form-control" {$attr}>
<option value="">{intl l="No product" d="supportticket.fo.default"}</option>
{foreach $products as $product}
<option value="{$product.id}" data-order="{$product.order}">{$product.title} ({$product.ref})</option>
{/foreach}
</select>
</div>
{/form_field}
{form_field form=$form field="subject"}
<div class="form-group">
<label>{$label}</label>
<input type="text" name="{$name}" value="{$value}" class="form-control" {$attr}>
</div>
{/form_field}
{form_field form=$form field="message"}
<div class="form-group">
<label>{$label}</label>
<textarea name={$name} class="form-control" {$attr}>{$value}</textarea>
</div>
{/form_field}
<div class="form-group">
<input type="submit" class="btn btn-validate" value="{intl l='validate' d='supportticket.fo.default'}" />
</div>
</form>
{/form}
</div>
{flash type="supportticket-message"}
{* Display error message if exist *}
<div class="alert alert-info">
{$MESSAGE}
</div>
{/flash}
{ifloop rel="support-ticket"}
<div class="support-ticket-list list-group">
{loop name="support-ticket" type="support-ticket" customer_id={$customer_id} status="0,1" order="id-reverse" }
<div class="support-ticket-item list-group-item">
<h4>{$SUBJECT}</h4>
<p>
{intl l="on %date" d="supportticket.fo.default" date={format_date date=$UPDATE_DATE output="date"} }
{if $ORDER_ID}
{intl l=", order: " d="supportticket.fo.default"}
{loop name="order" type="order" id=$ORDER_ID limit="1"}{$REF}{/loop}
{/if}
{if $ORDER_PRODUCT_ID}
{intl l=", product: " d="supportticket.fo.default"}
{loop name="order_product" type="order_product" order=$ORDER_ID id=$ORDER_PRODUCT_ID limit="1"}{$TITLE} ({$REF}){/loop}
{/if}
<br/>
<a href="{url path="/module/SupportTicket/delete/$ID"}">
{intl l="Delete this question" d="supportticket.fo.default"}</a>
</p>
<div class="row">
<div class="suport-ticket-item-message alert alert-success col-md-8 col-md-offset-1">
<p>
{$MESSAGE}
</p>
</div>
{if $RESPONSE}
<div class="suport-ticket-item-response alert alert-info col-md-8 col-md-offset-3">
<p>
{intl l="replied on %date" d="supportticket.fo.default" date={format_date date=$REPLIED_AT output="date"} }
</p>
<p>
{$RESPONSE}
</p>
</div>
{/if}
</div>
</div>
{/loop}
</div>
{/ifloop}
</article>
</div><!-- /.layout -->
{/block}
{block name="stylesheet"}
{/block}
{block name="after-javascript-include"}
{/block}
{block name="javascript-initialization"}
<script type="text/javascript">
{literal}
(function ($) {
$(document).ready(function () {
var $order = $('#support-order-id'),
$productContainer = $('#support-product-container'),
$product = $('#support-product-id'),
$formTrigger = $('#support-product-form-trigger')
$form = $('#support-product-form')
;
$productContainer.hide();
$form.hide();
$formTrigger.on('click', function() {
$form.show();
$formTrigger.hide();
});
$order.on('change', function(ev){
var $order = $(this),
orderId = $order.val();
if (orderId == '') {
$product.val('');
$productContainer.hide();
} else {
$product.val('');
$product.find('option').each(function(){
var $option = $(this);
if ($option.attr('value') != '' && $option.data("order") != orderId) {
$option.css('display', "none");
} else {
$option.css('display', "");
}
});
$productContainer.show();
}
});
$form.on('submit', function(e){
e.preventDefault();
var url = $form.attr("action");
$.ajax({
type: "POST",
dataType: 'json',
data: $form.serialize(),
url: $form.attr('action')
}).done(function(data, textStatus, jqXHR){
var status;
if (data.success) {
document.location.reload();
} else {
bootbox.alert(data.message);
}
}).fail(function(jqXHR, textStatus, errorThrown){
bootbox.alert(textStatus);
});
});
});
})(jQuery);
{/literal}
</script>
{/block}