From 70fc45a18d4af4d0bf2200399a69ec688fc3fc72 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Fri, 2 Dec 2011 11:19:03 +0000 Subject: [PATCH] // fix refactoring templates in AdminCustomerThreadsController --- .../template/customer_threads/list_header.tpl | 102 +++ .../template/customer_threads/message.tpl | 178 ++++ .../themes/template/customer_threads/view.tpl | 171 ++++ .../template/helper/list/list_header.tpl | 1 - classes/Contact.php | 45 +- classes/CustomerMessage.php | 55 +- classes/CustomerThread.php | 132 ++- classes/Employee.php | 13 + classes/order/Order.php | 13 + controllers/admin/AdminCartsController.php | 6 +- .../admin/AdminCustomerThreadsController.php | 847 ++++++++---------- css/admin.css | 95 +- img/admin/status_green.gif | Bin 1295 -> 0 bytes img/admin/status_green.png | Bin 0 -> 740 bytes img/admin/status_orange.gif | Bin 1396 -> 0 bytes img/admin/status_orange.png | Bin 0 -> 754 bytes img/admin/status_red.gif | Bin 1396 -> 0 bytes img/admin/status_red.png | Bin 0 -> 779 bytes 18 files changed, 1138 insertions(+), 520 deletions(-) create mode 100644 admin-dev/themes/template/customer_threads/list_header.tpl create mode 100644 admin-dev/themes/template/customer_threads/message.tpl create mode 100644 admin-dev/themes/template/customer_threads/view.tpl delete mode 100644 img/admin/status_green.gif create mode 100644 img/admin/status_green.png delete mode 100644 img/admin/status_orange.gif create mode 100644 img/admin/status_orange.png delete mode 100644 img/admin/status_red.gif create mode 100644 img/admin/status_red.png diff --git a/admin-dev/themes/template/customer_threads/list_header.tpl b/admin-dev/themes/template/customer_threads/list_header.tpl new file mode 100644 index 000000000..7aeeaf56d --- /dev/null +++ b/admin-dev/themes/template/customer_threads/list_header.tpl @@ -0,0 +1,102 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9639 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{extends file="helper/list/list_header.tpl"} + +{block name="override_header"} + +
+ + {assign var=nb_categories value=count($categories)} + + {foreach $categories as $key => $val} + + {assign var=total_thread value=0} + {assign var=id_customer_thread value=0} + + {foreach $contacts as $tmp => $tmp2} + {if $val.id_contact == $tmp2.id_contact} + + {assign var=total_thread value=$tmp2.total} + {assign var=id_customer_thread value=$tmp2.id_customer_thread} + + {/if} + {/foreach} + +
+ +

 {$val.name}

+ + {if $nb_categories < 6} +

{$val.description}

+ {/if} + + {if $total_thread == 0} +

{l s='No new message'}

+ {else} + + {$total_thread} + {if $total_thread > 1}{l s='new messages'}{else}{l s='new message'}{/if} + + {/if} +
+ {/foreach} + +
+

 {l s='Meaning of status'}

+
    +
  • {l s='Open'}{l s='Open'}
  • +
  • {l s='Closed'}{l s='Closed'}
  • +
  • {l s='Pending 1'}{l s='Pending 1'}
  • +
  • {l s='Pending 2'}{l s='Pending 2'}
  • +
+
+ +
+ + + + + + + + {assign var=count value=0} + {foreach $params as $key => $val} + {assign var=count value=$count+1} + + + + + {/foreach} + +
{l s='Customer service'} : {l s='Statistics'}
{$key}{$val}
+
+ +
+ +

 

+ +{/block} \ No newline at end of file diff --git a/admin-dev/themes/template/customer_threads/message.tpl b/admin-dev/themes/template/customer_threads/message.tpl new file mode 100644 index 000000000..6748fb659 --- /dev/null +++ b/admin-dev/themes/template/customer_threads/message.tpl @@ -0,0 +1,178 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8897 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{if !$email} + +
+ + {if !empty($message.employee_name)} + {$PS_SHOP_NAME} + {$PS_SHOP_NAME} - {$message.employee_name} + {else} + {$PS_SHOP_NAME} + {if !empty($message.id_customer)} + + {$message.customer_name} + + {else} + {$message.email} + {/if} + {/if} + + +
+ {if !empty($message.id_customer) && empty($message.employee_name)} + {l s='Customer ID:'} + + {$message.id_customer} {l s='view'} +
+ {/if} + + {l s='Sent on:'} {$message.date_add}
+ {if empty($message.employee_name)} + {l s='Browser:'} {$message.user_agent}
+ {/if} + + {if !empty($message.file_name) && $file_name} + {l s='File attachment'} + + {l s='view'} +
+ {/if} + + {if !empty($message.id_order) && empty($message.employee_name)} + {l s='Order #'} + + {$message.id_order} {l s='view'} +
+ {/if} + + {if !empty($message.id_product) && empty($message.employee_name)} + {l s='Product #'} + + {$message.id_product} {l s='view'} +
+ {/if} +
+ +
+ {l s='Subject:'} + + +
+ +{else} + +
+ {if $id_employee} + '. + {l s='View this thread'} +
+ {/if} + {l s='Sent by:'} + + {if !empty($message.customer_name)} + {$message.customer_name} ({$message.email}) + {else} + {$message.email} + {/if} + + {if !empty($message.id_customer) && empty($message.employee_name)} +
{l s='Customer ID:'} {$message.id_customer}
+ {/if} + + {if !empty($message.id_order) && empty($message.employee_name)} +
{l s='Order #'}: {$message.id_order}
+ {/if} + + {if !empty($message.id_product) && empty($message.employee_name)} +
{l s='Product #'}: {$message.id_product}
+ {/if} + +
{l s='Subject:'} {$message.subject} + +{/if} +

+ {l s='Thread ID:'} {$message.id_customer_thread}
+ {l s='Message ID:'} {$message.id_customer_message}
+ {l s='Message:'}
+ {$message.message} +
+ + +{if !$email} + + {if empty($message.employee_name)} + +

+ +

+ + {/if} + +
+ +{/if} + + + + + + + + \ No newline at end of file diff --git a/admin-dev/themes/template/customer_threads/view.tpl b/admin-dev/themes/template/customer_threads/view.tpl new file mode 100644 index 000000000..0592c9d02 --- /dev/null +++ b/admin-dev/themes/template/customer_threads/view.tpl @@ -0,0 +1,171 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8897 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{extends file="helper/view/view.tpl"} + +{block name="override_tpl"} +
+
+ +
+ +
+ +

+ + {l s='Forward this discussion to an employee:'} + +

+ + + + + +
+
+
 
+ + {if $thread->id_customer} + +
+ {if $orders && count($orders)} + {if $count_ok} +
+

{l s='Orders'}

+ + + + + + + + + + + {assign var=irow value=0} + {foreach $orders_ok as $order} + + + + + + + + + + {/foreach} +
{l s='ID'}{l s='Date'}{l s='Products'}{l s='Total paid'}{l s='Payment'}{l s='State'}{l s='Actions'}
{$order.id_order}{$order.date_add}{$order.nb_products}{$order.total_paid_real}{$order.payment}{$order.order_state} + + + +
+

+ {l s='Validated Orders:'} {$count_ok} {l s='for'} {$total_ok} +

+
+ {/if} + {/if} + {if $products && count($products)} +
+

{l s='Products'}

+ + + + + + + + + {assign var=irow value=0} + {foreach $products as $product} + + + + + + + + {/foreach} +
{l s='Date'}{l s='ID'}{l s='Name'}{l s='Quantity'}{l s='Actions'}
{$product.date_add}{$product.product_id}{$product.product_name}{$product.product_quantity} + + + +
+
+ {/if} +
+ {/if} + +
+ {foreach $messages as $message} + {$message} + {/foreach} +
+
 
+ + + + + +{/block} + diff --git a/admin-dev/themes/template/helper/list/list_header.tpl b/admin-dev/themes/template/helper/list/list_header.tpl index 2d5a9c0b8..0079d85d8 100644 --- a/admin-dev/themes/template/helper/list/list_header.tpl +++ b/admin-dev/themes/template/helper/list/list_header.tpl @@ -25,7 +25,6 @@ *} {if !$simple_header} -