zendesk - Version 1.1.4

Version Notes

Added autocomplete for customer details when creating a Zendesk ticket inside Magento.

Download this release

Release Info

Developer Jason Smale
Extension zendesk
Version 1.1.4
Comparing to
See all releases


Code changes from version 1.1.3 to 1.1.4

app/code/community/Zendesk/Zendesk/controllers/Adminhtml/ZendeskController.php CHANGED
@@ -51,6 +51,10 @@ class Zendesk_Zendesk_Adminhtml_ZendeskController extends Mage_Adminhtml_Control
51
}
52
}
53
54
public function authenticateAction()
55
{
56
if(!Mage::getStoreConfig('zendesk/sso/enabled')) {
@@ -105,6 +109,15 @@ class Zendesk_Zendesk_Adminhtml_ZendeskController extends Mage_Adminhtml_Control
105
$this->_title($this->__('Zendesk Create Ticket'));
106
$this->loadLayout();
107
$this->_setActiveMenu('zendesk/zendesk_create');
108
$this->renderLayout();
109
}
110
@@ -233,4 +246,30 @@ class Zendesk_Zendesk_Adminhtml_ZendeskController extends Mage_Adminhtml_Control
233
234
$this->_redirect('adminhtml/system_config/edit/section/zendesk');
235
}
236
}
51
}
52
}
53
54
+ /**
55
+ * Used by the Zendesk single sign on functionality to authenticate users.
56
+ * Currently only works for admin panel users, not for customers.
57
+ */
58
public function authenticateAction()
59
{
60
if(!Mage::getStoreConfig('zendesk/sso/enabled')) {
109
$this->_title($this->__('Zendesk Create Ticket'));
110
$this->loadLayout();
111
$this->_setActiveMenu('zendesk/zendesk_create');
112
+
113
+ // Add the custom JavaScript for the customer autocomplete
114
+ $block = $this->getLayout()->createBlock(
115
+ 'Mage_Core_Block_Template',
116
+ 'customer_email_autocomplete',
117
+ array('template' => 'zendesk/autocomplete.phtml')
118
+ );
119
+ $this->getLayout()->getBlock('js')->append($block);
120
+
121
$this->renderLayout();
122
}
123
246
247
$this->_redirect('adminhtml/system_config/edit/section/zendesk');
248
}
249
+
250
+ /*
251
+ * Sends back an HTML unordered list for use in the Scriptaculous Autcomplete call.
252
+ */
253
+ public function autocompleteAction()
254
+ {
255
+ $query = $this->getRequest()->getParam('requester');
256
+
257
+ $customers = Mage::getModel('customer/customer')
258
+ ->getCollection()
259
+ ->addNameToSelect()
260
+ ->addFieldToFilter('email', array('like' => '%' . $query . '%'));
261
+
262
+ $output = '<ul>';
263
+ if($customers->getSize()) {
264
+ foreach($customers as $customer) {
265
+ $id = $customer->getId();
266
+ $name = $customer->getName();
267
+ $email = $customer->getEmail();
268
+ $output .= '<li id="customer-' . $id . '" data-email="' . $email . '" data-name="' . $name . '">' . $name . ' &lt;' . $email . '&gt;</li>';
269
+ }
270
+ }
271
+ $output .= '</ul>';
272
+
273
+ $this->getResponse()->setBody($output);
274
+ }
275
}
app/code/community/Zendesk/Zendesk/etc/config.xml CHANGED
@@ -19,7 +19,7 @@
19
<config>
20
<modules>
21
<Zendesk_Zendesk>
22
- <version>1.1.3</version>
23
</Zendesk_Zendesk>
24
</modules>
25
<zendesk>
19
<config>
20
<modules>
21
<Zendesk_Zendesk>
22
+ <version>1.1.4</version>
23
</Zendesk_Zendesk>
24
</modules>
25
<zendesk>
app/design/adminhtml/default/default/template/zendesk/autocomplete.phtml ADDED
@@ -0,0 +1,39 @@
1
+ <style type="text/css">
2
+ div.autocomplete {
3
+ position:absolute;
4
+ width:250px;
5
+ background-color:white;
6
+ border:1px solid #888;
7
+ margin:0;
8
+ padding:0;
9
+ }
10
+ div.autocomplete ul {
11
+ list-style-type:none;
12
+ margin:0;
13
+ padding:0;
14
+ }
15
+ div.autocomplete ul li.selected {
16
+ background-color: #ffb;
17
+ }
18
+ div.autocomplete ul li {
19
+ list-style-type:none;
20
+ display:block;
21
+ margin:0;
22
+ padding:2px;
23
+ cursor:pointer;
24
+ }
25
+ </style>
26
+ <script type="text/javascript">
27
+ function updateRequester(text, item) {
28
+ $('requester').value = item.dataset.email;
29
+ $('requester_name').value = item.dataset.name;
30
+ }
31
+
32
+ var autocomplete_requester = new Element("div", { id: "autocomplete_requester", class: "autocomplete" });
33
+ $("requester").parentNode.appendChild(autocomplete_requester);
34
+
35
+ var completer = new Ajax.Autocompleter("requester", "autocomplete_requester", "<?php echo $this->getUrl('*/*/autocomplete'); ?>", {
36
+ afterUpdateElement: updateRequester,
37
+ minChars: 3
38
+ });
39
+ </script>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>zendesk</name>
4
- <version>1.1.3</version>
5
<stability>stable</stability>
6
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Software License v2</license>
7
<channel>community</channel>
@@ -17,25 +17,11 @@ This extension makes Zendesk work seamlessly with Magento to enable stores to de
17
- Display relevant support tickets on order &amp; customer dashboards&lt;br /&gt;&#xD;
18
- Create support tickets from Contact Us requests&lt;br /&gt;&#xD;
19
- Easily add a feedback tab to your site</description>
20
- <notes>Added support for 11 languages:&#xD;
21
- - German&#xD;
22
- - Spanish&#xD;
23
- - French&#xD;
24
- - Italian&#xD;
25
- - Japanese&#xD;
26
- - Korean&#xD;
27
- - Nederlands (Dutch)&#xD;
28
- - Portuguese (Brasil)&#xD;
29
- - Russian&#xD;
30
- - Traditional Chinese&#xD;
31
- - Simplified Chinese&#xD;
32
- &#xD;
33
- &#xD;
34
- </notes>
35
<authors><author><name>Jason Smale</name><user>zendesk</user><email>jsmale@zendesk.com</email></author><author><name>Fontis</name><user>fontis</user><email>magento@fontis.com.au</email></author></authors>
36
- <date>2012-11-30</date>
37
- <time>04:30:15</time>
38
- <contents><target name="mageetc"><dir name="modules"><file name="Zendesk_Zendesk.xml" hash="a630cf18c788dafb70d4c156a33eaa07"/></dir></target><target name="magecommunity"><dir name="Zendesk"><dir name="Zendesk"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Buttons"><file name="Generate.php" hash="7fa35e3e71b4bfb94f2dceddb19e86a0"/><file name="Signup.php" hash="f0d9ec9bc9a99f8643f1c2e6ac9989f2"/></dir><file name="Link.php" hash="779827427e11db311b6e1de9d42818f2"/></dir><dir name="Create"><dir name="Edit"><file name="Form.php" hash="fce297c645bb4bcc5433f317500aff96"/></dir><file name="Edit.php" hash="43aaf990ffaf4fd2ef0f65bbbbc19935"/></dir><dir name="Dashboard"><file name="Grids.php" hash="5b733e8b0f1e9c555619ff37f909bc00"/><dir name="Tab"><file name="View.php" hash="7d98b1f871626a4e783a9dd82bb4ea24"/></dir></dir><file name="Dashboard.php" hash="cd58a68d5a8cb2f3814426598ef016c3"/><file name="Menu.php" hash="c6000d5c571de25414f67dc8f49d97a0"/><dir name="Order"><dir name="View"><file name="Tickets.php" hash="a83a2ad42801ddbddad2d761779a597b"/></dir><file name="View.php" hash="db944df25b671288ad9e04d699653a19"/></dir></dir><file name="Supporttab.php" hash="4c5cbb2a18827045a3d0989ccb878733"/></dir><dir name="Helper"><file name="Data.php" hash="c1c7d21a04a472202d7e7639aa7837e5"/></dir><file name="LICENSE.txt" hash="d9922043f61f536de5d4d7af831e7f73"/><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="02c9893a6d4452988ea68629b2d64558"/><file name="Requesters.php" hash="24eeb10f3eb80c15915af3fd50506e38"/><file name="Tickets.php" hash="14e55044b0855b6159fff9daf222c6dd"/><file name="Users.php" hash="1ecfe4c536bb45ccc6046dbb3743712b"/><file name="Views.php" hash="3cf9eedc651389599a4fe5e5ecfbeebe"/></dir><file name="Observer.php" hash="a745f0ebef9f5a3f203914b55a7854b8"/><dir name="Source"><file name="Views.php" hash="1c7527338bf40082016a62e45fe44622"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ZendeskController.php" hash="799bdfaa5d51213913c057902a6ef390"/></dir><file name="ApiController.php" hash="65fdebea6b94b44344300308376722d2"/><file name="IndexController.php" hash="a9c590f951f294d3641c29bd98b6834c"/></dir><dir name="etc"><file name="config.xml" hash="45bcbf8c39141c1e44b1f11119b14927"/><file name="system.xml" hash="6e3e922965b5d713a1a1ef100401f28e"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Zendesk_Zendesk.csv" hash="7ca6957ec2ab86d7cad0da6d3db451d8"/></dir><dir name="de_DE"><file name="Zendesk_Zendesk.csv" hash="763c45870e912c2510cd5202cd844ee5"/></dir><dir name="es_ES"><file name="Zendesk_Zendesk.csv" hash="0602d8b70510f15784e1cca16cc2c41c"/></dir><dir name="fr_FR"><file name="Zendesk_Zendesk.csv" hash="f292cb30c7103dee6d47f808f82b3b6d"/></dir><dir name="it_IT"><file name="Zendesk_Zendesk.csv" hash="1dca15b2c95ac058a442fe764afb359c"/></dir><dir name="ja_JP"><file name="Zendesk_Zendesk.csv" hash="71de6c4043003e0cfc0ac8f03fb71a31"/></dir><dir name="ko_KR"><file name="Zendesk_Zendesk.csv" hash="f1ab32c6d8eb2e4486a7dbfb8d1e1abc"/></dir><dir name="nl_NL"><file name="Zendesk_Zendesk.csv" hash="bdda5f5ab107984487cbba1e1cb47c15"/></dir><dir name="pt_BR"><file name="Zendesk_Zendesk.csv" hash="8a1458f0e498706c7541851a9a32ed3c"/></dir><dir name="ru_RU"><file name="Zendesk_Zendesk.csv" hash="871fcc5befc62df4e93c3c36ca8dcc87"/></dir><dir name="zh_TW"><file name="Zendesk_Zendesk.csv" hash="486ee9e2eea24301299f73d9e745dc00"/></dir><dir name="zh_CN"><file name="Zendesk_Zendesk.csv" hash="414730c8365bd652b2a7934f948de9b2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="zendesk.xml" hash="d11620289479769a35c98b0676153906"/></dir><dir name="template"><dir name="zendesk"><dir name="config"><file name="button-generate.phtml" hash="21a25898c1fdea93d31b02ae91c1dd6f"/><file name="button-signup.phtml" hash="8871a0aa0bad7f85a7419853db8e0ce4"/><file name="link.phtml" hash="ce55d65900113183e770b2905a31b0eb"/></dir><dir name="customer"><file name="tickets.phtml" hash="e417ed76cee982be652dfe858822a26a"/></dir><dir name="dashboard"><file name="empty.phtml" hash="d0c30af25f17ff45215d210b48063a46"/><file name="index.phtml" hash="ac71050399d3789d2d4217472bc726cf"/><dir name="tabs"><file name="view.phtml" hash="b173979d7a295d8c4bcc5434b095c3be"/></dir></dir><file name="left-menu.phtml" hash="3147dca7821863ae6da3f7b650739780"/><dir name="order"><file name="tickets.phtml" hash="c12ae3af7d9591af53f7c6f910a9a438"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="zendesk.xml" hash="5aefda9b293f1a8c9384c9c98a4c70b2"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="zendesk"><file name="button.png" hash="58e62edb7f4be46e3b29c0bb774c7ad7"/><file name="icon.png" hash="b5bfce535c987d1e9e604823ac4b3943"/><file name="zendesk-tab.png" hash="0f322d15c392528c212d6491732bc133"/><file name="zendesk.css" hash="454aaabc787598a2ee2db5dd48f8ed96"/></dir></dir></dir></dir></target></contents>
39
<compatible/>
40
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
41
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>zendesk</name>
4
+ <version>1.1.4</version>
5
<stability>stable</stability>
6
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Software License v2</license>
7
<channel>community</channel>
17
- Display relevant support tickets on order &amp; customer dashboards&lt;br /&gt;&#xD;
18
- Create support tickets from Contact Us requests&lt;br /&gt;&#xD;
19
- Easily add a feedback tab to your site</description>
20
+ <notes>Added autocomplete for customer details when creating a Zendesk ticket inside Magento.</notes>
21
<authors><author><name>Jason Smale</name><user>zendesk</user><email>jsmale@zendesk.com</email></author><author><name>Fontis</name><user>fontis</user><email>magento@fontis.com.au</email></author></authors>
22
+ <date>2013-02-18</date>
23
+ <time>03:41:19</time>
24
+ <contents><target name="mageetc"><dir name="modules"><file name="Zendesk_Zendesk.xml" hash="a630cf18c788dafb70d4c156a33eaa07"/></dir></target><target name="magecommunity"><dir name="Zendesk"><dir name="Zendesk"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Buttons"><file name="Generate.php" hash="7fa35e3e71b4bfb94f2dceddb19e86a0"/><file name="Signup.php" hash="f0d9ec9bc9a99f8643f1c2e6ac9989f2"/></dir><file name="Link.php" hash="779827427e11db311b6e1de9d42818f2"/></dir><dir name="Create"><dir name="Edit"><file name="Form.php" hash="fce297c645bb4bcc5433f317500aff96"/></dir><file name="Edit.php" hash="43aaf990ffaf4fd2ef0f65bbbbc19935"/></dir><dir name="Dashboard"><file name="Grids.php" hash="5b733e8b0f1e9c555619ff37f909bc00"/><dir name="Tab"><file name="View.php" hash="7d98b1f871626a4e783a9dd82bb4ea24"/></dir></dir><file name="Dashboard.php" hash="cd58a68d5a8cb2f3814426598ef016c3"/><file name="Menu.php" hash="c6000d5c571de25414f67dc8f49d97a0"/><dir name="Order"><dir name="View"><file name="Tickets.php" hash="a83a2ad42801ddbddad2d761779a597b"/></dir><file name="View.php" hash="db944df25b671288ad9e04d699653a19"/></dir></dir><file name="Supporttab.php" hash="4c5cbb2a18827045a3d0989ccb878733"/></dir><dir name="Helper"><file name="Data.php" hash="c1c7d21a04a472202d7e7639aa7837e5"/></dir><file name="LICENSE.txt" hash="d9922043f61f536de5d4d7af831e7f73"/><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="02c9893a6d4452988ea68629b2d64558"/><file name="Requesters.php" hash="24eeb10f3eb80c15915af3fd50506e38"/><file name="Tickets.php" hash="14e55044b0855b6159fff9daf222c6dd"/><file name="Users.php" hash="1ecfe4c536bb45ccc6046dbb3743712b"/><file name="Views.php" hash="3cf9eedc651389599a4fe5e5ecfbeebe"/></dir><file name="Observer.php" hash="a745f0ebef9f5a3f203914b55a7854b8"/><dir name="Source"><file name="Views.php" hash="1c7527338bf40082016a62e45fe44622"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ZendeskController.php" hash="b3fec169806d0e9d452880b52ddf0ee1"/></dir><file name="ApiController.php" hash="65fdebea6b94b44344300308376722d2"/><file name="IndexController.php" hash="a9c590f951f294d3641c29bd98b6834c"/></dir><dir name="etc"><file name="config.xml" hash="0f87f087c731e767d3555ed6e0c69bbf"/><file name="system.xml" hash="6e3e922965b5d713a1a1ef100401f28e"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Zendesk_Zendesk.csv" hash="7ca6957ec2ab86d7cad0da6d3db451d8"/></dir><dir name="de_DE"><file name="Zendesk_Zendesk.csv" hash="763c45870e912c2510cd5202cd844ee5"/></dir><dir name="es_ES"><file name="Zendesk_Zendesk.csv" hash="0602d8b70510f15784e1cca16cc2c41c"/></dir><dir name="fr_FR"><file name="Zendesk_Zendesk.csv" hash="f292cb30c7103dee6d47f808f82b3b6d"/></dir><dir name="it_IT"><file name="Zendesk_Zendesk.csv" hash="1dca15b2c95ac058a442fe764afb359c"/></dir><dir name="ja_JP"><file name="Zendesk_Zendesk.csv" hash="71de6c4043003e0cfc0ac8f03fb71a31"/></dir><dir name="ko_KR"><file name="Zendesk_Zendesk.csv" hash="f1ab32c6d8eb2e4486a7dbfb8d1e1abc"/></dir><dir name="nl_NL"><file name="Zendesk_Zendesk.csv" hash="bdda5f5ab107984487cbba1e1cb47c15"/></dir><dir name="pt_BR"><file name="Zendesk_Zendesk.csv" hash="8a1458f0e498706c7541851a9a32ed3c"/></dir><dir name="ru_RU"><file name="Zendesk_Zendesk.csv" hash="871fcc5befc62df4e93c3c36ca8dcc87"/></dir><dir name="zh_TW"><file name="Zendesk_Zendesk.csv" hash="486ee9e2eea24301299f73d9e745dc00"/></dir><dir name="zh_CN"><file name="Zendesk_Zendesk.csv" hash="414730c8365bd652b2a7934f948de9b2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="zendesk.xml" hash="d11620289479769a35c98b0676153906"/></dir><dir name="template"><dir name="zendesk"><file name="autocomplete.phtml" hash="01f42e0bbe3337c058ebc0a8832ddca9"/><dir name="config"><file name="button-generate.phtml" hash="21a25898c1fdea93d31b02ae91c1dd6f"/><file name="button-signup.phtml" hash="8871a0aa0bad7f85a7419853db8e0ce4"/><file name="link.phtml" hash="ce55d65900113183e770b2905a31b0eb"/></dir><dir name="customer"><file name="tickets.phtml" hash="e417ed76cee982be652dfe858822a26a"/></dir><dir name="dashboard"><file name="empty.phtml" hash="d0c30af25f17ff45215d210b48063a46"/><file name="index.phtml" hash="ac71050399d3789d2d4217472bc726cf"/><dir name="tabs"><file name="view.phtml" hash="b173979d7a295d8c4bcc5434b095c3be"/></dir></dir><file name="left-menu.phtml" hash="3147dca7821863ae6da3f7b650739780"/><dir name="order"><file name="tickets.phtml" hash="c12ae3af7d9591af53f7c6f910a9a438"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="zendesk.xml" hash="5aefda9b293f1a8c9384c9c98a4c70b2"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="zendesk"><file name="button.png" hash="58e62edb7f4be46e3b29c0bb774c7ad7"/><file name="icon.png" hash="b5bfce535c987d1e9e604823ac4b3943"/><file name="zendesk-tab.png" hash="0f322d15c392528c212d6491732bc133"/><file name="zendesk.css" hash="454aaabc787598a2ee2db5dd48f8ed96"/></dir></dir></dir></dir></target></contents>
25
<compatible/>
26
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
27
</package>