ClickDesk_LiveChat_Support - Version 1.1.0

Version Notes

Clickdesk

Download this release

Release Info

Developer Jagan
Extension ClickDesk_LiveChat_Support
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

app/code/local/SoftwareTec/Clickdesk/Block/Status.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SoftwareTec_Clickdesk_Block_Status extends Mage_Core_Block_Template
4
+ {
5
+
6
+
7
+ protected function _toHtml()
8
+ {
9
+
10
+ $model = Mage::getModel('clickdesk/clickdesk');
11
+
12
+ $this->setWidgetId($model->getWidgetId());
13
+ return parent::_toHtml();
14
+ }
15
+
16
+
17
+
18
+
19
+
20
+
21
+ }
app/code/local/SoftwareTec/Clickdesk/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?PHP
2
+
3
+ class SoftwareTec_Clickdesk_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ }
app/code/local/SoftwareTec/Clickdesk/Model/Clickdesk.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SoftwareTec_Clickdesk_Model_Clickdesk extends Mage_Core_Model_Abstract
4
+ {
5
+
6
+ protected $_widgetid = '';
7
+
8
+ public function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->_init('clickdesk/clickdesk');
12
+ }
13
+
14
+ public function getWidgetId()
15
+ {
16
+
17
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
18
+ $result = $db->query("SELECT * FROM clickdesk LIMIT 1");
19
+ if($result) {
20
+
21
+ if($row = $result->fetch())
22
+ {
23
+ $this->_widgetid =$row["widgetid"];
24
+ return $row["widgetid"];
25
+ }
26
+ }
27
+ return "";
28
+
29
+ }
30
+
31
+ public function getWidgetCurl()
32
+ {
33
+
34
+ define('LIVILY_SERVER_URL', "http://wp-1.contactuswidget.appspot.com/");
35
+ define('LIVILY_DASHBOARD_URL', LIVILY_SERVER_URL.'widgets.jsp?wpurl=');
36
+
37
+
38
+ $Path="http://".$_SERVER['HTTP_HOST']."/".$_SERVER['REQUEST_URI'];
39
+
40
+
41
+
42
+ $Path = urlencode($Path);
43
+
44
+ $cdURL= LIVILY_DASHBOARD_URL;
45
+ return $cdURL;
46
+
47
+
48
+ }
49
+ }
app/code/local/SoftwareTec/Clickdesk/Model/Mysql4/Clickdesk.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SoftwareTec_Clickdesk_Model_Mysql4_Clickdesk extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('clickdesk/clickdesk', 'clickdesk_id');
8
+ }
9
+ }
app/code/local/SoftwareTec/Clickdesk/Model/Mysql4/Clickdesk/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SoftwareTec_Clickdesk_Model_Mysql4_Clickdesk_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ //parent::__construct();
8
+ $this->_init('clickdesk/clickdesk');
9
+ }
10
+ }
app/code/local/SoftwareTec/Clickdesk/controllers/Adminhtml/DashController.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SoftwareTec_Clickdesk_Adminhtml_DashController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+
8
+
9
+ if(isset($_GET['cdwidgetid']))
10
+ $cdwidgetid = $_GET['cdwidgetid'];
11
+ else
12
+ $cdwidgetid = "";
13
+
14
+ if($cdwidgetid != "")
15
+ {
16
+ $this->saveWidgetId($cdwidgetid);
17
+ }
18
+
19
+ $this->loadLayout()->renderLayout();
20
+ }
21
+
22
+
23
+
24
+ public function postAction()
25
+ {
26
+ $post = $this->getRequest()->getPost();
27
+ try {
28
+ if (empty($post)) {
29
+ Mage::throwException($this->__('Invalid form data.'));
30
+ }
31
+
32
+ $this->saveWidgetId($post["clickdesk"]["widgetid"]);
33
+
34
+
35
+
36
+ $message = $this->__('Your form has been submitted successfully.');
37
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
38
+ } catch (Exception $e) {
39
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
40
+ }
41
+ $this->_redirect('*/*');
42
+ }
43
+
44
+ public function saveWidgetId($wigetid)
45
+ {
46
+
47
+
48
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
49
+ $result = $db->query("SELECT * FROM clickdesk LIMIT 1");
50
+ if($result) {
51
+
52
+ if($row = $result->fetch())
53
+ {
54
+ $conn = Mage::getSingleton('core/resource')->getConnection('core_write');
55
+ $conn->query("update clickdesk set widgetid='".addslashes($wigetid)."'");
56
+ }else
57
+ {
58
+
59
+ $conn = Mage::getSingleton('core/resource')->getConnection('core_write');
60
+ $conn->query("insert into clickdesk values('','".addslashes($wigetid)."')");
61
+
62
+ }
63
+ }
64
+
65
+ }
66
+
67
+ }
app/code/local/SoftwareTec/Clickdesk/etc/config.xml ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SoftwareTec_Clickdesk>
5
+ <version>0.2.3</version>
6
+ </SoftwareTec_Clickdesk>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <clickdesk>
11
+ <class>SoftwareTec_Clickdesk_Block</class>
12
+ </clickdesk>
13
+ </blocks>
14
+ <helpers>
15
+ <clickdesk>
16
+ <class>SoftwareTec_Clickdesk_Helper</class>
17
+ </clickdesk>
18
+ </helpers>
19
+
20
+
21
+ <models>
22
+ <clickdesk>
23
+ <class>SoftwareTec_Clickdesk_Model</class>
24
+ <resourceModel>clickdesk_mysql4</resourceModel>
25
+ </clickdesk>
26
+ <clickdesk_mysql4>
27
+ <class>SoftwareTec_Clickdesk_Model_Mysql4</class>
28
+ <entities>
29
+ <clickdesk>
30
+ <table>clickdesk</table>
31
+ </clickdesk>
32
+ </entities>
33
+ </clickdesk_mysql4>
34
+ </models>
35
+
36
+ <resources>
37
+ <clickdesk_setup>
38
+ <setup>
39
+ <module>SoftwareTec_Clickdesk</module>
40
+ </setup>
41
+ <connection>
42
+ <use>core_setup</use>
43
+ </connection>
44
+ </clickdesk_setup>
45
+ <clickdesk_write>
46
+ <connection>
47
+ <use>core_write</use>
48
+ </connection>
49
+
50
+
51
+ </clickdesk_write>
52
+ <clickdesk_read>
53
+ <connection>
54
+ <use>core_read</use>
55
+ </connection>
56
+ </clickdesk_read>
57
+ </resources>
58
+
59
+ </global>
60
+
61
+ <admin>
62
+ <routers>
63
+ <clickdesk>
64
+ <use>admin</use>
65
+ <args>
66
+ <module>SoftwareTec_Clickdesk</module>
67
+ <frontName>Clickdesk</frontName>
68
+ </args>
69
+ </clickdesk>
70
+ </routers>
71
+ </admin>
72
+
73
+
74
+
75
+ <adminhtml>
76
+ <translate>
77
+ <modules>
78
+ <mage_adminhtml>
79
+ <files>
80
+ <clickdesk>SoftwareTec_Clickdesk.csv</clickdesk>
81
+ </files>
82
+ </mage_adminhtml>
83
+ </modules>
84
+ </translate>
85
+
86
+ <menu>
87
+ <catalog>
88
+ <children>
89
+ <clickdesk_dash translate="title" module="clickdesk">
90
+ <title>Clickdesk</title>
91
+ <action>clickdesk/adminhtml_dash</action>
92
+ </clickdesk_dash>
93
+ </children>
94
+ </catalog>
95
+ </menu>
96
+
97
+ <layout>
98
+ <updates>
99
+ <clickdesk>
100
+ <file>clickdesk.xml</file>
101
+ </clickdesk>
102
+ </updates>
103
+ </layout>
104
+ </adminhtml>
105
+
106
+ <frontend>
107
+ <layout>
108
+ <updates>
109
+ <clickdesk>
110
+ <file>clickdesk.xml</file>
111
+ </clickdesk>
112
+ </updates>
113
+ </layout>
114
+
115
+ </frontend>
116
+ </config>
app/code/local/SoftwareTec/Clickdesk/sql/clickdesk_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('clickdesk')};
10
+ CREATE TABLE {$this->getTable('clickdesk')} (
11
+ `clickdesk_id` int(11) unsigned NOT NULL auto_increment,
12
+ `widgetid` varchar(255) NOT NULL default '',
13
+ PRIMARY KEY (`clickdesk_id`)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
+
16
+ ");
17
+
18
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/clickdesk.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <clickdesk_adminhtml_dash_index>
4
+ <update handle="clickdesk_dash_index"/>
5
+ <reference name="content">
6
+ <block type="adminhtml/template" name="dash" template="clickdesk/dash.phtml"/>
7
+ </reference>
8
+ </clickdesk_adminhtml_dash_index>
9
+ </layout>
app/design/frontend/base/default/layout/clickdesk.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+ <cms_index_index>
6
+ <reference name="right">
7
+ <block type="clickdesk/status" name="clickdesk.status" template="clickdesk/status.phtml"/>
8
+ </reference>
9
+ </cms_index_index>
10
+
11
+
12
+
13
+
14
+
15
+ </layout>
app/design/frontend/base/default/template/clickdesk/status.phtml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="clickdesk-widget">
2
+
3
+ <script type='text/javascript'>
4
+ var _glc =_glc || [];
5
+ _glc.push('<?php echo $this->getWidgetId(); ?>');
6
+ var glcpath = (('https:' == document.location.protocol) ? 'https://contactuswidget.appspot.com/livily/browser/' : 'http://gae.clickdesk.com/livily/browser/');
7
+ var glcp = (('https:' == document.location.protocol) ? 'https://' : 'http://');
8
+ var glcspt = document.createElement('script'); glcspt.type = 'text/javascript'; glcspt.async = true;glcspt.src = glcpath + 'livechat.js';
9
+ var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(glcspt, s);
10
+ </script>
11
+
12
+
13
+ </div>
app/etc/modules/SoftwareTec_Clickdesk.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SoftwareTec_Clickdesk>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </SoftwareTec_Clickdesk>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>ClickDesk_LiveChat_Support</name>
4
+ <version>1.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>LGPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>ClickDesk live chat support extension for Mangeto ecommerce websites.&#xD;
10
+ &#xD;
11
+ Besides being the fastest live-chat service, ClickDesk also allows visitors to call your business directly from browser or our local access numbers in 40+ countries.&#xD;
12
+ &#xD;
13
+ - Receive live chats on Gtalk, Skype, MSN, Yahoo or AOL&#xD;
14
+ - Combo of fastest live chat, VoIP phone and social toolbar&#xD;
15
+ - VoIP phone and Free local access numbers in 40 countries&#xD;
16
+ Provide instant live chat support. See which products your customers are browsing.&#xD;
17
+ &#xD;
18
+ Reduce shopping cart abandonment!</summary>
19
+ <description>ClickDesk for the first time in the industry integrates live-chat and call directly into your IM - you can conveniently take chats and answer calls on your IM on computer or mobile phone. Currently Skype, Google Talk are supported and MSN, AOL and Yahoo! IM client support to receive chats and calls will be added soon.&#xD;
20
+ &#xD;
21
+ Optional Push2Call has a browser phone and provides local access number in more than 40 countries for your visitors to reach your business.&#xD;
22
+ &#xD;
23
+ Never miss a lead. Convert your traffic to sales by provide instant support using this free live chat extension</description>
24
+ <notes>Clickdesk</notes>
25
+ <authors><author><name>Jagan</name><user>Jagan</user><email>jagan@2desk.com</email></author><author><name>Henry</name><user>henry0</user><email>henry@2desk.com</email></author></authors>
26
+ <date>2012-01-03</date>
27
+ <time>13:28:28</time>
28
+ <contents><target name="magelocal"><dir><dir name="SoftwareTec"><dir name="Clickdesk"><dir name="Block"><file name="Status.php" hash="869902090c3d30269cb625aaa214f60d"/></dir><dir name="Helper"><file name="Data.php" hash="975671298b04a5bafaa9214873fe6003"/></dir><dir name="Model"><file name="Clickdesk.php" hash="03f88f3c846531c7ccb30d5c00c5e371"/><dir name="Mysql4"><dir name="Clickdesk"><file name="Collection.php" hash="3ee88b6ddcb22dd5dc2297e0abe0cae6"/></dir><file name="Clickdesk.php" hash="52622d7e492861ab7fdbce1d6c2a78f8"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DashController.php" hash="6b2d44d2553669883273492727e9f49c"/></dir></dir><dir name="etc"><file name="config.xml" hash="3b11e7336f469f7a34c110c4865cc890"/></dir><dir name="sql"><dir name="clickdesk_setup"><file name="mysql4-install-0.1.0.php" hash="1ae4322bb7e5fd13f04bb6669e975153"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="SoftwareTec_Clickdesk.xml" hash="441bbbace9e216eed5c126bc23bfbb69"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="clickdesk.xml" hash="0a10cae2dac23d1940d091f535476145"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="clickdesk.xml" hash="698384491f1a1e24890516abc2b3dfe4"/></dir><dir name="template"><dir name="clickdesk"><file name="status.phtml" hash="d0fa95dda0acc1744eed5b20f3bd27dd"/></dir></dir></dir></dir></dir></dir></target></contents>
29
+ <compatible/>
30
+ <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
31
+ </package>