[+] BO Customers WIP

This commit is contained in:
Kevin Granger committed 2013-07-29 19:18:02 +02:00
1 parent 613c9b66e5
commit d95a519ace
8 files changed
+93 -117

No files matched your search

+7 -6
View File
@@ -5089,12 +5089,12 @@ body.fixed-top {
border-radius: 5px; border-radius: 5px;
-webkit-box-shadow: rgba(0, 0, 0, 0.1) 0 0 7px, white 0 0 0 4px inset; -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0 0 7px, white 0 0 0 4px inset;
box-shadow: rgba(0, 0, 0, 0.1) 0 0 7px, white 0 0 0 4px inset; } box-shadow: rgba(0, 0, 0, 0.1) 0 0 7px, white 0 0 0 4px inset; }
#content legend { #content h3 {
float: left; padding: 0 0 5px 0;
padding: 0 0 0 0; margin: 0 0 15px 0;
margin: 5px 0 15px 0; color: #cac4b9;
color: #bfb8b3; font-weight: 300;
font-weight: 300; } border-bottom: solid 1px #e0ddd6; }
#content form .alert { #content form .alert {
clear: both; clear: both;
color: #756b64; color: #756b64;
@@ -5223,6 +5223,7 @@ body.fixed-top {
color: #313a45; } color: #313a45; }
#footer { #footer {
z-index: 9999;
position: fixed; position: fixed;
width: 100%; width: 100%;
bottom: 0; bottom: 0;
@@ -53,12 +53,12 @@ body.fixed-top
background-color: $bg-content-color background-color: $bg-content-color
@include border-radius(5px) @include border-radius(5px)
@include box-shadow(rgba(black,0.10) 0 0 7px, white 0 0 0 4px inset) @include box-shadow(rgba(black,0.10) 0 0 7px, white 0 0 0 4px inset)
legend h3
float: left padding: 0 0 5px 0
padding: 0 0 0 0 margin: 0 0 15px 0
margin: 5px 0 15px 0 color: darken($bg-content-color,20%)
color: darken(#D6D2CF,10%)
font-weight: 300 font-weight: 300
border-bottom: solid 1px darken($bg-content-color,10%)
form .alert form .alert
clear: both clear: both
color: darken(#D6D2CF,40%) color: darken(#D6D2CF,40%)
@@ -178,6 +178,7 @@ body.fixed-top
color: $brand-primary color: $brand-primary
#footer #footer
z-index: 9999
position: fixed position: fixed
width: 100% width: 100%
bottom: 0 bottom: 0
@@ -27,7 +27,7 @@
{block name="override_header"} {block name="override_header"}
<div id="CustomerThreadContacts"> <div id="CustomerThreadContacts" class="row">
{assign var=nb_categories value=count($categories)} {assign var=nb_categories value=count($categories)}
@@ -38,64 +38,48 @@
{foreach $contacts as $tmp => $tmp2} {foreach $contacts as $tmp => $tmp2}
{if $val.id_contact == $tmp2.id_contact} {if $val.id_contact == $tmp2.id_contact}
{assign var=total_thread value=$tmp2.total} {assign var=total_thread value=$tmp2.total}
{assign var=id_customer_thread value=$tmp2.id_customer_thread} {assign var=id_customer_thread value=$tmp2.id_customer_thread}
{/if} {/if}
{/foreach} {/foreach}
<div class="blocSAV"> <div class="col-lg-3">
<h3>{$val.name}</h3>
<h3>{$val.name}</h3> {if $nb_categories < 6}
<p>{$val.description}</p>
{if $nb_categories < 6} {/if}
<p>{$val.description}</p> {if $total_thread == 0}
{/if} <span class="message-mail">{l s='No new messages'}</span>
{else}
{if $total_thread == 0} <a href="{$currentIndex}&token={$token}&id_customer_thread={$id_customer_thread}&viewcustomer_thread" class="button">
<span class="message-mail">{l s='No new messages'}</span> {$total_thread}
{else} {if $total_thread > 1}{l s='New messages'}{else}{l s='New message'}{/if}
<a href="{$currentIndex}&token={$token}&id_customer_thread={$id_customer_thread}&viewcustomer_thread" class="button"> </a>
{$total_thread} {/if}
{if $total_thread > 1}{l s='New messages'}{else}{l s='New message'}{/if}
</a>
{/if}
</div> </div>
{/foreach} {/foreach}
<div id="MeaningStatus" class="blocSAV"> <div id="MeaningStatus" class="col-lg-3">
<h3>&nbsp;{l s='Meaning of status'}</h3> <h3>{l s='Meaning of status'}</h3>
<ul> <ul>
<li><img src="../img/admin/status_green.png" alt="{l s='Open'}">{l s='Open'}</li> <li class="label label-success">{l s='Open'}</li>
<li><img src="../img/admin/status_red.png" alt="{l s='Closed'}">{l s='Closed'}</li> <li class="label label-danger">{l s='Closed'}</li>
<li><img src="../img/admin/status_orange.png" alt="{l s='Pending 1'}">{l s='Pending 1'}</li> <li class="label label-warning">{l s='Pending 1'}</li>
<li><img src="../img/admin/status_orange.png" alt="{l s='Pending 2'}">{l s='Pending 2'}</li> <li class="label label-warning">{l s='Pending 2'}</li>
</ul> </ul>
</div> </div>
<div id="CustomerService"> <div id="CustomerService" class="col-lg-3">
<table ccellspacing="0" cellpadding="0" class="table"> <h3>{l s='Statistics'}</h3>
<thead> <ul>
<tr> {assign var=count value=0}
<th colspan="2">{l s='Customer service'} : {l s='Statistics'}</th> {foreach $params as $key => $val}
</tr> {assign var=count value=$count+1}
</thead> <li>{$key} <span class="badge">{$val}</span></li>
<tbody> {/foreach}
{assign var=count value=0} </ul>
{foreach $params as $key => $val}
{assign var=count value=$count+1}
<tr {if $count % 2 == 0}class="alt_row"{/if}>
<td>{$key}</td>
<td><span>{$val}</span></td>
</tr>
{/foreach}
</tbody>
</table>
</div> </div>
</div> </div>
<hr/>
<p class="clear">&nbsp;</p>
{/block} {/block}
@@ -25,16 +25,18 @@
{extends file="helpers/options/options.tpl"} {extends file="helpers/options/options.tpl"}
{block name="after"} {block name="after"}
{if $use_sync} {if $use_sync}
<fieldset><legend>{l s='Sync'}</legend> <fieldset>
<legend>{l s='Sync'}</legend>
<label>{l s='Run sync:'}</label> <label>{l s='Run sync:'}</label>
<div class="margin-form"> <div class="margin-form">
<button class="button" id="run_sync" onclick="run_sync();">{l s='Run sync'}</button> <button class="btn" id="run_sync" onclick="run_sync();">{l s='Run sync'}</button>
<p>{l s='Click to synchronize mail automatically'}</p> <p>{l s='Click to synchronize mail automatically'}</p>
<div id="ajax_loader"></div> <div id="ajax_loader"></div>
<div class="error" style="display:none" id="ajax_error"></div> <div class="error" style="display:none" id="ajax_error"></div>
<div class="alert" style="display:none" id="ajax_conf"></div> <div class="alert" style="display:none" id="ajax_conf"></div>
</div> </div>
</fieldset><br/> </fieldset>
<script type="text/javascript"> <script type="text/javascript">
var ajaxQueries = new Array(); var ajaxQueries = new Array();
function run_sync() function run_sync()
@@ -39,9 +39,9 @@
</div> </div>
<p> <p>
<img src="../img/admin/email_go.png" alt="" style="vertical-align: middle;" /> <img src="../img/admin/email_go.png" alt="" />
{l s='Forward this discussion to an employee:'} {l s='Forward this discussion to an employee:'}
<select name="id_employee_forward" style="vertical-align: middle;"> <select name="id_employee_forward">
<option value="-1">{l s='-- Choose --'}</option> <option value="-1">{l s='-- Choose --'}</option>
{foreach $employees as $employee} {foreach $employees as $employee}
<option value="{$employee.id_employee}"> {Tools::substr($employee.firstname, 0, 1)}. {$employee.lastname}</option> <option value="{$employee.id_employee}"> {Tools::substr($employee.firstname, 0, 1)}. {$employee.lastname}</option>
@@ -61,16 +61,16 @@
</fieldset> </fieldset>
</form> </form>
<div class="clear">&nbsp;</div>
{if $thread->id_customer} {if $thread->id_customer}
<div style="float:right;margin-left:20px;"> <div>
{if $orders && count($orders)} {if $orders && count($orders)}
{if $count_ok} {if $count_ok}
<div> <div>
<h2>{l s='Orders'}</h2> <h2>{l s='Orders'}</h2>
<table cellspacing="0" cellpadding="0" class="table float"> <table class="table">
<tr> <tr>
<th class="center">{l s='ID'}</th> <th class="center">{l s='ID'}</th>
<th class="center">{l s='Date'}</th> <th class="center">{l s='Date'}</th>
@@ -136,7 +136,7 @@
</div> </div>
{/if} {/if}
<div style="margin-top:10px"> <div>
{foreach $messages as $message} {foreach $messages as $message}
{$message} {$message}
{/foreach} {/foreach}
@@ -28,7 +28,7 @@
<div class="leadin">{block name="leadin"}{/block}</div> <div class="leadin">{block name="leadin"}{/block}</div>
{/if} {/if}
{if isset($fields.title)}<legend>{$fields.title}</legend>{/if} {if isset($fields.title)}<h3>{$fields.title}</h3>{/if}
{block name="defaultForm"} {block name="defaultForm"}
<form id="{$table}_form" class="form-horizontal defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}> <form id="{$table}_form" class="form-horizontal defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
{if $form_id} {if $form_id}
@@ -38,11 +38,11 @@
<fieldset id="fieldset_{$f}" class="col-lg-12"> <fieldset id="fieldset_{$f}" class="col-lg-12">
{foreach $fieldset.form as $key => $field} {foreach $fieldset.form as $key => $field}
{if $key == 'legend'} {if $key == 'legend'}
<legend> <h3>
{if isset($field.image)}<img src="{$field.image}" alt="{$field.title|escape:'htmlall':'UTF-8'}" />{/if} {if isset($field.image)}<img src="{$field.image}" alt="{$field.title|escape:'htmlall':'UTF-8'}" />{/if}
{if isset($field.icon)}<i class="{$field.icon}"/></i>{/if} {if isset($field.icon)}<i class="{$field.icon}"/></i>{/if}
{$field.title} {$field.title}
</legend> </h3>
{elseif $key == 'description' && $field} {elseif $key == 'description' && $field}
<div class="alert alert-info">{$field}</div> <div class="alert alert-info">{$field}</div>
{elseif $key == 'input'} {elseif $key == 'input'}
@@ -229,18 +229,19 @@
{/if} {/if}
{elseif $input.type == 'radio'} {elseif $input.type == 'radio'}
{foreach $input.values as $value} {foreach $input.values as $value}
<input type="radio" name="{$input.name}"id="{$value.id}" value="{$value.value|escape:'htmlall':'UTF-8'}"
<label class="checkbox-inline" {if isset($input.class)}class="{$input.class}"{/if} for="{$value.id}">
<input type="radio" name="{$input.name}"id="{$value.id}" value="{$value.value|escape:'htmlall':'UTF-8'}"
{if $fields_value[$input.name] == $value.value}checked="checked"{/if} {if $fields_value[$input.name] == $value.value}checked="checked"{/if}
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} /> {if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
<label {if isset($input.class)}class="{$input.class}"{/if} for="{$value.id}"> {if isset($input.is_bool) && $input.is_bool == true}
{if isset($input.is_bool) && $input.is_bool == true} {if $value.value == 1}
{if $value.value == 1} <img src="../img/admin/enabled.gif" alt="{$value.label}" title="{$value.label}" />
<img src="../img/admin/enabled.gif" alt="{$value.label}" title="{$value.label}" /> {else}
{else} <img src="../img/admin/disabled.gif" alt="{$value.label}" title="{$value.label}" />
<img src="../img/admin/disabled.gif" alt="{$value.label}" title="{$value.label}" /> {/if}
{/if} {else}
{else} {$value.label}
{$value.label}
{/if} {/if}
</label> </label>
{if isset($input.br) && $input.br}<br />{/if} {if isset($input.br) && $input.br}<br />{/if}
@@ -43,10 +43,10 @@
{if isset($categoryData['top'])}{$categoryData['top']}{/if} {if isset($categoryData['top'])}{$categoryData['top']}{/if}
<fieldset {if isset($categoryData['class'])}class="{$categoryData['class']}"{/if} class="col-lg-12"> <fieldset {if isset($categoryData['class'])}class="{$categoryData['class']}"{/if} class="col-lg-12">
{* Options category title *} {* Options category title *}
<legend> <h3>
<i class="icon-cogs"></i> <i class="icon-cogs"></i>
{if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if} {if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if}
</legend> </h3>
{* Category description *} {* Category description *}
@@ -74,9 +74,9 @@
</div> </div>
{/if} {/if}
{block name="label"} {block name="label"}
{if isset($field['title']) && isset($field['desc'])} {if isset($field['title']) && isset($field['hint'])}
<label class="control-label col-lg-3"> <label class="control-label col-lg-3">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{$field['desc']}"> <span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{$field['hint']}">
{$field['title']} {$field['title']}
</span> </span>
</label> </label>
@@ -276,7 +276,7 @@
{if isset($field['required']) && $field['required'] && $field['type'] != 'radio'} {if isset($field['required']) && $field['required'] && $field['type'] != 'radio'}
<sup>*</sup> <sup>*</sup>
{/if} {/if}
{if isset($field['hint'])}<span class="alert alert-info" name="help_box">{$field['hint']}<span class="hint-pointer">&nbsp;</span></span>{/if}
{/block}{* end block input *} {/block}{* end block input *}
{if $field['is_invisible']} {if $field['is_invisible']}
<p class="alert alert-block"> <p class="alert alert-block">
@@ -28,6 +28,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->context = Context::getContext(); $this->context = Context::getContext();
$this->table = 'customer_thread'; $this->table = 'customer_thread';
$this->className = 'CustomerThread'; $this->className = 'CustomerThread';
@@ -57,23 +58,19 @@ class AdminCustomerThreadsControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_customer_thread' => array( 'id_customer_thread' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID')
'width' => 25,
), ),
'customer' => array( 'customer' => array(
'title' => $this->l('Customer'), 'title' => $this->l('Customer'),
'width' => 100,
'filter_key' => 'customer', 'filter_key' => 'customer',
'tmpTableFilter' => true, 'tmpTableFilter' => true,
), ),
'email' => array( 'email' => array(
'title' => $this->l('Email'), 'title' => $this->l('Email'),
'width' => 100,
'filter_key' => 'a!email', 'filter_key' => 'a!email',
), ),
'contact' => array( 'contact' => array(
'title' => $this->l('Type'), 'title' => $this->l('Type'),
'width' => 75,
'type' => 'select', 'type' => 'select',
'list' => $contact_array, 'list' => $contact_array,
'filter_key' => 'cl!id_contact', 'filter_key' => 'cl!id_contact',
@@ -81,7 +78,6 @@ class AdminCustomerThreadsControllerCore extends AdminController
), ),
'language' => array( 'language' => array(
'title' => $this->l('Language'), 'title' => $this->l('Language'),
'width' => 60,
'type' => 'select', 'type' => 'select',
'list' => $language_array, 'list' => $language_array,
'filter_key' => 'l!id_lang', 'filter_key' => 'l!id_lang',
@@ -89,7 +85,6 @@ class AdminCustomerThreadsControllerCore extends AdminController
), ),
'status' => array( 'status' => array(
'title' => $this->l('Status'), 'title' => $this->l('Status'),
'width' => 50,
'type' => 'select', 'type' => 'select',
'list' => $status_array, 'list' => $status_array,
'icon' => $images_array, 'icon' => $images_array,
@@ -99,20 +94,17 @@ class AdminCustomerThreadsControllerCore extends AdminController
), ),
'employee' => array( 'employee' => array(
'title' => $this->l('Employee'), 'title' => $this->l('Employee'),
'width' => 100,
'filter_key' => 'employee', 'filter_key' => 'employee',
'tmpTableFilter' => true, 'tmpTableFilter' => true,
), ),
'messages' => array( 'messages' => array(
'title' => $this->l('Messages'), 'title' => $this->l('Messages'),
'width' => 50,
'filter_key' => 'messages', 'filter_key' => 'messages',
'tmpTableFilter' => true, 'tmpTableFilter' => true,
'maxlength' => 40, 'maxlength' => 40,
), ),
'date_upd' => array( 'date_upd' => array(
'title' => $this->l('Last message'), 'title' => $this->l('Last message'),
'width' => 90,
'havingFilter' => true, 'havingFilter' => true,
), ),
); );
@@ -132,16 +124,14 @@ class AdminCustomerThreadsControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array( 'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array(
'title' => $this->l('Allow file uploading'), 'title' => $this->l('Allow file uploading'),
'desc' => $this->l('Allow customers to upload files using the contact page.'), 'hint' => $this->l('Allow customers to upload files using the contact page.'),
'type' => 'bool' 'type' => 'bool'
), ),
'PS_CUSTOMER_SERVICE_SIGNATURE' => array( 'PS_CUSTOMER_SERVICE_SIGNATURE' => array(
'title' => $this->l('Default message'), 'title' => $this->l('Default message'),
'desc' => $this->l('Please fill out the message fields that appear by default when you answer a thread on the customer service page.'), 'hint' => $this->l('Please fill out the message fields that appear by default when you answer a thread on the customer service page.'),
'type' => 'textareaLang', 'type' => 'textareaLang',
'lang' => true, 'lang' => true
'rows' => 10,
'cols' => 40
) )
), ),
), ),
@@ -150,67 +140,64 @@ class AdminCustomerThreadsControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_SAV_IMAP_URL' => array( 'PS_SAV_IMAP_URL' => array(
'title' => $this->l('IMAP URL'), 'title' => $this->l('IMAP URL'),
'desc' => $this->l('URL for IMAP server (mail.server.com)'), 'hint' => $this->l('URL for IMAP server (mail.server.com)'),
'type' => 'text', 'type' => 'text'
'size' => 40,
), ),
'PS_SAV_IMAP_PORT' => array( 'PS_SAV_IMAP_PORT' => array(
'title' => $this->l('IMAP port'), 'title' => $this->l('IMAP port'),
'desc' => $this->l('Port to use to connect to IMAP server'), 'hint' => $this->l('Port to use to connect to IMAP server'),
'type' => 'text', 'type' => 'text',
'defaultValue' => 143, 'defaultValue' => 143,
), ),
'PS_SAV_IMAP_USER' => array( 'PS_SAV_IMAP_USER' => array(
'title' => $this->l('IMAP user'), 'title' => $this->l('IMAP user'),
'desc' => $this->l('User to use to connect to IMAP server'), 'hint' => $this->l('User to use to connect to IMAP server'),
'type' => 'text', 'type' => 'text'
'size' => 40,
), ),
'PS_SAV_IMAP_PWD' => array( 'PS_SAV_IMAP_PWD' => array(
'title' => $this->l('IMAP password'), 'title' => $this->l('IMAP password'),
'desc' => $this->l('Password used to connect IMAP server'), 'hint' => $this->l('Password used to connect IMAP server'),
'type' => 'text', 'type' => 'text'
'size' => 40,
), ),
'PS_SAV_IMAP_DELETE_MSG' => array( 'PS_SAV_IMAP_DELETE_MSG' => array(
'title' => $this->l('Delete messages'), 'title' => $this->l('Delete messages'),
'desc' => $this->l('Delete messages after sync. If you do not active this option, the sync will take more time.'), 'hint' => $this->l('Delete messages after sync. If you do not active this option, the sync will take more time.'),
'type' => 'bool', 'type' => 'bool',
), ),
'PS_SAV_IMAP_CREATE_THREADS' => array( 'PS_SAV_IMAP_CREATE_THREADS' => array(
'title' => $this->l('Create new threads'), 'title' => $this->l('Create new threads'),
'desc' => $this->l('Create new threads for unrecognized emails'), 'hint' => $this->l('Create new threads for unrecognized emails'),
'type' => 'bool', 'type' => 'bool',
), ),
'PS_SAV_IMAP_OPT_NORSH' => array( 'PS_SAV_IMAP_OPT_NORSH' => array(
'title' => $this->l('IMAP options').' (/norsh)', 'title' => $this->l('IMAP options').' (/norsh)',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Do not use RSH or SSH to establish a preauthenticated IMAP sessions.'), 'hint' => $this->l('Do not use RSH or SSH to establish a preauthenticated IMAP sessions.'),
), ),
'PS_SAV_IMAP_OPT_SSL' => array( 'PS_SAV_IMAP_OPT_SSL' => array(
'title' => $this->l('IMAP options').' (/ssl)', 'title' => $this->l('IMAP options').' (/ssl)',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Use the Secure Socket Layer to encrypt the session.'), 'hint' => $this->l('Use the Secure Socket Layer to encrypt the session.'),
), ),
'PS_SAV_IMAP_OPT_VALIDATE-CERT' => array( 'PS_SAV_IMAP_OPT_VALIDATE-CERT' => array(
'title' => $this->l('IMAP options').' (/validate-cert)', 'title' => $this->l('IMAP options').' (/validate-cert)',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Validate certificates from the TLS/SSL server'), 'hint' => $this->l('Validate certificates from the TLS/SSL server'),
), ),
'PS_SAV_IMAP_OPT_NOVALIDATE-CERT' => array( 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT' => array(
'title' => $this->l('IMAP options').' (/novalidate-cert)', 'title' => $this->l('IMAP options').' (/novalidate-cert)',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Do not validate certificates from the TLS/SSL server. This is only needed if a server uses self-signed certificates'), 'hint' => $this->l('Do not validate certificates from the TLS/SSL server. This is only needed if a server uses self-signed certificates'),
), ),
'PS_SAV_IMAP_OPT_TLS' => array( 'PS_SAV_IMAP_OPT_TLS' => array(
'title' => $this->l('IMAP options').' (/tls)', 'title' => $this->l('IMAP options').' (/tls)',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it.'), 'hint' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it.'),
), ),
'PS_SAV_IMAP_OPT_NOTLS' => array( 'PS_SAV_IMAP_OPT_NOTLS' => array(
'title' => $this->l('IMAP options').' (/notls)', 'title' => $this->l('IMAP options').' (/notls)',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Do not use start-TLS to encrypt the session, even with servers that support it.'), 'hint' => $this->l('Do not use start-TLS to encrypt the session, even with servers that support it.'),
), ),
), ),
'submit' => array('title' => $this->l('Save'), 'class' => 'button'), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'),