Version Notes
Possibility of deleting tickets in BO added
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | Order_tickets |
| Version | 1.2.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.2 to 1.2.0
- app/code/community/Laurent/OrderTickets/Block/Adminhtml/Chat/View.php +5 -1
- app/code/community/Laurent/OrderTickets/controllers/Adminhtml/ChatController.php +97 -35
- app/code/community/Laurent/OrderTickets/etc/adminhtml.xml +3 -0
- app/code/community/Laurent/OrderTickets/etc/config.xml +1 -1
- app/design/adminhtml/default/default/template/ordertickets/chat/view/tab/tickets.phtml +68 -30
- app/locale/fr_FR/Laurent_OrderTickets.csv +11 -4
- package.xml +5 -5
app/code/community/Laurent/OrderTickets/Block/Adminhtml/Chat/View.php
CHANGED
|
@@ -21,7 +21,11 @@ class Laurent_OrderTickets_Block_Adminhtml_Chat_View extends Mage_Adminhtml_Bloc
|
|
| 21 |
$this->_blockGroup = 'ordertickets';
|
| 22 |
$this->_mode = 'view';
|
| 23 |
parent::__construct();
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
/**
|
| 21 |
$this->_blockGroup = 'ordertickets';
|
| 22 |
$this->_mode = 'view';
|
| 23 |
parent::__construct();
|
| 24 |
+
|
| 25 |
+
$userAllowedToDelete = Mage::getSingleton('admin/session')->isAllowed('sales/ordertickets/delete');
|
| 26 |
+
if(!$userAllowedToDelete){
|
| 27 |
+
$this->_removeButton('delete');
|
| 28 |
+
}
|
| 29 |
}
|
| 30 |
|
| 31 |
/**
|
app/code/community/Laurent/OrderTickets/controllers/Adminhtml/ChatController.php
CHANGED
|
@@ -13,44 +13,41 @@
|
|
| 13 |
*
|
| 14 |
*/
|
| 15 |
class Laurent_OrderTickets_Adminhtml_ChatController extends Laurent_OrderTickets_Controller_Adminhtml_Chat {
|
| 16 |
-
|
| 17 |
-
public function indexAction(){
|
| 18 |
-
$this->_baseTitle();
|
| 19 |
$this->_initAction();
|
| 20 |
$this->renderLayout();
|
| 21 |
}
|
| 22 |
-
|
| 23 |
/**
|
| 24 |
* Viewing an order chat
|
| 25 |
*/
|
| 26 |
-
public function viewAction(){
|
| 27 |
$chatId = $this->getRequest()->getParam('chat_id');
|
| 28 |
-
|
| 29 |
$chat = Mage::getModel('ordertickets/chat')->load($chatId);
|
| 30 |
/* @var $chat Laurent_OrderTickets_Model_Chat */
|
| 31 |
-
|
| 32 |
-
if($chat->getId()){
|
| 33 |
Mage::register('ordertickets_chat', $chat);
|
| 34 |
-
|
| 35 |
$this->_baseTitle();
|
| 36 |
$this->_title($this->__('Tickets for order %s', $chat->getOrder()->getIncrementId()));
|
| 37 |
$this->_initAction();
|
| 38 |
$this->renderLayout();
|
| 39 |
-
}
|
| 40 |
-
else{
|
| 41 |
Mage::getSingleton('core/session')->addError($this->__('This chat does not exist'));
|
| 42 |
$this->_redirect('*/*/index');
|
| 43 |
}
|
| 44 |
-
|
| 45 |
}
|
| 46 |
-
|
| 47 |
/**
|
| 48 |
* Save Chat
|
| 49 |
*
|
| 50 |
* @return bool
|
| 51 |
*/
|
| 52 |
-
public function saveAction()
|
| 53 |
-
{
|
| 54 |
if ($chatPost = $this->getRequest()->getPost()) {
|
| 55 |
$chatModel = Mage::getModel('ordertickets/chat')->setData($chatPost);
|
| 56 |
|
|
@@ -60,32 +57,31 @@ class Laurent_OrderTickets_Adminhtml_ChatController extends Laurent_OrderTickets
|
|
| 60 |
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Chat was succesfully saved'));
|
| 61 |
$this->getResponse()->setRedirect($this->getUrl("*/*/"));
|
| 62 |
return true;
|
| 63 |
-
}
|
| 64 |
-
catch (Exception $e) {
|
| 65 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 66 |
}
|
| 67 |
|
| 68 |
$this->_redirectReferer();
|
| 69 |
}
|
| 70 |
}
|
| 71 |
-
|
| 72 |
/**
|
| 73 |
* Action for saving an answer ticket
|
| 74 |
*/
|
| 75 |
-
public function answerPostAction(){
|
| 76 |
-
if($answerPost = $this->getRequest()->getPost('answer')){
|
| 77 |
-
|
| 78 |
-
if(isset($answerPost['chat_id'])){
|
| 79 |
$transaction = Mage::getModel('core/resource_transaction');
|
| 80 |
-
|
| 81 |
$chat = Mage::getModel('ordertickets/chat');
|
| 82 |
$chat->setId($answerPost['chat_id']);
|
| 83 |
$chat->setStatus($answerPost['status']);
|
| 84 |
$chat->setLastAnswerDate(now());
|
| 85 |
-
|
| 86 |
$transaction->addObject($chat);
|
| 87 |
-
|
| 88 |
-
if(isset($answerPost['message']) && $answerPost['message']){
|
| 89 |
$ticket = Mage::getModel('ordertickets/ticket');
|
| 90 |
$ticket->setChatId($answerPost['chat_id']);
|
| 91 |
$ticket->setMessage($answerPost['message']);
|
|
@@ -93,24 +89,89 @@ class Laurent_OrderTickets_Adminhtml_ChatController extends Laurent_OrderTickets
|
|
| 93 |
|
| 94 |
$transaction->addObject($ticket);
|
| 95 |
}
|
| 96 |
-
|
| 97 |
-
try{
|
| 98 |
$transaction->save();
|
| 99 |
-
|
| 100 |
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Answer successfully added'));
|
| 101 |
$this->getResponse()->setRedirect($this->getUrl("*/*/"));
|
| 102 |
return true;
|
| 103 |
-
}
|
| 104 |
-
catch(Exception $e){
|
| 105 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 106 |
}
|
| 107 |
-
|
| 108 |
$this->_redirectReferer();
|
| 109 |
}
|
| 110 |
}
|
| 111 |
}
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
$customerId = (int) $this->getRequest()->getParam('id');
|
| 115 |
$customer = Mage::getModel('customer/customer');
|
| 116 |
|
|
@@ -119,7 +180,8 @@ class Laurent_OrderTickets_Adminhtml_ChatController extends Laurent_OrderTickets
|
|
| 119 |
}
|
| 120 |
|
| 121 |
Mage::register('current_customer', $customer);
|
| 122 |
-
|
| 123 |
$this->getResponse()->setBody($this->getLayout()->createBlock('ordertickets/adminhtml_customer_edit_tab_tickets')->toHtml());
|
| 124 |
}
|
|
|
|
| 125 |
}
|
| 13 |
*
|
| 14 |
*/
|
| 15 |
class Laurent_OrderTickets_Adminhtml_ChatController extends Laurent_OrderTickets_Controller_Adminhtml_Chat {
|
| 16 |
+
|
| 17 |
+
public function indexAction() {
|
| 18 |
+
$this->_baseTitle();
|
| 19 |
$this->_initAction();
|
| 20 |
$this->renderLayout();
|
| 21 |
}
|
| 22 |
+
|
| 23 |
/**
|
| 24 |
* Viewing an order chat
|
| 25 |
*/
|
| 26 |
+
public function viewAction() {
|
| 27 |
$chatId = $this->getRequest()->getParam('chat_id');
|
| 28 |
+
|
| 29 |
$chat = Mage::getModel('ordertickets/chat')->load($chatId);
|
| 30 |
/* @var $chat Laurent_OrderTickets_Model_Chat */
|
| 31 |
+
|
| 32 |
+
if ($chat->getId()) {
|
| 33 |
Mage::register('ordertickets_chat', $chat);
|
| 34 |
+
|
| 35 |
$this->_baseTitle();
|
| 36 |
$this->_title($this->__('Tickets for order %s', $chat->getOrder()->getIncrementId()));
|
| 37 |
$this->_initAction();
|
| 38 |
$this->renderLayout();
|
| 39 |
+
} else {
|
|
|
|
| 40 |
Mage::getSingleton('core/session')->addError($this->__('This chat does not exist'));
|
| 41 |
$this->_redirect('*/*/index');
|
| 42 |
}
|
|
|
|
| 43 |
}
|
| 44 |
+
|
| 45 |
/**
|
| 46 |
* Save Chat
|
| 47 |
*
|
| 48 |
* @return bool
|
| 49 |
*/
|
| 50 |
+
public function saveAction() {
|
|
|
|
| 51 |
if ($chatPost = $this->getRequest()->getPost()) {
|
| 52 |
$chatModel = Mage::getModel('ordertickets/chat')->setData($chatPost);
|
| 53 |
|
| 57 |
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Chat was succesfully saved'));
|
| 58 |
$this->getResponse()->setRedirect($this->getUrl("*/*/"));
|
| 59 |
return true;
|
| 60 |
+
} catch (Exception $e) {
|
|
|
|
| 61 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 62 |
}
|
| 63 |
|
| 64 |
$this->_redirectReferer();
|
| 65 |
}
|
| 66 |
}
|
| 67 |
+
|
| 68 |
/**
|
| 69 |
* Action for saving an answer ticket
|
| 70 |
*/
|
| 71 |
+
public function answerPostAction() {
|
| 72 |
+
if ($answerPost = $this->getRequest()->getPost('answer')) {
|
| 73 |
+
|
| 74 |
+
if (isset($answerPost['chat_id'])) {
|
| 75 |
$transaction = Mage::getModel('core/resource_transaction');
|
| 76 |
+
|
| 77 |
$chat = Mage::getModel('ordertickets/chat');
|
| 78 |
$chat->setId($answerPost['chat_id']);
|
| 79 |
$chat->setStatus($answerPost['status']);
|
| 80 |
$chat->setLastAnswerDate(now());
|
| 81 |
+
|
| 82 |
$transaction->addObject($chat);
|
| 83 |
+
|
| 84 |
+
if (isset($answerPost['message']) && $answerPost['message']) {
|
| 85 |
$ticket = Mage::getModel('ordertickets/ticket');
|
| 86 |
$ticket->setChatId($answerPost['chat_id']);
|
| 87 |
$ticket->setMessage($answerPost['message']);
|
| 89 |
|
| 90 |
$transaction->addObject($ticket);
|
| 91 |
}
|
| 92 |
+
|
| 93 |
+
try {
|
| 94 |
$transaction->save();
|
| 95 |
+
|
| 96 |
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Answer successfully added'));
|
| 97 |
$this->getResponse()->setRedirect($this->getUrl("*/*/"));
|
| 98 |
return true;
|
| 99 |
+
} catch (Exception $e) {
|
|
|
|
| 100 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 101 |
}
|
| 102 |
+
|
| 103 |
$this->_redirectReferer();
|
| 104 |
}
|
| 105 |
}
|
| 106 |
}
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* Action for deleting a chat
|
| 110 |
+
* @return bool If chat was correctly deleted
|
| 111 |
+
*/
|
| 112 |
+
public function deleteAction() {
|
| 113 |
+
$session = Mage::getSingleton('adminhtml/session');
|
| 114 |
+
/* @var $session Mage_Adminhtml_Model_Session */
|
| 115 |
+
|
| 116 |
+
$chatId = $this->getRequest()->getParam('chat_id');
|
| 117 |
+
$chat = Mage::getModel('ordertickets/chat')->load($chatId);
|
| 118 |
+
/* @var $chat Laurent_OrderTickets_Model_Chat */
|
| 119 |
+
|
| 120 |
+
if ($chat->getId()) {
|
| 121 |
+
try {
|
| 122 |
+
$chat->delete();
|
| 123 |
+
} catch (Exception $e) {
|
| 124 |
+
$errorMsg = $this->__('Error while deleting chat: %s', $e->getMessage());
|
| 125 |
+
$session->addError($errorMsg);
|
| 126 |
+
$this->_redirect('*/*/index');
|
| 127 |
+
return false;
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
$successMsg = $this->__('Chat has been succesfully deleted');
|
| 132 |
+
$session->addSuccess($successMsg);
|
| 133 |
+
$this->_redirect('*/*/index');
|
| 134 |
+
return true;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* Action for deleting a ticket
|
| 139 |
+
* @return bool If ticket was correctly deleted
|
| 140 |
+
*/
|
| 141 |
+
public function deleteTicketAction() {
|
| 142 |
+
$userAllowedToDelete = Mage::getSingleton('admin/session')->isAllowed('sales/ordertickets/delete');
|
| 143 |
+
|
| 144 |
+
if(!$userAllowedToDelete){
|
| 145 |
+
$this->_forward('denied');
|
| 146 |
+
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
| 147 |
+
return false;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
$session = Mage::getSingleton('adminhtml/session');
|
| 151 |
+
/* @var $session Mage_Adminhtml_Model_Session */
|
| 152 |
+
|
| 153 |
+
$ticketId = $this->getRequest()->getParam('ticket_id');
|
| 154 |
+
$ticket = Mage::getModel('ordertickets/ticket')->load($ticketId);
|
| 155 |
+
/* @var $ticket Laurent_OrderTickets_Model_Ticket */
|
| 156 |
+
|
| 157 |
+
if ($ticket->getId()) {
|
| 158 |
+
try {
|
| 159 |
+
$ticket->delete();
|
| 160 |
+
} catch (Exception $e) {
|
| 161 |
+
$errorMsg = $this->__('Error while deleting ticket: %s', $e->getMessage());
|
| 162 |
+
$session->addError($errorMsg);
|
| 163 |
+
$this->_redirectReferer();
|
| 164 |
+
return false;
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
$successMsg = $this->__('Ticket has been succesfully deleted');
|
| 169 |
+
$session->addSuccess($successMsg);
|
| 170 |
+
$this->_redirectReferer();
|
| 171 |
+
return true;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
public function customerchatsAction() {
|
| 175 |
$customerId = (int) $this->getRequest()->getParam('id');
|
| 176 |
$customer = Mage::getModel('customer/customer');
|
| 177 |
|
| 180 |
}
|
| 181 |
|
| 182 |
Mage::register('current_customer', $customer);
|
| 183 |
+
|
| 184 |
$this->getResponse()->setBody($this->getLayout()->createBlock('ordertickets/adminhtml_customer_edit_tab_tickets')->toHtml());
|
| 185 |
}
|
| 186 |
+
|
| 187 |
}
|
app/code/community/Laurent/OrderTickets/etc/adminhtml.xml
CHANGED
|
@@ -30,6 +30,9 @@
|
|
| 30 |
<create translate="title" module="ordertickets">
|
| 31 |
<title>Create</title>
|
| 32 |
</create>
|
|
|
|
|
|
|
|
|
|
| 33 |
</children>
|
| 34 |
</ordertickets>
|
| 35 |
</children>
|
| 30 |
<create translate="title" module="ordertickets">
|
| 31 |
<title>Create</title>
|
| 32 |
</create>
|
| 33 |
+
<delete translate="title" module="ordertickets">
|
| 34 |
+
<title>Delete</title>
|
| 35 |
+
</delete>
|
| 36 |
</children>
|
| 37 |
</ordertickets>
|
| 38 |
</children>
|
app/code/community/Laurent/OrderTickets/etc/config.xml
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<config>
|
| 10 |
<modules>
|
| 11 |
<Laurent_OrderTickets>
|
| 12 |
-
<version>1.
|
| 13 |
</Laurent_OrderTickets>
|
| 14 |
</modules>
|
| 15 |
<global>
|
| 9 |
<config>
|
| 10 |
<modules>
|
| 11 |
<Laurent_OrderTickets>
|
| 12 |
+
<version>1.2.0</version>
|
| 13 |
</Laurent_OrderTickets>
|
| 14 |
</modules>
|
| 15 |
<global>
|
app/design/adminhtml/default/default/template/ordertickets/chat/view/tab/tickets.phtml
CHANGED
|
@@ -1,22 +1,60 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
*/
|
| 5 |
?>
|
| 6 |
-
<?php foreach($this->getTickets() as $ticket): ?>
|
| 7 |
-
<div>
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
<?php endforeach; ?>
|
| 21 |
<div class="entry-edit">
|
| 22 |
<div class="entry-edit-head">
|
|
@@ -25,25 +63,25 @@
|
|
| 25 |
<div class="fieldset fieldset-wide">
|
| 26 |
<table cellspacing="0" class="form-list">
|
| 27 |
<tr>
|
| 28 |
-
<td class="label"><label for="message"><?php echo $this->__('Message')?></label></td>
|
| 29 |
<td class="value"><textarea name="answer[message]" id="message"></textarea></td>
|
| 30 |
</tr>
|
| 31 |
<tr>
|
| 32 |
-
<td class="label"><label for="status"><?php echo $this->__('Status')?></label></td>
|
| 33 |
<td class="value">
|
| 34 |
<select name="answer[status]" id="status">
|
| 35 |
-
<?php foreach(Mage::helper('ordertickets')->getChatStatuses() as $statusKey => $statusLabel)
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
<?php endforeach
|
| 40 |
</select>
|
| 41 |
</td>
|
| 42 |
</tr>
|
| 43 |
<tr>
|
| 44 |
<td class="label"></td>
|
| 45 |
<td class="value f-right">
|
| 46 |
-
<input type="hidden" name="answer[chat_id]" value="<?php echo $this->getChat()->getId()?>" />
|
| 47 |
<button onclick="postAnswer();" class="form-button" type="submit"><span><?php echo $this->__('Send') ?></span></button>
|
| 48 |
</td>
|
| 49 |
</tr>
|
|
@@ -52,10 +90,10 @@
|
|
| 52 |
</div>
|
| 53 |
|
| 54 |
<script type="text/javascript">
|
| 55 |
-
function postAnswer()
|
| 56 |
-
{
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
}
|
| 61 |
</script>
|
| 1 |
<?php
|
| 2 |
+
/*
|
| 3 |
+
* @category Laurent
|
| 4 |
+
* @package Laurent_OrderTickets
|
| 5 |
+
* @copyright Copyright (c) 2011 Laurent Clouet
|
| 6 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 7 |
+
* @author Laurent Clouet <laurent35240@gmail.com>
|
| 8 |
+
*
|
| 9 |
+
* @var $this Laurent_OrderTickets_Block_Adminhtml_Chat_View_Tab_Tickets
|
| 10 |
*/
|
| 11 |
?>
|
| 12 |
+
<?php foreach ($this->getTickets() as $ticket): ?>
|
| 13 |
+
<div class="entry-edit">
|
| 14 |
+
<div class="entry-edit-head">
|
| 15 |
+
<h4>
|
| 16 |
+
<?php if ($ticket->isRequest()): ?>
|
| 17 |
+
<?php echo $this->__('Message from %s', $this->getChat()->getCustomerFirstname() . ' ' . $this->getChat()->getCustomerLastname()) ?>
|
| 18 |
+
<?php else: ?>
|
| 19 |
+
<?php echo $this->__('Answer') ?>
|
| 20 |
+
<?php endif; ?>
|
| 21 |
+
</h4>
|
| 22 |
+
<?php if(Mage::getSingleton('admin/session')->isAllowed('sales/ordertickets/delete')): ?>
|
| 23 |
+
<div class="tools">
|
| 24 |
+
<a href="<?php echo $this->getUrl('*/*/deleteTicket', array('ticket_id' => $ticket->getId())) ?>"
|
| 25 |
+
onclick="return confirm('<?php echo $this->__('Are you sure you want to delete this ticket?') ?>');">
|
| 26 |
+
<?php echo $this->__('Delete') ?>
|
| 27 |
+
</a>
|
| 28 |
+
</div>
|
| 29 |
+
<?php endif; ?>
|
| 30 |
+
</div>
|
| 31 |
+
<div class="fieldset fieldset-wide">
|
| 32 |
+
<table cellspacing="0" class="form-list">
|
| 33 |
+
<tbody>
|
| 34 |
+
<tr>
|
| 35 |
+
<td class="label">
|
| 36 |
+
<label>
|
| 37 |
+
<?php echo $this->__('Send the') ?>
|
| 38 |
+
</label>
|
| 39 |
+
</td>
|
| 40 |
+
<td class="value">
|
| 41 |
+
<?php echo Mage::helper('core')->formatDate($ticket->getCreatedAt(), 'full', true) ?>
|
| 42 |
+
</td>
|
| 43 |
+
</tr>
|
| 44 |
+
<tr>
|
| 45 |
+
<td class="label">
|
| 46 |
+
<label>
|
| 47 |
+
<?php echo $this->__('Message') ?>
|
| 48 |
+
</label>
|
| 49 |
+
</td>
|
| 50 |
+
<td class="value">
|
| 51 |
+
<?php echo nl2br(htmlspecialchars($ticket->getMessage())) ?>
|
| 52 |
+
</td>
|
| 53 |
+
</tr>
|
| 54 |
+
</tbody>
|
| 55 |
+
</table>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
<?php endforeach; ?>
|
| 59 |
<div class="entry-edit">
|
| 60 |
<div class="entry-edit-head">
|
| 63 |
<div class="fieldset fieldset-wide">
|
| 64 |
<table cellspacing="0" class="form-list">
|
| 65 |
<tr>
|
| 66 |
+
<td class="label"><label for="message"><?php echo $this->__('Message') ?></label></td>
|
| 67 |
<td class="value"><textarea name="answer[message]" id="message"></textarea></td>
|
| 68 |
</tr>
|
| 69 |
<tr>
|
| 70 |
+
<td class="label"><label for="status"><?php echo $this->__('Status') ?></label></td>
|
| 71 |
<td class="value">
|
| 72 |
<select name="answer[status]" id="status">
|
| 73 |
+
<?php foreach (Mage::helper('ordertickets')->getChatStatuses() as $statusKey => $statusLabel): ?>
|
| 74 |
+
<option value="<?php echo $statusKey ?>" <?php if ($statusKey == $this->getChat()->getStatus()): ?>selected="selected"<?php endif; ?>>
|
| 75 |
+
<?php echo $statusLabel ?>
|
| 76 |
+
</option>
|
| 77 |
+
<?php endforeach; ?>
|
| 78 |
</select>
|
| 79 |
</td>
|
| 80 |
</tr>
|
| 81 |
<tr>
|
| 82 |
<td class="label"></td>
|
| 83 |
<td class="value f-right">
|
| 84 |
+
<input type="hidden" name="answer[chat_id]" value="<?php echo $this->getChat()->getId() ?>" />
|
| 85 |
<button onclick="postAnswer();" class="form-button" type="submit"><span><?php echo $this->__('Send') ?></span></button>
|
| 86 |
</td>
|
| 87 |
</tr>
|
| 90 |
</div>
|
| 91 |
|
| 92 |
<script type="text/javascript">
|
| 93 |
+
function postAnswer()
|
| 94 |
+
{
|
| 95 |
+
var form = document.getElementById("edit_form");
|
| 96 |
+
form.action = '<?php echo $this->getPostAnswerUrl() ?>';
|
| 97 |
+
form.submit();
|
| 98 |
+
}
|
| 99 |
</script>
|
app/locale/fr_FR/Laurent_OrderTickets.csv
CHANGED
|
@@ -2,11 +2,13 @@
|
|
| 2 |
"Add a message","Ajouter un message"
|
| 3 |
"Add an answer","Ajouter une réponse"
|
| 4 |
"Answer from %s send the","Réponse de %s envoyée le"
|
| 5 |
-
"Answer
|
| 6 |
"Answer successfully added","Votre réponse a bien été ajoutée"
|
|
|
|
| 7 |
"Back to My Orders","Retour à l'historique des commandes"
|
| 8 |
-
"Chat
|
| 9 |
-
"Chat
|
|
|
|
| 10 |
"Closed","Clôturé"
|
| 11 |
"Create","Création"
|
| 12 |
"Create new order tickets","Créer un ticket pour une commande"
|
|
@@ -19,8 +21,11 @@
|
|
| 19 |
"Customer firstname","Prénom du client"
|
| 20 |
"Customer lastname","Nom du client"
|
| 21 |
"Customer request","Demande du client"
|
|
|
|
| 22 |
"Details","Détails"
|
| 23 |
"Error while creating new order tickets: %s","Erreur lors de la création d'un nouveau ticket de commande : %s"
|
|
|
|
|
|
|
| 24 |
"Error while saving your message. Please try again","Erreur lors de l'enregistrement de votre message. Veuillez réessayer."
|
| 25 |
"Firstname","Prénom"
|
| 26 |
"General Information","Informations générales"
|
|
@@ -29,7 +34,7 @@
|
|
| 29 |
"Lastname","Nom"
|
| 30 |
"Message","Message"
|
| 31 |
"Message date","Date du message"
|
| 32 |
-
"Message from %s
|
| 33 |
"Messages","Messages"
|
| 34 |
"No order selected for creating new order tickets.","Aucune commande n'a été sélectionnée pour créer un nouveau ticket."
|
| 35 |
"Open","Ouvert"
|
|
@@ -42,6 +47,7 @@
|
|
| 42 |
"Pending answer","En attente de réponse"
|
| 43 |
"Please select an order","Veuillez sélectionner une commande"
|
| 44 |
"Send","Envoyer"
|
|
|
|
| 45 |
"Separate recipients with comma","Séparer les destinataires avec des virgules"
|
| 46 |
"Status","Statut"
|
| 47 |
"Store answer","Réponse du magasin"
|
|
@@ -50,6 +56,7 @@
|
|
| 50 |
"This chat does not exist","Cette discussion n'existe pas"
|
| 51 |
"Tickets already exist for this order. Please add new here.","Il existe déjà des tickets pour cette commande. Ajoutez les nouveaux ici."
|
| 52 |
"Tickets for order %s","Tickets de la commande %s"
|
|
|
|
| 53 |
"Ticket type","Type de ticket"
|
| 54 |
"Ticket has been correctly saved.","Le ticket a bien été enregistré."
|
| 55 |
"Your message send the","Votre message envoyé le"
|
| 2 |
"Add a message","Ajouter un message"
|
| 3 |
"Add an answer","Ajouter une réponse"
|
| 4 |
"Answer from %s send the","Réponse de %s envoyée le"
|
| 5 |
+
"Answer","Réponse"
|
| 6 |
"Answer successfully added","Votre réponse a bien été ajoutée"
|
| 7 |
+
"Are you sure you want to delete this ticket?","Êtes vous sûr(e) de vouloir supprimer ce ticket ?"
|
| 8 |
"Back to My Orders","Retour à l'historique des commandes"
|
| 9 |
+
"Chat has been succesfully deleted","Cette discussion a bien été supprimée"
|
| 10 |
+
"Chat Information","Informations sur la discussion"
|
| 11 |
+
"Chat was succesfully saved","La discussion a bien été enregistrée"
|
| 12 |
"Closed","Clôturé"
|
| 13 |
"Create","Création"
|
| 14 |
"Create new order tickets","Créer un ticket pour une commande"
|
| 21 |
"Customer firstname","Prénom du client"
|
| 22 |
"Customer lastname","Nom du client"
|
| 23 |
"Customer request","Demande du client"
|
| 24 |
+
"Delete","Suppression"
|
| 25 |
"Details","Détails"
|
| 26 |
"Error while creating new order tickets: %s","Erreur lors de la création d'un nouveau ticket de commande : %s"
|
| 27 |
+
"Error while deleting chat: %s","Erreur lors de la suppression de la discussion : %s"
|
| 28 |
+
"Error while deleting ticket: %s","Erreur lors de la suppression du ticket : %s"
|
| 29 |
"Error while saving your message. Please try again","Erreur lors de l'enregistrement de votre message. Veuillez réessayer."
|
| 30 |
"Firstname","Prénom"
|
| 31 |
"General Information","Informations générales"
|
| 34 |
"Lastname","Nom"
|
| 35 |
"Message","Message"
|
| 36 |
"Message date","Date du message"
|
| 37 |
+
"Message from %s","Message de %s"
|
| 38 |
"Messages","Messages"
|
| 39 |
"No order selected for creating new order tickets.","Aucune commande n'a été sélectionnée pour créer un nouveau ticket."
|
| 40 |
"Open","Ouvert"
|
| 47 |
"Pending answer","En attente de réponse"
|
| 48 |
"Please select an order","Veuillez sélectionner une commande"
|
| 49 |
"Send","Envoyer"
|
| 50 |
+
"Send the","Envoyé le"
|
| 51 |
"Separate recipients with comma","Séparer les destinataires avec des virgules"
|
| 52 |
"Status","Statut"
|
| 53 |
"Store answer","Réponse du magasin"
|
| 56 |
"This chat does not exist","Cette discussion n'existe pas"
|
| 57 |
"Tickets already exist for this order. Please add new here.","Il existe déjà des tickets pour cette commande. Ajoutez les nouveaux ici."
|
| 58 |
"Tickets for order %s","Tickets de la commande %s"
|
| 59 |
+
"Ticket has been succesfully deleted","Le ticket a bien été supprimé"
|
| 60 |
"Ticket type","Type de ticket"
|
| 61 |
"Ticket has been correctly saved.","Le ticket a bien été enregistré."
|
| 62 |
"Your message send the","Votre message envoyé le"
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Order_tickets</name>
|
| 4 |
-
<version>1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -11,11 +11,11 @@
|
|
| 11 |
- customer can add message to orders
|
| 12 |
- administrator can see these messages, reply to them, change status of a chat and create new messages
|
| 13 |
- a cron also exists to send a reminder email to administrator about new messages</description>
|
| 14 |
-
<notes>
|
| 15 |
<authors><author><name>Laurent Clouet</name><user>auto-converted</user><email>laurent35240@gmail.com</email></author></authors>
|
| 16 |
-
<date>2012-03-
|
| 17 |
-
<time>
|
| 18 |
-
<contents><target name="magecommunity"><dir name="Laurent"><dir name="OrderTickets"><dir name="Block"><dir name="Adminhtml"><dir name="Chat"><dir name="Create"><dir name="Order"><file name="Grid.php" hash="c7f1c769d398155bd346edb8fe76d6bf"/></dir><dir name="Steptwo"><file name="Form.php" hash="00359248809a4f067f8c488fda650712"/></dir><file name="Form.php" hash="521cca1147cbcecdf66d6e25e42e93d4"/><file name="Order.php" hash="4b5cbda78abda88f5858b1b389ef5b75"/><file name="Steptwo.php" hash="3a439f520e3469d0499ddf4443df674f"/></dir><dir name="View"><dir name="Tab"><file name="Main.php" hash="03c4041d1cf51152b81960301c1a7a09"/><file name="Tickets.php" hash="1113741720801f3101ba7eea34be9e0f"/></dir><file name="Form.php" hash="39fdb499109549c3f343c558016bbeba"/><file name="Tabs.php" hash="f8013ba3783ab56b81ddf85a9322f6eb"/></dir><file name="Create.php" hash="9d942043e00405babea776855b70f3a5"/><file name="Grid.php" hash="991c017b9bc30ea7d21abc37d5357d1f"/><file name="View.php" hash="
|
| 19 |
<compatible/>
|
| 20 |
<dependencies/>
|
| 21 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Order_tickets</name>
|
| 4 |
+
<version>1.2.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
| 11 |
- customer can add message to orders
|
| 12 |
- administrator can see these messages, reply to them, change status of a chat and create new messages
|
| 13 |
- a cron also exists to send a reminder email to administrator about new messages</description>
|
| 14 |
+
<notes>Possibility of deleting tickets in BO added</notes>
|
| 15 |
<authors><author><name>Laurent Clouet</name><user>auto-converted</user><email>laurent35240@gmail.com</email></author></authors>
|
| 16 |
+
<date>2012-03-10</date>
|
| 17 |
+
<time>14:00:31</time>
|
| 18 |
+
<contents><target name="magecommunity"><dir name="Laurent"><dir name="OrderTickets"><dir name="Block"><dir name="Adminhtml"><dir name="Chat"><dir name="Create"><dir name="Order"><file name="Grid.php" hash="c7f1c769d398155bd346edb8fe76d6bf"/></dir><dir name="Steptwo"><file name="Form.php" hash="00359248809a4f067f8c488fda650712"/></dir><file name="Form.php" hash="521cca1147cbcecdf66d6e25e42e93d4"/><file name="Order.php" hash="4b5cbda78abda88f5858b1b389ef5b75"/><file name="Steptwo.php" hash="3a439f520e3469d0499ddf4443df674f"/></dir><dir name="View"><dir name="Tab"><file name="Main.php" hash="03c4041d1cf51152b81960301c1a7a09"/><file name="Tickets.php" hash="1113741720801f3101ba7eea34be9e0f"/></dir><file name="Form.php" hash="39fdb499109549c3f343c558016bbeba"/><file name="Tabs.php" hash="f8013ba3783ab56b81ddf85a9322f6eb"/></dir><file name="Create.php" hash="9d942043e00405babea776855b70f3a5"/><file name="Grid.php" hash="991c017b9bc30ea7d21abc37d5357d1f"/><file name="View.php" hash="456751975ddd5022aec9d3dd86f6c393"/></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Tickets.php" hash="d784d0ff541dc941ccd1a3c421acddc9"/></dir></dir></dir><dir name="Order"><dir name="View"><dir name="Tab"><file name="Tickets.php" hash="20dfff77bead43724946ef6ee289ffb2"/></dir></dir></dir><file name="Chat.php" hash="e49c52f90f3ced6a00602c1125cffc44"/></dir><dir name="Order"><file name="Tabs.php" hash="33f15dfed00eca206271cef1f6d17f88"/></dir><file name="Chat.php" hash="ca64119de20bcdca3a8ea51447c83d55"/></dir><dir name="Controller"><dir name="Adminhtml"><file name="Chat.php" hash="43b419b5c2b5e6900051e6358153175d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="93cacb500a03173347d3136403be13b1"/></dir><dir name="Model"><dir name="Config"><file name="Cron.php" hash="71180552ddcaa52e340668255ed871a0"/></dir><dir name="Mysql4"><dir name="Chat"><file name="Collection.php" hash="3765532820c8272190ad6bd65a42594d"/></dir><dir name="Ticket"><file name="Collection.php" hash="c04b0fe47e291380a57dce1939425b95"/></dir><file name="Chat.php" hash="105edfaafa9109c87dfb509b641decdc"/><file name="Ticket.php" hash="f9f4e7f6e9da8c110d5042760fe1183e"/></dir><file name="Abstract.php" hash="1c3cebb3cdfbba03c4b21198e2412bd5"/><file name="Chat.php" hash="64ee63f9f7d636c24ba9bde51f7fa5d3"/><file name="Observer.php" hash="e8df8052d45030c5a0548aa1caccbd8b"/><file name="Ticket.php" hash="967e3fd66fd24b689a38f3e1970d5e98"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChatController.php" hash="074737a0f23108e91b9075bad9cad78b"/><file name="CreateController.php" hash="1b7772d9296c89460cdb7828be20ef3e"/></dir><file name="ChatController.php" hash="ee6c820a624dfb487b5c935fe109989c"/></dir><dir name="doc"><dir name="screeenshots"><file name="bo_order_tickets_tab.png" hash="ca1d6d13d53cc6a1c2af3c9b4bfa61a9"/><file name="bo_ticket_details.png" hash="7228ed41de8dfe0626bdcadbeae05f4b"/><file name="bo_ticket_tickets.png" hash="7491fb1b62a9352d1abe9bdbbd6bc845"/><file name="bo_tickets_grid.png" hash="1270d49ebe5bb6c93420ad8f7a9ba08f"/><file name="fo_tickets_on_order.png" hash="e8a7af6d00a3c19d8de4a66d022b2988"/></dir><file name="CREATE-IN-BO.txt" hash="020114172e426f95d7a1d733fcaaf49a"/><file name="EVOLUTIONS.txt" hash="f7916ea0d3d00122873970c678f026a6"/><file name="INSTALL.txt" hash="316098ba4cebfa621753e18d550880fe"/><file name="logo.png" hash="2a863ae353401ed20c679782b8e694bf"/><file name="logo.svg" hash="eb6d4bd165834e3fd308c421c6a6e9bd"/><file name="tables_scheme.graphml" hash="66b71ac524ad926ba5a4c110840f5b57"/><file name="tables_scheme.jpg" hash="c26b66b1381efa32c7140892e11932ba"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3deabb2e09a1ee2bf6ba7036a2722172"/><file name="config.xml" hash="023111869a8c96f7eb437d0e429ed72a"/><file name="system.xml" hash="37739c5007d90bdf7ee8cbe567e98b6a"/></dir><dir name="sql"><dir name="ordertickets_setup"><file name="mysql4-install-0.1.0.php" hash="eaf0ed1190d400612f7eda66b51a28df"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="a59e90142a8ba64c370f59699878a7e1"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ordertickets.xml" hash="f3802540ee8a0f81c288dcfc19c0a589"/></dir><dir name="template"><dir name="ordertickets"><dir name="chat"><dir name="create"><file name="abstract.phtml" hash="19cbea5ac678b9197b08c6d9e8f55880"/><file name="form.phtml" hash="5a45de144e3f0b6b52a2e2ee19450413"/></dir><dir name="view"><dir name="tab"><file name="tickets.phtml" hash="c9bdcaca76a70fd3c4a7bbcdf02fa3bf"/></dir></dir></dir><dir name="order"><dir name="view"><dir name="tab"><file name="tickets.phtml" hash="f3aa00997858afcf85373b8e0f1716db"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ordertickets.xml" hash="ff2e6b3a75dcf121fdc5a11bc320d46f"/></dir><dir name="template"><dir name="ordertickets"><dir name="order"><file name="tabs.phtml" hash="3a146acbd5ef5af0a7c939f60ee4c383"/></dir><file name="chat.phtml" hash="2c87d7b906dd80ebdfd86dcf2aadd755"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Laurent_OrderTickets.xml" hash="46fdc0a685ad8d9144f4db4cb99f97fe"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Laurent_OrderTickets.csv" hash="5cd05adbf7fb074b01ede590ce30a04e"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="ordertickets.css" hash="f009140fffa838b6b3a3bfe011cebaa2"/></dir></dir></dir></dir></target></contents>
|
| 19 |
<compatible/>
|
| 20 |
<dependencies/>
|
| 21 |
</package>
|
