Version Notes
Default button will now support Offline Form.
Download this release
Release Info
| Developer | Quality Unit, LLC |
| Extension | Liveagent |
| Version | 3.0.1 |
| Comparing to | |
| See all releases | |
Code changes from version 3.0.0 to 3.0.1
- app/code/local/Qualityunit/Liveagent/Block/AccountConnect.php +8 -7
- app/code/local/Qualityunit/Liveagent/Block/Buttoncode.php +2 -2
- app/code/local/Qualityunit/Liveagent/Helper/Account.php +15 -16
- app/code/local/Qualityunit/Liveagent/Helper/Settings.php +133 -118
- app/code/local/Qualityunit/Liveagent/Helper/before.txt +0 -1
- app/code/local/Qualityunit/Liveagent/controllers/Adminhtml/LiveagentController.php +12 -7
- app/code/local/Qualityunit/Liveagent/etc/config.xml +10 -10
- app/design/adminhtml/default/default/layout/liveagent.xml +22 -22
- app/design/adminhtml/default/default/template/liveagent/button.phtml +13 -0
- app/design/adminhtml/default/default/template/liveagent/report.phtml +20 -0
- app/etc/modules/Qualityunit_Liveagent.xml +1 -1
- package.xml +5 -5
- skin/adminhtml/default/default/liveagent/js/lasignup.js +22 -17
app/code/local/Qualityunit/Liveagent/Block/AccountConnect.php
CHANGED
|
@@ -27,14 +27,14 @@ class Qualityunit_Liveagent_Block_AccountConnect extends Qualityunit_Liveagent_B
|
|
| 27 |
$this->assignVariable('formKey', Mage::getSingleton('core/session')->getFormKey());
|
| 28 |
$this->assignVariable('saveUrlAction', $this->getUrl('*/*/post'));
|
| 29 |
$this->assignVariable('connectUrlAction', $this->getUrl('*/*/index', array('key' => $this->getRequest()->get('key'), 'action' => self::CONNECT_ACCOUNT_ACTION_FLAG)));
|
| 30 |
-
$this->assignVariable('urlLabel', Mage::helper('adminhtml')->__('Url')
|
| 31 |
$this->assignVariable('urlHelp', Mage::helper('adminhtml')->__('Url where your LiveAgent installation is located'));
|
| 32 |
$this->assignVariable('laOwnerEmailHelp', Mage::helper('adminhtml')->__('Username which you use to login to your Live Agent'));
|
| 33 |
-
$this->assignVariable('nameLabel', Mage::helper('adminhtml')->__('Username')
|
| 34 |
$this->assignVariable('sslSecure', Mage::helper('adminhtml')->__('SSL secure signup'));
|
| 35 |
-
$this->assignVariable('accountUrl', Mage::helper('adminhtml')->__('URL')
|
| 36 |
-
$this->assignVariable('accountEmail', Mage::helper('adminhtml')->__('Email')
|
| 37 |
-
$this->assignVariable('accountAPIKey', Mage::helper('adminhtml')->__('API Key')
|
| 38 |
|
| 39 |
$this->assignVariable(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME, $this->settings->getLiveAgentUrl());
|
| 40 |
$this->assignVariable(Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME, $this->settings->getOwnerEmail());
|
|
@@ -42,6 +42,7 @@ class Qualityunit_Liveagent_Block_AccountConnect extends Qualityunit_Liveagent_B
|
|
| 42 |
$this->assignVariable('saveActionSettingsFlag', self::CONNECT_ACCOUNT_ACTION_FLAG);
|
| 43 |
$this->assignVariable('urlName', Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME);
|
| 44 |
$this->assignVariable('apiKeyName', Qualityunit_Liveagent_Helper_Settings::LA_API_KEY);
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
protected function getTemplateString(){
|
|
@@ -67,10 +68,10 @@ class Qualityunit_Liveagent_Block_AccountConnect extends Qualityunit_Liveagent_B
|
|
| 67 |
</div>
|
| 68 |
<div class="mailField">
|
| 69 |
<div class="emailLabel">{accountEmail}<span></span></div>
|
| 70 |
-
<div id="
|
| 71 |
<div id="mailFieldinputPanel" class="g-FormField2-InputPanel"></div>
|
| 72 |
<div id="mailFieldTextContainer" class="TextBoxContainer TextBoxContainer-mandatory">
|
| 73 |
-
<input id="mailFieldinnerWidget" class="Placeholdem TextBox TextBox-mandatory" name="
|
| 74 |
</div>
|
| 75 |
<div id="mailFielddescription" class="g-FormField2-Description"></div>
|
| 76 |
<div id="mailFieldmessage" class="g-FormField2-Message"></div>
|
| 27 |
$this->assignVariable('formKey', Mage::getSingleton('core/session')->getFormKey());
|
| 28 |
$this->assignVariable('saveUrlAction', $this->getUrl('*/*/post'));
|
| 29 |
$this->assignVariable('connectUrlAction', $this->getUrl('*/*/index', array('key' => $this->getRequest()->get('key'), 'action' => self::CONNECT_ACCOUNT_ACTION_FLAG)));
|
| 30 |
+
$this->assignVariable('urlLabel', Mage::helper('adminhtml')->__('Url') . ':');
|
| 31 |
$this->assignVariable('urlHelp', Mage::helper('adminhtml')->__('Url where your LiveAgent installation is located'));
|
| 32 |
$this->assignVariable('laOwnerEmailHelp', Mage::helper('adminhtml')->__('Username which you use to login to your Live Agent'));
|
| 33 |
+
$this->assignVariable('nameLabel', Mage::helper('adminhtml')->__('Username') . ':');
|
| 34 |
$this->assignVariable('sslSecure', Mage::helper('adminhtml')->__('SSL secure signup'));
|
| 35 |
+
$this->assignVariable('accountUrl', Mage::helper('adminhtml')->__('URL') . ':');
|
| 36 |
+
$this->assignVariable('accountEmail', Mage::helper('adminhtml')->__('Email') . ':');
|
| 37 |
+
$this->assignVariable('accountAPIKey', Mage::helper('adminhtml')->__('API Key') . ':');
|
| 38 |
|
| 39 |
$this->assignVariable(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME, $this->settings->getLiveAgentUrl());
|
| 40 |
$this->assignVariable(Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME, $this->settings->getOwnerEmail());
|
| 42 |
$this->assignVariable('saveActionSettingsFlag', self::CONNECT_ACCOUNT_ACTION_FLAG);
|
| 43 |
$this->assignVariable('urlName', Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME);
|
| 44 |
$this->assignVariable('apiKeyName', Qualityunit_Liveagent_Helper_Settings::LA_API_KEY);
|
| 45 |
+
$this->assignVariable('ownerEmailName', Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME);
|
| 46 |
}
|
| 47 |
|
| 48 |
protected function getTemplateString(){
|
| 68 |
</div>
|
| 69 |
<div class="mailField">
|
| 70 |
<div class="emailLabel">{accountEmail}<span></span></div>
|
| 71 |
+
<div id="mailFieldmain1" class="g-FormField2 FieldNotSet">
|
| 72 |
<div id="mailFieldinputPanel" class="g-FormField2-InputPanel"></div>
|
| 73 |
<div id="mailFieldTextContainer" class="TextBoxContainer TextBoxContainer-mandatory">
|
| 74 |
+
<input id="mailFieldinnerWidget" class="Placeholdem TextBox TextBox-mandatory" name="{ownerEmailName}" value="{la-owner-email}" placeholder="Your login information will be sent here" autocomplete="off" type="text">
|
| 75 |
</div>
|
| 76 |
<div id="mailFielddescription" class="g-FormField2-Description"></div>
|
| 77 |
<div id="mailFieldmessage" class="g-FormField2-Message"></div>
|
app/code/local/Qualityunit/Liveagent/Block/Buttoncode.php
CHANGED
|
@@ -169,7 +169,7 @@ class Qualityunit_Liveagent_Block_Buttoncode extends Qualityunit_Liveagent_Block
|
|
| 169 |
<td class="scope-label"> </td>
|
| 170 |
<td class="value" style="text-align: center">
|
| 171 |
<div id="connectButtonmain" class="ImLeButtonMain1 buttonBgColor buttonBorderColor createButton" tabindex="0">
|
| 172 |
-
<span onclick="
|
| 173 |
</div>
|
| 174 |
</td>
|
| 175 |
<td class="scope-label"></td><td></td>
|
|
@@ -187,7 +187,7 @@ class Qualityunit_Liveagent_Block_Buttoncode extends Qualityunit_Liveagent_Block
|
|
| 187 |
</div>
|
| 188 |
<div class="formFooter">
|
| 189 |
<div id="connectButtonmain" class="ImLeButtonMain1 buttonBgColor buttonBorderColor createButton" tabindex="0">
|
| 190 |
-
<span onclick="
|
| 191 |
</div>
|
| 192 |
<span class="LaSignupFormDesc1">{LaSignupFormDesc} {la-url}</span>
|
| 193 |
</div>
|
| 169 |
<td class="scope-label"> </td>
|
| 170 |
<td class="value" style="text-align: center">
|
| 171 |
<div id="connectButtonmain" class="ImLeButtonMain1 buttonBgColor buttonBorderColor createButton" tabindex="0">
|
| 172 |
+
<span onclick="window.open(\'{loginUrl}\', \'_blank\')" class="buttonText">{loginLabel}</span>
|
| 173 |
</div>
|
| 174 |
</td>
|
| 175 |
<td class="scope-label"></td><td></td>
|
| 187 |
</div>
|
| 188 |
<div class="formFooter">
|
| 189 |
<div id="connectButtonmain" class="ImLeButtonMain1 buttonBgColor buttonBorderColor createButton" tabindex="0">
|
| 190 |
+
<span onclick="window.open(\'{loginUrl}\', \'_blank\')" class="buttonText">{addMoreButtons}</span>
|
| 191 |
</div>
|
| 192 |
<span class="LaSignupFormDesc1">{LaSignupFormDesc} {la-url}</span>
|
| 193 |
</div>
|
app/code/local/Qualityunit/Liveagent/Helper/Account.php
CHANGED
|
@@ -1,21 +1,20 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
class Qualityunit_Liveagent_Helper_Account extends Mage_Core_Helper_Abstract {
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
}
|
| 1 |
<?php
|
|
|
|
| 2 |
class Qualityunit_Liveagent_Helper_Account extends Mage_Core_Helper_Abstract {
|
| 3 |
|
| 4 |
+
public static function isOnline() {
|
| 5 |
+
$isOnline = Mage::getSingleton('adminhtml/session')->getMyIsOnline();
|
| 6 |
+
if ($isOnline != '') return true;
|
| 7 |
|
| 8 |
+
$connect = new Qualityunit_Liveagent_Helper_Connect();
|
| 9 |
+
$settings = new Qualityunit_Liveagent_Helper_Settings();
|
| 10 |
+
try {
|
| 11 |
+
$connect->ping($settings->getLiveAgentUrl(), $settings->getApiKey());
|
| 12 |
+
Mage::getSingleton('adminhtml/session')->setMyIsOnline('online');
|
| 13 |
+
Mage::log('Account is online!', Zend_Log::INFO);
|
| 14 |
+
return true;
|
| 15 |
+
} catch (Qualityunit_Liveagent_Exception_ConnectProblem $e) {
|
| 16 |
+
Mage::log('Account not online', Zend_Log::INFO);
|
| 17 |
+
return false;
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
}
|
app/code/local/Qualityunit/Liveagent/Helper/Settings.php
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
*
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
*
|
| 8 |
-
*
|
| 9 |
*/
|
| 10 |
|
| 11 |
class Qualityunit_Liveagent_Helper_Settings {
|
|
@@ -32,7 +32,7 @@ class Qualityunit_Liveagent_Helper_Settings {
|
|
| 32 |
const ACCOUNT_STATUS_SET = 'S';
|
| 33 |
|
| 34 |
public function getOwnerAuthToken() {
|
| 35 |
-
|
| 36 |
}
|
| 37 |
|
| 38 |
public function getLiveAgentUrl() {
|
|
@@ -64,129 +64,144 @@ class Qualityunit_Liveagent_Helper_Settings {
|
|
| 64 |
public function getAllWidgets() {
|
| 65 |
$connectHelper = new Qualityunit_Liveagent_Helper_Connect();
|
| 66 |
try {
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
} catch (Qualityunit_Liveagent_Exception_Base $e) {
|
| 71 |
-
|
| 72 |
}
|
| 73 |
Mage::log("Connect response received: " . print_r($response, true), Zend_log::DEBUG);
|
| 74 |
Mage::log("Response OK", Zend_log::DEBUG);
|
| 75 |
}
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
public function getDefaultWidgetParams() {
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
}
|
| 177 |
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
}
|
| 184 |
|
| 185 |
public function getSavedButtonId() {
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
}
|
| 191 |
|
| 192 |
public function saveButtonCodeForButtonId($buttonid) {
|
|
@@ -194,7 +209,7 @@ class Qualityunit_Liveagent_Helper_Settings {
|
|
| 194 |
$url = str_replace('https', '', $url);
|
| 195 |
$url = str_replace('http', '', $url);
|
| 196 |
if (substr($url, -1) != '/') {
|
| 197 |
-
|
| 198 |
}
|
| 199 |
$this->setOption(self::BUTTON_CODE, "
|
| 200 |
<script type=\"text/javascript\">
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* @copyright Copyright (c) 2007 Quality Unit s.r.o.
|
| 4 |
+
* @author Juraj Simon
|
| 5 |
+
* @package WpLiveAgentPlugin
|
| 6 |
+
* @version 1.0.0
|
| 7 |
*
|
| 8 |
+
* Licensed under GPL2
|
| 9 |
*/
|
| 10 |
|
| 11 |
class Qualityunit_Liveagent_Helper_Settings {
|
| 32 |
const ACCOUNT_STATUS_SET = 'S';
|
| 33 |
|
| 34 |
public function getOwnerAuthToken() {
|
| 35 |
+
return $this->getOption(Qualityunit_Liveagent_Helper_Settings::OWNER_AUTHTOKEN);
|
| 36 |
}
|
| 37 |
|
| 38 |
public function getLiveAgentUrl() {
|
| 64 |
public function getAllWidgets() {
|
| 65 |
$connectHelper = new Qualityunit_Liveagent_Helper_Connect();
|
| 66 |
try {
|
| 67 |
+
$widgetsList = $connectHelper->getWidgets($this->getOption(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME),
|
| 68 |
+
$this->getOption(Qualityunit_Liveagent_Helper_Settings::LA_API_KEY));
|
| 69 |
+
return $widgetsList;
|
| 70 |
} catch (Qualityunit_Liveagent_Exception_Base $e) {
|
| 71 |
+
throw new Qualityunit_Liveagent_Exception_ConnectFailed($e->getMessage());
|
| 72 |
}
|
| 73 |
Mage::log("Connect response received: " . print_r($response, true), Zend_log::DEBUG);
|
| 74 |
Mage::log("Response OK", Zend_log::DEBUG);
|
| 75 |
}
|
| 76 |
|
| 77 |
+
private function getLogoURL() {
|
| 78 |
+
return str_replace(array('http:','https:'), '', $this->getLiveAgentUrl()) . 'themes/install/_common_templates/img/default-contactwidget-logo.png';
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
public function getDefaultWidgetParams() {
|
| 82 |
+
$attributes = array(
|
| 83 |
+
array('section' => 'chat','name' => 'chat_action','value' => 'C'),
|
| 84 |
+
array('section' => 'chat','name' => 'chat_action','value' => 'C'),
|
| 85 |
+
array('section' => 'chat','name' => 'chat_agentmessage_bg_color','value' => 'FFFFFF'),
|
| 86 |
+
array('section' => 'chat','name' => 'chat_agentmessage_color','value' => '000000'),
|
| 87 |
+
array('section' => 'chat','name' => 'chat_border_bg_color','value' => '000000'),
|
| 88 |
+
array('section' => 'chat','name' => 'chat_border_color','value' => 'FFFFFF'),
|
| 89 |
+
array('section' => 'chat','name' => 'chat_button_bg_color','value' => '476B77'),
|
| 90 |
+
array('section' => 'chat','name' => 'chat_button_color','value' => 'FFFFFF'),
|
| 91 |
+
array('section' => 'chat','name' => 'chat_custom_css','value' => ''),
|
| 92 |
+
array('section' => 'chat','name' => 'chat_design','value' => 'musho'),
|
| 93 |
+
array('section' => 'chat','name' => 'chat_not_available_action','value' => 'F'),
|
| 94 |
+
array('section' => 'chat','name' => 'chat_status_bg_color','value' => '98A8AD'),
|
| 95 |
+
array('section' => 'chat','name' => 'chat_status_color','value' => '000000'),
|
| 96 |
+
array('section' => 'chat','name' => 'chat_title','value' => 'Welcome'),
|
| 97 |
+
array('section' => 'chat','name' => 'chat_type','value' => 'E'),
|
| 98 |
+
array('section' => 'chat','name' => 'chat_visitormessage_bg_color','value' => 'FFFFFF'),
|
| 99 |
+
array('section' => 'chat','name' => 'chat_visitormessage_color','value' => '909DA2'),
|
| 100 |
+
array('section' => 'chat','name' => 'chat_welcome_message','value' => ''),
|
| 101 |
+
array('section' => 'chat','name' => 'chat_window_height','value' => '450'),
|
| 102 |
+
array('section' => 'chat','name' => 'chat_window_width','value' => '350'),
|
| 103 |
+
array('section' => 'chat','name' => 'embedded_position','value' => 'BR'),
|
| 104 |
+
array('section' => 'chat','name' => 'leaving_mess_status','value' => 'Y'),
|
| 105 |
+
array('section' => 'chat','name' => 'window_position','value' => 'C'),
|
| 106 |
+
array('section' => 'contactForm', 'name' => 'form_form_color', 'value' => '464646' ),
|
| 107 |
+
array('section' => 'contactForm', 'name' => 'form_border_bg_color', 'value' => 'F6F6F6'),
|
| 108 |
+
array('section' => 'contactForm', 'name' => 'kb_suggestions_kb_id', 'value' => 'kb_defa'),
|
| 109 |
+
array('section' => 'contactForm', 'name' => 'form_content_bg_color', 'value' => 'F6F6F6'),
|
| 110 |
+
array('section' => 'contactForm', 'name' => 'form_status_color', 'value' => '000000'),
|
| 111 |
+
array('section' => 'contactForm', 'name' => 'form_custom_css', 'value' => ''),
|
| 112 |
+
array('section' => 'contactForm', 'name' => 'form_logourl', 'value' => $this->getLogoURL()),
|
| 113 |
+
array('section' => 'contactForm', 'name' => 'form_department_choose', 'value' => 'N'),
|
| 114 |
+
array('section' => 'contactForm', 'name' => 'kb_suggestions_parent_entry_id', 'value' => '0'),
|
| 115 |
+
array('section' => 'contactForm', 'name' => 'kb_suggestions_treepath', 'value' => '0'),
|
| 116 |
+
array('section' => 'contactForm', 'name' => 'form_border_color', 'value' => '464646'),
|
| 117 |
+
array('section' => 'contactForm', 'name' => 'form_confirm_message', 'value' => 'Thanks for your question. We\'ll send you an answer via email to {$conversationOwnerEmail}'),
|
| 118 |
+
array('section' => 'contactForm', 'name' => 'contact_form_design', 'value' => 'modern'),
|
| 119 |
+
array('section' => 'contactForm', 'name' => 'form_form_bg_color', 'value' => 'F6F6F6'),
|
| 120 |
+
array('section' => 'contactForm', 'name' => 'show_kb_suggestions', 'value' => 'N'),
|
| 121 |
+
array('section' => 'contactForm', 'name' => 'form_status_bg_color', 'value' => 'EAEAEA'),
|
| 122 |
+
array('section' => 'contactForm', 'name' => 'form_button_bg_color', 'value' => 'FF7C22'),
|
| 123 |
+
array('section' => 'contactForm', 'name' => 'form_title', 'value' => 'Welcome'),
|
| 124 |
+
array('section' => 'contactForm', 'name' => 'form_content_color', 'value' => '464646'),
|
| 125 |
+
array('section' => 'contactForm', 'name' => 'form_button_color', 'value' => 'FFFFFF'),
|
| 126 |
+
array('section' => 'contactForm', 'name' => 'form_window_height','value' => '490'),
|
| 127 |
+
array('section' => 'contactForm', 'name' => 'form_window_width','value' => '500'),
|
| 128 |
+
array('section' => 'button','name' => 'button_type','value' => '7'),
|
| 129 |
+
array('section' => 'button','name' => 'offline_button_bg_color','value' => '7E7E7E'),
|
| 130 |
+
array('section' => 'button','name' => 'offline_button_border_color','value' => '000000'),
|
| 131 |
+
array('section' => 'button','name' => 'offline_button_color','value' => 'FFFFFF'),
|
| 132 |
+
array('section' => 'button','name' => 'offline_button_inner_border_color','value' => 'FFFFFF'),
|
| 133 |
+
array('section' => 'button','name' => 'offline_button_position','value' => '25'),
|
| 134 |
+
array('section' => 'button','name' => 'offline_button_side','value' => 'L'),
|
| 135 |
+
array('section' => 'button','name' => 'offline_button_text','value' => 'Contact Us'),
|
| 136 |
+
array('section' => 'button','name' => 'online_button_bg_color','value' => '191919'),
|
| 137 |
+
array('section' => 'button','name' => 'online_button_border_color','value' => '000000'),
|
| 138 |
+
array('section' => 'button','name' => 'online_button_color','value' => 'FFFFFF'),
|
| 139 |
+
array('section' => 'button','name' => 'online_button_inner_border_color','value' => '6BDC00'),
|
| 140 |
+
array('section' => 'button','name' => 'online_button_position','value' => '25'),
|
| 141 |
+
array('section' => 'button','name' => 'online_button_side','value' => 'L'),
|
| 142 |
+
array('section' => 'button','name' => 'online_button_text','value' => 'Live Chat'),
|
| 143 |
+
array('section' => 'contactForm','name' => 'online_contact_form_design','value' => 'modern'),
|
| 144 |
+
array('section' => 'contactForm','name' => 'online_form_border_bg_color','value' => 'F6F6F6'),
|
| 145 |
+
array('section' => 'contactForm','name' => 'online_form_border_color','value' => '464646'),
|
| 146 |
+
array('section' => 'contactForm','name' => 'online_form_button_bg_color','value' => 'FF7C22'),
|
| 147 |
+
array('section' => 'contactForm','name' => 'online_form_button_color','value' => 'FFFFFF'),
|
| 148 |
+
array('section' => 'contactForm','name' => 'online_form_confirm_message','value' => 'Please stand by, you will be redirected to operator shortly...'),
|
| 149 |
+
array('section' => 'contactForm','name' => 'online_form_content_bg_color','value' => 'F6F6F6'),
|
| 150 |
+
array('section' => 'contactForm','name' => 'online_form_content_color','value' => '464646'),
|
| 151 |
+
array('section' => 'contactForm','name' => 'online_form_custom_css','value' => ''),
|
| 152 |
+
array('section' => 'contactForm','name' => 'online_form_department_choose','value' => 'N'),
|
| 153 |
+
array('section' => 'contactForm','name' => 'online_form_form_bg_color','value' => 'F6F6F6'),
|
| 154 |
+
array('section' => 'contactForm','name' => 'online_form_form_color','value' => '464646'),
|
| 155 |
+
array('section' => 'contactForm','name' => 'online_form_logourl','value' => $this->getLogoURL()),
|
| 156 |
+
array('section' => 'contactForm','name' => 'online_form_status_bg_color','value' => 'EAEAEA'),
|
| 157 |
+
array('section' => 'contactForm','name' => 'online_form_status_color','value' => '000000'),
|
| 158 |
+
array('section' => 'contactForm','name' => 'online_form_title','value' => 'Welcome'),
|
| 159 |
+
array('section' => 'contactForm','name' => 'online_form_window_height','value' => '490'),
|
| 160 |
+
array('section' => 'contactForm','name' => 'online_form_window_width','value' => '500'),
|
| 161 |
+
array('section' => 'contactForm','name' => 'online_kb_suggestions_kb_id','value' => 'kb_defa'),
|
| 162 |
+
array('section' => 'contactForm','name' => 'online_kb_suggestions_parent_entry_id','value' => '0'),
|
| 163 |
+
array('section' => 'contactForm','name' => 'online_kb_suggestions_treepath','value' => '0'),
|
| 164 |
+
array('section' => 'contactForm','name' => 'online_show_kb_suggestions','value' => 'N'));
|
| 165 |
+
|
| 166 |
+
$formFields = array(
|
| 167 |
+
array('formid' => 'contactForm', 'name' => 'Name', 'rstatus' => 'M', 'code' => 'name', 'rtype' => 'T', 'availablevalues' => ''),
|
| 168 |
+
array('formid' => 'contactForm', 'name' => 'Email', 'rstatus' => 'M', 'code' => 'email', 'rtype' => 'T', 'availablevalues' => ''),
|
| 169 |
+
array('formid' => 'contactForm', 'name' => 'Message', 'rstatus' => 'M','code' => 'message', 'rtype' => 'M', 'availablevalues' => ''),
|
| 170 |
+
array('formid' => 'chat', 'name' => 'Name', 'rstatus' => 'M', 'code' => 'name', 'rtype' => 'T', 'availablevalues' => ''),
|
| 171 |
+
array('formid' => 'chat', 'name' => 'Email', 'rstatus' => 'M', 'code' => 'email', 'rtype' => 'T', 'availablevalues' => ''),
|
| 172 |
+
array('formid' => 'chat', 'name' => 'Message', 'rstatus' => 'M', 'code' => 'message', 'rtype' => 'M', 'availablevalues' => '')
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
return array(
|
| 176 |
+
'name' => 'Default button',
|
| 177 |
+
'provide' => 'BFC',
|
| 178 |
+
'departmentid' => 'default',
|
| 179 |
+
'rtype' => 'C',
|
| 180 |
+
'usecode' => 'B',
|
| 181 |
+
'status' => 'A',
|
| 182 |
+
'apikey' => $this->getApiKey(),
|
| 183 |
+
'language' => 'en-US',
|
| 184 |
+
'onlinecode' => '<div style="left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;"><!-- HorizontalBorderedTextButton --><div style="position:static; transform:rotate(-90deg); -ms-transform:rotate(-90deg); -webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-o-transform: rotate(-90deg); transform-origin: 0% 100%; -moz-transform-origin: 0% 0%; -webkit-transform-origin: 0% 0%; -o-transform-origin: 0% 0%;"><div style="cursor:pointer; box-shadow:0 0 3px #111111; -moz-box-shadow:0 0 3px #111111; -webkit-box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; -moz-border-radius:0 0 5px 5px; -webkit-border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; position:absolute; top:0; right:0; border-top:0 !important; background-color:#6BDC00; border:1px solid #000000;"><div style="box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; background-color:#191919; color:#FFFFFF;">Live Chat</div></div></div></div>',
|
| 185 |
+
'onlinecode_ieold' => '<div style="left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;"><!-- HorizontalBorderedTextButton --><div style="position:static; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); transform-origin: 0% 100%; "><div style="cursor:pointer; box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; *padding:3px 3px 3px 0; position:absolute; top:0; right:0; position:relative; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); border-top:0 !important; border-radius:0px; background-color:#6BDC00; border:1px solid #000000;"><div style="box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; *filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); background-color:#191919; color:#FFFFFF;">Live Chat</div></div></div></div>',
|
| 186 |
+
'offlinecode' => '<div style="left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;"><!-- HorizontalBorderedTextButton --><div style="position:static; transform:rotate(-90deg); -ms-transform:rotate(-90deg); -webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-o-transform: rotate(-90deg); transform-origin: 0% 100%; -moz-transform-origin: 0% 0%; -webkit-transform-origin: 0% 0%; -o-transform-origin: 0% 0%;"><div style="cursor:pointer; box-shadow:0 0 3px #111111; -moz-box-shadow:0 0 3px #111111; -webkit-box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; -moz-border-radius:0 0 5px 5px; -webkit-border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; position:absolute; top:0; right:0; border-top:0 !important; background-color:#FFFFFF; border:1px solid #000000;"><div style="box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; background-color:#7E7E7E; color:#FFFFFF;">Contact Us</div></div></div></div>',
|
| 187 |
+
'offlinecode_ieold' => '<div style="left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;"><!-- HorizontalBorderedTextButton --><div style="position:static; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); transform-origin: 0% 100%; "><div style="cursor:pointer; box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; *padding:3px 3px 3px 0; position:absolute; top:0; right:0; position:relative; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); border-top:0 !important; border-radius:0px; background-color:#FFFFFF; border:1px solid #000000;"><div style="box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; *filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); background-color:#7E7E7E; color:#FFFFFF;">Contact Us</div></div></div></div>',
|
| 188 |
+
'attributes' => json_encode($attributes),
|
| 189 |
+
'form_fields' => json_encode($formFields)
|
| 190 |
+
);
|
| 191 |
}
|
| 192 |
|
| 193 |
+
public function getSavedButtonCode() {
|
| 194 |
+
if ($this->getOption(Qualityunit_Liveagent_Helper_Settings::BUTTON_CODE) != '') {
|
| 195 |
+
return $this->getOption(Qualityunit_Liveagent_Helper_Settings::BUTTON_CODE);
|
| 196 |
+
}
|
| 197 |
+
return '';
|
| 198 |
}
|
| 199 |
|
| 200 |
public function getSavedButtonId() {
|
| 201 |
+
if ($this->getOption(Qualityunit_Liveagent_Helper_Settings::BUTTON_ID) != '') {
|
| 202 |
+
return $this->getOption(Qualityunit_Liveagent_Helper_Settings::BUTTON_ID);
|
| 203 |
+
}
|
| 204 |
+
return '';
|
| 205 |
}
|
| 206 |
|
| 207 |
public function saveButtonCodeForButtonId($buttonid) {
|
| 209 |
$url = str_replace('https', '', $url);
|
| 210 |
$url = str_replace('http', '', $url);
|
| 211 |
if (substr($url, -1) != '/') {
|
| 212 |
+
$url .= '/';
|
| 213 |
}
|
| 214 |
$this->setOption(self::BUTTON_CODE, "
|
| 215 |
<script type=\"text/javascript\">
|
app/code/local/Qualityunit/Liveagent/Helper/before.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
D:{"C":"Gpf_Rpc_Server", "M":"run", "R":[{"C":"La_ContactWidget_ChatButtonForm", "M":"save", "fields":[["name","value","values","error"],["Id","f24d4bea","",""],["onlinecode","<div style=\"left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;\"><!-- HorizontalBorderedTextButton --><div style=\"position:static; transform:rotate(-90deg); -ms-transform:rotate(-90deg); -webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-o-transform: rotate(-90deg); transform-origin: 0% 100%; -moz-transform-origin: 0% 0%; -webkit-transform-origin: 0% 0%; -o-transform-origin: 0% 0%;\"><div style=\"cursor:pointer; box-shadow:0 0 3px #111111; -moz-box-shadow:0 0 3px #111111; -webkit-box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; -moz-border-radius:0 0 5px 5px; -webkit-border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; position:absolute; top:0; right:0; border-top:0 !important; background-color:#6BDC00; border:1px solid #000000;\"><div style=\"box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; background-color:#191919; color:#FFFFFF;\">Live Chat</div></div></div></div>","",""],["onlinecode_ieold","<div style=\"left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;\"><!-- HorizontalBorderedTextButton --><div style=\"position:static; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); transform-origin: 0% 100%; \"><div style=\"cursor:pointer; box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; *padding:3px 3px 3px 0; position:absolute; top:0; right:0; position:relative\\9; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); border-top:0 !important; border-radius:0px\\9; background-color:#6BDC00; border:1px solid #000000;\"><div style=\"box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; *filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); background-color:#191919; color:#FFFFFF;\">Live Chat</div></div></div></div>","",""],["online_button_side","L","",""],["online_button_position","25","",""],["online_button_text","Live Chat","",""],["online_button_inner_border_color","6BDC00","",""],["online_button_border_color","000000","",""],["online_button_bg_color","191919","",""],["online_button_color","FFFFFF","",""],["chat_type","E","",""],["embedded_position","BR","",""],["window_position","C","",""],["chat_window_width","350","",""],["chat_window_height","450","",""],["chat_border_bg_color","000000","",""],["chat_border_color","FFFFFF","",""],["chat_button_bg_color","476B77","",""],["chat_button_color","FFFFFF","",""],["chat_status_bg_color","98A8AD","",""],["chat_status_color","000000","",""],["chat_agentmessage_bg_color","FFFFFF","",""],["chat_agentmessage_color","000000","",""],["chat_visitormessage_bg_color","FFFFFF","",""],["chat_visitormessage_color","909DA2","",""],["chat_title","Welcome","",""],["chat_welcome_message","","",""],["leaving_mess_status","Y","",""],["chat_design","musho","",""],["chat_custom_css","","",""],["online_form_title","Welcome","",""],["online_show_kb_suggestions","N","",""],["online_kb_suggestions_kb_id","kb_defa","",""],["online_kb_suggestions_parent_entry_id","0","",""],["online_kb_suggestions_treepath","0","",""],["online_form_confirm_message","Please stand by, you will be redirected to operator shortly...","",""],["chat_action","C","",""],["online_contact_form_design","modern","",""],["online_form_border_bg_color","F6F6F6","",""],["online_form_border_color","464646","",""],["online_form_content_bg_color","F6F6F6","",""],["online_form_content_color","464646","",""],["online_form_form_bg_color","F6F6F6","",""],["online_form_form_color","464646","",""],["online_form_button_bg_color","FF7C22","",""],["online_form_button_color","FFFFFF","",""],["online_form_status_bg_color","EAEAEA","",""],["online_form_status_color","000000","",""],["online_form_custom_css","","",""],["online_form_department_choose","N","",""],["chatFields",[["name","rstatus","code","rtype","availablevalues"]],"",""],["button_type","7","",""],["offlinecode","<div style=\"left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;\"><!-- HorizontalBorderedTextButton --><div style=\"position:static; transform:rotate(-90deg); -ms-transform:rotate(-90deg); -webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-o-transform: rotate(-90deg); transform-origin: 0% 100%; -moz-transform-origin: 0% 0%; -webkit-transform-origin: 0% 0%; -o-transform-origin: 0% 0%;\"><div style=\"cursor:pointer; box-shadow:0 0 3px #111111; -moz-box-shadow:0 0 3px #111111; -webkit-box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; -moz-border-radius:0 0 5px 5px; -webkit-border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; position:absolute; top:0; right:0; border-top:0 !important; background-color:#FFFFFF; border:1px solid #000000;\"><div style=\"box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; background-color:#7E7E7E; color:#FFFFFF;\">Contact Us</div></div></div></div>","",""],["offlinecode_ieold","<div style=\"left: 0px;top: 25%; margin-top: -0px;z-index: 999997; position: fixed;\"><!-- HorizontalBorderedTextButton --><div style=\"position:static; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); transform-origin: 0% 100%; \"><div style=\"cursor:pointer; box-shadow:0 0 3px #111111; border-radius:0 0 5px 5px; vertical-align:top; white-space:nowrap; margin-bottom:15px; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; cursor:pointer; padding:0px 3px 3px; *padding:3px 3px 3px 0; position:absolute; top:0; right:0; position:relative\\9; filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); border-top:0 !important; border-radius:0px\\9; background-color:#FFFFFF; border:1px solid #000000;\"><div style=\"box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; -ms-box-sizing:content-box; font-size:20px; font-weight:bold; font-family:Arial,Verdana,Helvetica,sans-serif; position:static; line-height:18px; height:18px; padding:8px 23px; *filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3); background-color:#7E7E7E; color:#FFFFFF;\">Contact Us</div></div></div></div>","",""],["offline_button_side","L","",""],["offline_button_position","25","",""],["offline_button_text","Contact Us","",""],["offline_button_inner_border_color","FFFFFF","",""],["offline_button_border_color","000000","",""],["offline_button_bg_color","7E7E7E","",""],["offline_button_color","FFFFFF","",""],["chat_not_available_action","N","",""],["form_title","Welcome","",""],["show_kb_suggestions","N","",""],["kb_suggestions_kb_id","kb_defa","",""],["kb_suggestions_parent_entry_id","0","",""],["kb_suggestions_treepath","0","",""],["form_confirm_message","Thanks for your question. We'll send you an answer via email to {$conversationOwnerEmail}","",""],["contact_form_design","modern","",""],["form_border_bg_color","F6F6F6","",""],["form_border_color","464646","",""],["form_content_bg_color","F6F6F6","",""],["form_content_color","464646","",""],["form_form_bg_color","F6F6F6","",""],["form_form_color","464646","",""],["form_button_bg_color","FF7C22","",""],["form_button_color","FFFFFF","",""],["form_status_bg_color","EAEAEA","",""],["form_status_color","000000","",""],["form_custom_css","","",""],["form_department_choose","N","",""],["contactFormFields",[["name","rstatus","code","rtype","availablevalues"]],"",""],["name","Default button 1","",""],["departmentid","default","",""],["language","en-US","",""]]}], "S":"0ee74be4a23f649a980153d0fdc9c45f"}
|
|
|
app/code/local/Qualityunit/Liveagent/controllers/Adminhtml/LiveagentController.php
CHANGED
|
@@ -47,10 +47,9 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
|
|
| 47 |
$this->doAfterPost();
|
| 48 |
}
|
| 49 |
|
| 50 |
-
private function createDefaultWidget()
|
| 51 |
$connectHelper = new Qualityunit_Liveagent_Helper_Connect();
|
| 52 |
$settings = new Qualityunit_Liveagent_Helper_Settings();
|
| 53 |
-
|
| 54 |
try {
|
| 55 |
$connectHelper->createWidget($settings->getLiveAgentUrl(), $settings->getDefaultWidgetParams());
|
| 56 |
return;
|
|
@@ -70,8 +69,7 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
|
|
| 70 |
$post[Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME],
|
| 71 |
$post[Qualityunit_Liveagent_Helper_Settings::LA_API_KEY]
|
| 72 |
);
|
| 73 |
-
$this->
|
| 74 |
-
$this->renderLayout();
|
| 75 |
} catch (Qualityunit_Liveagent_Exception_ConnectFailed $e) {
|
| 76 |
$this->connectFailed($e);
|
| 77 |
return;
|
|
@@ -219,7 +217,6 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
|
|
| 219 |
} else {
|
| 220 |
$block = new Qualityunit_Liveagent_Block_Signup();
|
| 221 |
}
|
| 222 |
-
//$block = new Qualityunit_Liveagent_Block_Signup();
|
| 223 |
$this->_addContent($this->getLayout()->createBlock($block));
|
| 224 |
}
|
| 225 |
|
|
@@ -231,7 +228,7 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
|
|
| 231 |
$connectHelper = new Qualityunit_Liveagent_Helper_Connect();
|
| 232 |
try {
|
| 233 |
$response = $connectHelper->connectWithLA($url, $email, $apikey);
|
| 234 |
-
$this->saveAccountDetails($email, $url, $
|
| 235 |
} catch (Qualityunit_Liveagent_Exception_Base $e) {
|
| 236 |
throw new Qualityunit_Liveagent_Exception_ConnectFailed($e->getMessage());
|
| 237 |
}
|
|
@@ -240,7 +237,15 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
|
|
| 240 |
}
|
| 241 |
|
| 242 |
private function saveAccountDetails($email, $domain, $apiKey, $authToken) {
|
| 243 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME, $email);
|
| 245 |
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_API_KEY, $apiKey);
|
| 246 |
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::OWNER_AUTHTOKEN, $authToken);
|
| 47 |
$this->doAfterPost();
|
| 48 |
}
|
| 49 |
|
| 50 |
+
private function createDefaultWidget(){
|
| 51 |
$connectHelper = new Qualityunit_Liveagent_Helper_Connect();
|
| 52 |
$settings = new Qualityunit_Liveagent_Helper_Settings();
|
|
|
|
| 53 |
try {
|
| 54 |
$connectHelper->createWidget($settings->getLiveAgentUrl(), $settings->getDefaultWidgetParams());
|
| 55 |
return;
|
| 69 |
$post[Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME],
|
| 70 |
$post[Qualityunit_Liveagent_Helper_Settings::LA_API_KEY]
|
| 71 |
);
|
| 72 |
+
$this->_redirect('*/*');
|
|
|
|
| 73 |
} catch (Qualityunit_Liveagent_Exception_ConnectFailed $e) {
|
| 74 |
$this->connectFailed($e);
|
| 75 |
return;
|
| 217 |
} else {
|
| 218 |
$block = new Qualityunit_Liveagent_Block_Signup();
|
| 219 |
}
|
|
|
|
| 220 |
$this->_addContent($this->getLayout()->createBlock($block));
|
| 221 |
}
|
| 222 |
|
| 228 |
$connectHelper = new Qualityunit_Liveagent_Helper_Connect();
|
| 229 |
try {
|
| 230 |
$response = $connectHelper->connectWithLA($url, $email, $apikey);
|
| 231 |
+
$this->saveAccountDetails($email, $url, $apikey, $response->authtoken);
|
| 232 |
} catch (Qualityunit_Liveagent_Exception_Base $e) {
|
| 233 |
throw new Qualityunit_Liveagent_Exception_ConnectFailed($e->getMessage());
|
| 234 |
}
|
| 237 |
}
|
| 238 |
|
| 239 |
private function saveAccountDetails($email, $domain, $apiKey, $authToken) {
|
| 240 |
+
if ((strpos($domain, 'http:') === false) && (strpos($domain, 'https:') === false)) {
|
| 241 |
+
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME, 'http://' . $domain . '.ladesk.com/');
|
| 242 |
+
} else {
|
| 243 |
+
if (substr($domain, -1) != '/') {
|
| 244 |
+
$domain .= '/';
|
| 245 |
+
}
|
| 246 |
+
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME, $domain);
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_OWNER_EMAIL_SETTING_NAME, $email);
|
| 250 |
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_API_KEY, $apiKey);
|
| 251 |
$this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::OWNER_AUTHTOKEN, $authToken);
|
app/code/local/Qualityunit/Liveagent/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Qualityunit_Liveagent>
|
| 5 |
-
<version>1.0.
|
| 6 |
</Qualityunit_Liveagent>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
|
@@ -21,17 +21,17 @@
|
|
| 21 |
<file>liveagent.xml</file>
|
| 22 |
</liveagent>
|
| 23 |
</updates>
|
| 24 |
-
</layout>
|
| 25 |
</frontend>
|
| 26 |
<admin>
|
| 27 |
<routers>
|
| 28 |
-
<
|
| 29 |
-
<use>admin</use>
|
| 30 |
<args>
|
| 31 |
-
<
|
| 32 |
-
|
|
|
|
| 33 |
</args>
|
| 34 |
-
</
|
| 35 |
</routers>
|
| 36 |
</admin>
|
| 37 |
<adminhtml>
|
|
@@ -47,11 +47,11 @@
|
|
| 47 |
<title>LiveAgent</title>
|
| 48 |
<sort_order>71</sort_order>
|
| 49 |
<children>
|
| 50 |
-
<
|
| 51 |
<title>Account settings</title>
|
| 52 |
<sort_order>0</sort_order>
|
| 53 |
-
<action>liveagent/
|
| 54 |
-
</
|
| 55 |
</children>
|
| 56 |
</liveagent>
|
| 57 |
</menu>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Qualityunit_Liveagent>
|
| 5 |
+
<version>1.0.1</version>
|
| 6 |
</Qualityunit_Liveagent>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
| 21 |
<file>liveagent.xml</file>
|
| 22 |
</liveagent>
|
| 23 |
</updates>
|
| 24 |
+
</layout>
|
| 25 |
</frontend>
|
| 26 |
<admin>
|
| 27 |
<routers>
|
| 28 |
+
<adminhtml>
|
|
|
|
| 29 |
<args>
|
| 30 |
+
<modules>
|
| 31 |
+
<liveagent after="Mage_Adminhtml">Qualityunit_Liveagent_Adminhtml</liveagent>
|
| 32 |
+
</modules>
|
| 33 |
</args>
|
| 34 |
+
</adminhtml>
|
| 35 |
</routers>
|
| 36 |
</admin>
|
| 37 |
<adminhtml>
|
| 47 |
<title>LiveAgent</title>
|
| 48 |
<sort_order>71</sort_order>
|
| 49 |
<children>
|
| 50 |
+
<accountconnect module="liveagent" translate="title">
|
| 51 |
<title>Account settings</title>
|
| 52 |
<sort_order>0</sort_order>
|
| 53 |
+
<action>adminhtml/liveagent/index</action>
|
| 54 |
+
</accountconnect>
|
| 55 |
</children>
|
| 56 |
</liveagent>
|
| 57 |
</menu>
|
app/design/adminhtml/default/default/layout/liveagent.xml
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<layout version="0.2.0">
|
| 3 |
-
<
|
| 4 |
<reference name="head">
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
</reference>
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
</
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
</reference>
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
</layout>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<layout version="0.2.0">
|
| 3 |
+
<adminhtml_liveagent_index>
|
| 4 |
<reference name="head">
|
| 5 |
+
<action method="addItem"><type>skin_js</type><name>liveagent/js/jquery-1.11.3.min.js</name></action>
|
| 6 |
+
<action method="addItem"><type>skin_js</type><name>liveagent/js/jquery-no-conflict.js</name></action>
|
| 7 |
+
<action method="addItem"><type>skin_js</type><name>liveagent/js/jquery.alphanum.js</name></action>
|
| 8 |
+
<action method="addItem"><type>skin_js</type><name>liveagent/js/jquery.cookie.js</name></action>
|
| 9 |
+
<action method="addItem"><type>skin_js</type><name>liveagent/js/jquery.validate.min.js</name></action>
|
| 10 |
+
<action method="addItem"><type>skin_js</type><name>liveagent/js/lasignup.js</name></action>
|
| 11 |
+
|
| 12 |
+
<action method="addItem"><type>skin_css</type><name>liveagent/css/animation.css</name></action>
|
| 13 |
+
<action method="addItem"><type>skin_css</type><name>liveagent/css/responsive.css</name></action>
|
| 14 |
+
<action method="addItem"><type>skin_css</type><name>liveagent/css/style.css</name></action>
|
| 15 |
</reference>
|
| 16 |
|
| 17 |
+
<reference name="content">
|
| 18 |
+
<block type="core/template" name="liveagent_button" template="liveagent/button.phtml" />
|
| 19 |
+
</reference>
|
| 20 |
+
</adminhtml_liveagent_index>
|
| 21 |
|
| 22 |
+
<adminhtml_dashboard_index>
|
| 23 |
+
<reference name="head">
|
| 24 |
+
<action method="addItem"><type>skin_css</type><name>liveagent/css/report.css</name></action>
|
| 25 |
</reference>
|
| 26 |
|
| 27 |
+
<reference name="content">
|
| 28 |
+
<block type="adminhtml/dashboard_totals" name="liveagent_report" template="liveagent/report.phtml" />
|
| 29 |
+
</reference>
|
| 30 |
+
</adminhtml_dashboard_index>
|
| 31 |
</layout>
|
app/design/adminhtml/default/default/template/liveagent/button.phtml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
// display in admin?
|
| 3 |
+
$display = Mage::getModel('liveagent/settings')->load('la-display-in-admin', 'name');
|
| 4 |
+
if ($display->getValue() == '') {
|
| 5 |
+
return;
|
| 6 |
+
}
|
| 7 |
+
$setting = Mage::getModel('liveagent/settings')->load('la-config-button-code', 'name');
|
| 8 |
+
$settings = Mage::getModel('liveagent/settings');
|
| 9 |
+
if ($setting->getValue() != '') {
|
| 10 |
+
$result = $settings->replacePlaceholders($setting->getData('value'));
|
| 11 |
+
echo $result;
|
| 12 |
+
}
|
| 13 |
+
?>
|
app/design/adminhtml/default/default/template/liveagent/report.phtml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div id="LAReport">
|
| 2 |
+
<h3 class="LAlogo">Overview:</h3>
|
| 3 |
+
|
| 4 |
+
<?php
|
| 5 |
+
$settings = Mage::getModel('liveagent/settings');
|
| 6 |
+
$overviews = $settings->getChatsOverview();
|
| 7 |
+
if ($overviews['error'] != '') {
|
| 8 |
+
$body = $overviews['error'];
|
| 9 |
+
}
|
| 10 |
+
else {
|
| 11 |
+
$body = '<div class="reportBoxMain"><div class="reportBox Title">Visitors</div><div class="reportBox Value">'.$overviews['visitors'].'</div></div>';
|
| 12 |
+
$body .= '<div class="reportBoxMain"><div class="reportBox Title">Chats</div><div class="reportBox Value">'.$overviews['chats'].'</div></div>';
|
| 13 |
+
$body .= '<div class="reportBoxMain"><div class="reportBox Title">Queue</div><div class="reportBox Value">'.$overviews['queue'].'</div></div>';
|
| 14 |
+
$body .= '<div class="reportBoxMain"><div class="reportBox Title">Agents</div><div class="reportBox Value">'.$overviews['agents'].'</div></div>';
|
| 15 |
+
}
|
| 16 |
+
?>
|
| 17 |
+
<div id="reportBoxContainer">
|
| 18 |
+
<?php echo $body; ?>
|
| 19 |
+
</div>
|
| 20 |
+
</div>
|
app/etc/modules/Qualityunit_Liveagent.xml
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
<Qualityunit_Liveagent>
|
| 5 |
<active>true</active>
|
| 6 |
<codePool>local</codePool>
|
| 7 |
-
|
| 8 |
</Qualityunit_Liveagent>
|
| 9 |
</modules>
|
| 10 |
</config>
|
| 4 |
<Qualityunit_Liveagent>
|
| 5 |
<active>true</active>
|
| 6 |
<codePool>local</codePool>
|
| 7 |
+
<version>1.0.1</version>
|
| 8 |
</Qualityunit_Liveagent>
|
| 9 |
</modules>
|
| 10 |
</config>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Liveagent</name>
|
| 4 |
-
<version>3.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -9,11 +9,11 @@
|
|
| 9 |
<summary>LiveAgent plugin integrates well known help desk and live chat software into any Magento installation. No HTML knowledge is required.</summary>
|
| 10 |
<description>Magento-LiveAgent plugin integrates full featured help desk and live chat software Live Agent into any Magento installation.
|
| 11 |
Start by entering your existing account details or easily create one and then just choose which button you want to use for you shop. You are done in few clicks!</description>
|
| 12 |
-
<notes>
|
| 13 |
<authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
|
| 14 |
-
<date>2015-10-
|
| 15 |
-
<time>
|
| 16 |
-
<contents><target name="magelocal"><dir name="Qualityunit"><dir name="Liveagent"><dir name="Block"><file name="AccountConnect.php" hash="
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
|
| 19 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Liveagent</name>
|
| 4 |
+
<version>3.0.1</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</license>
|
| 7 |
<channel>community</channel>
|
| 9 |
<summary>LiveAgent plugin integrates well known help desk and live chat software into any Magento installation. No HTML knowledge is required.</summary>
|
| 10 |
<description>Magento-LiveAgent plugin integrates full featured help desk and live chat software Live Agent into any Magento installation.
|
| 11 |
Start by entering your existing account details or easily create one and then just choose which button you want to use for you shop. You are done in few clicks!</description>
|
| 12 |
+
<notes>Default button will now support Offline Form.</notes>
|
| 13 |
<authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
|
| 14 |
+
<date>2015-10-29</date>
|
| 15 |
+
<time>11:55:01</time>
|
| 16 |
+
<contents><target name="magelocal"><dir name="Qualityunit"><dir name="Liveagent"><dir name="Block"><file name="AccountConnect.php" hash="8e1d5a6f83b283c440fccaf7c60c3c10"/><file name="Base.php" hash="86155f5e3264655ceb130dab28c405b6"/><file name="Buttoncode.php" hash="5a7c60199f39ac77d7ccfb2bec3ce2a7"/><file name="Signup.php" hash="4b5c66377a62f53696866964a386cef5"/></dir><dir name="Exception"><file name="Base.php" hash="c54d68353f3f7d765baac10f8900af16"/><file name="ConnectFailed.php" hash="af790857c2ee9972eb1dd0df6b90de68"/><file name="ConnectProblem.php" hash="dd2df3be3af51a621b7ec9df1fd5f8fb"/><file name="SignupFailed.php" hash="88fadc5990ec7a6fce5e1feb8c931ffa"/></dir><dir name="Helper"><file name="Account.php" hash="f4b560d1baff04f76f3fb03051e030f8"/><file name="Connect.php" hash="ff7d4707a8897ffc7c9f720fa7ff9f20"/><file name="Data.php" hash="9bd5c406141e8b7e62d725815bde5d2e"/><file name="Settings.php" hash="0ccc392ed93d70a39608b49e66dd993a"/></dir><dir name="Model"><file name="Buttons.php" hash="3c8e6136df4111c3100919b107ba6726"/><file name="Liveagent.php" hash="2c08986c55f107c7398c8f4e7ba99737"/><dir name="Mysql4"><dir name="Buttons"><file name="Collection.php" hash="64edb5ecfc9b1511ae155f347e9a0e6b"/></dir><file name="Buttons.php" hash="5c2fd7184c1bb88b381ef8440bfe1e4f"/><dir name="Liveagent"><file name="Collection.php" hash="29675fde5a317fdf980a549f40502b8e"/></dir><file name="Liveagent.php" hash="559e305b52289e79f9038aea53a85a48"/><dir name="Settings"><file name="Collection.php" hash="d9dfc6b2abadf95ad6dbdee9f52f9c28"/></dir><file name="Settings.php" hash="cdded3171b84b02ed4ad360dd3cb7b71"/></dir><file name="Settings.php" hash="8c4b3b2943a6e92592481a31107abc45"/><file name="Status.php" hash="4e2f42f52c7cdc51388ce9dee5d2f85a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LiveagentController.php" hash="06fd82a6e114265b876d9d3852c031cf"/></dir><file name="IndexController.php" hash="2af5a61bf7319c38c97a48e0f3723598"/></dir><dir name="etc"><file name="config.xml" hash="6294cd778c3f192cbd9958e7b8f30e3f"/></dir><dir name="sql"><dir name="liveagent_setup"><file name="mysql4-install-0.1.0.php" hash="68891e5aca423bbb7226975413cd82b8"/><file name="mysql4-install-2.5.4.php" hash="2bd7ec4b4c8a366bed9f3afc264ae897"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="liveagent.xml" hash="5a77968b68e659dc21bdad2605210333"/></dir><dir name="template"><dir name="liveagent"><file name="button.phtml" hash="dfe28e1f477153f996c8718a49a758cd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="liveagent.xml" hash="a352f2029be0457410b0939c3aa4b62f"/></dir><dir name="template"><dir name="liveagent"><file name="button.phtml" hash="102ff91b93dfe01c8ac1ba4e6ed5d2ae"/><file name="report.phtml" hash="2100c3c18095186bd660c6cb66c00fc5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qualityunit_Liveagent.xml" hash="580a8813ec1e339d88885026dc4bef23"/></dir></target><target name="magelocale"><dir name="en_US"><file name="qualityunit_liveagent.csv" hash="ddb1b449beb20afedd1d63abb446fc4e"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="liveagent"><dir name="css"><file name="animation.css" hash="e114422983f975cac20edbe5a12fdb37"/><dir name="fonts"><file name="OpenSans-Bold-webfont.eot" hash="7e78b345bbb56eb154a32396524b5650"/><file name="OpenSans-Bold-webfont.svg" hash="ba40976c12378dfdcd0c0b1b2747421b"/><file name="OpenSans-Bold-webfont.ttf" hash="0b6240e6a9217e44e77bbda8a2ed2bb0"/><file name="OpenSans-Bold-webfont.woff" hash="769a36776804007ab23b7266b22be392"/><file name="OpenSans-Light-webfont.eot" hash="5d5f7deb21a0609f0b12ae5332cfb6b9"/><file name="OpenSans-Light-webfont.svg" hash="93d6578a9051feb87bf857cbb3cabdb7"/><file name="OpenSans-Light-webfont.ttf" hash="4eb5ea0a1bc989d3bfeb9423be53e78f"/><file name="OpenSans-Light-webfont.woff" hash="798bf3bb0819ff94c7c8fd0142f58d22"/><file name="OpenSans-Regular-webfont.eot" hash="3b721cb588d7b323137bd456c237b116"/><file name="OpenSans-Regular-webfont.svg" hash="3b461c91b64d27057676c1a4562b3a15"/><file name="OpenSans-Regular-webfont.ttf" hash="50700928d66c83bc7501ce99690b265a"/><file name="OpenSans-Regular-webfont.woff" hash="9e002ce4035a849d41b9ba83993083d7"/></dir><file name="la_logo.svg" hash="686ec663e568d38de97df58b915f95f6"/><file name="lock.png" hash="7380f52e49851581388b2cd7c8a5d7bd"/><file name="ok_icon.png" hash="e66785de1c506b6f9635d97f35e0c7df"/><file name="report.css" hash="6d75d81d824b4f02db7ab63e595a85cc"/><file name="responsive.css" hash="a3dff048c1feec42f1efc8f066a70a0f"/><file name="style.css" hash="80a65f7af565b5840adc51b724325e8c"/><file name="video.jpg" hash="57d38a4cb802f6009f2f3b0a768d6fc2"/></dir><dir name="js"><file name="jquery-1.11.3.min.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="jquery-no-conflict.js" hash="644f0006e36a235d2a6df494bed48636"/><file name="jquery.alphanum.js" hash="3610a43bb5a6892f7e1aae03f05582c2"/><file name="jquery.cookie.js" hash="d5528dde0006c78be04817327c2f9b6f"/><file name="jquery.validate.min.js" hash="d7342d64b483db4cdc836047765c07f3"/><file name="lasignup.js" hash="d4bf9d823de842bcc864499c8d212c5a"/></dir></dir></dir></dir></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
|
| 19 |
</package>
|
skin/adminhtml/default/default/liveagent/js/lasignup.js
CHANGED
|
@@ -143,6 +143,7 @@ jQuery(function($) {
|
|
| 143 |
var res = $("textarea#" + buttonId).val();
|
| 144 |
$("textarea#la-config-button-code").val(res);
|
| 145 |
$("#buttonId").val(buttonId);
|
|
|
|
| 146 |
$("#configForm").submit();
|
| 147 |
};
|
| 148 |
|
|
@@ -280,6 +281,26 @@ jQuery(function($) {
|
|
| 280 |
}
|
| 281 |
return randomstring;
|
| 282 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
|
| 284 |
if (typeof productid == 'undefined') {
|
| 285 |
productid = default_productid;
|
|
@@ -372,23 +393,7 @@ jQuery(function($) {
|
|
| 372 |
});
|
| 373 |
|
| 374 |
$('.configOptions input').change(function () {
|
| 375 |
-
|
| 376 |
-
var pos = widgetCode.indexOf("function(e){") + 13;
|
| 377 |
-
var result = '';
|
| 378 |
-
if ($('#configOptionName').is(':checked')) {
|
| 379 |
-
result += "%%firstName%%%%lastName%%";
|
| 380 |
-
}
|
| 381 |
-
if ($('#configOptionEmail').is(':checked')) {
|
| 382 |
-
result += "%%email%%";
|
| 383 |
-
}
|
| 384 |
-
if ($('#configOptionPhone').is(':checked')) {
|
| 385 |
-
result += "%%phone%%";
|
| 386 |
-
}
|
| 387 |
-
/*if ($('#configOptionOrder').is(':checked')) {
|
| 388 |
-
result += "%%order%%";
|
| 389 |
-
}*/
|
| 390 |
-
$('textarea#la-config-button-code').val([widgetCode.slice(0, pos), result, widgetCode.slice(pos)].join(''));
|
| 391 |
-
$('.SaveWidgetCode').show();
|
| 392 |
});
|
| 393 |
});
|
| 394 |
|
| 143 |
var res = $("textarea#" + buttonId).val();
|
| 144 |
$("textarea#la-config-button-code").val(res);
|
| 145 |
$("#buttonId").val(buttonId);
|
| 146 |
+
replacePlaceholder();
|
| 147 |
$("#configForm").submit();
|
| 148 |
};
|
| 149 |
|
| 281 |
}
|
| 282 |
return randomstring;
|
| 283 |
}
|
| 284 |
+
|
| 285 |
+
var replacePlaceholder = function() {
|
| 286 |
+
var widgetCode = $('textarea#' + $('#buttonId').val() ).val();
|
| 287 |
+
var pos = widgetCode.indexOf("function(e){") + 13;
|
| 288 |
+
var result = '';
|
| 289 |
+
if ($('#configOptionName').is(':checked')) {
|
| 290 |
+
result += "%%firstName%%%%lastName%%";
|
| 291 |
+
}
|
| 292 |
+
if ($('#configOptionEmail').is(':checked')) {
|
| 293 |
+
result += "%%email%%";
|
| 294 |
+
}
|
| 295 |
+
if ($('#configOptionPhone').is(':checked')) {
|
| 296 |
+
result += "%%phone%%";
|
| 297 |
+
}
|
| 298 |
+
/*if ($('#configOptionOrder').is(':checked')) {
|
| 299 |
+
result += "%%order%%";
|
| 300 |
+
}*/
|
| 301 |
+
$('textarea#la-config-button-code').val([widgetCode.slice(0, pos), result, widgetCode.slice(pos)].join(''));
|
| 302 |
+
$('.SaveWidgetCode').show();
|
| 303 |
+
}
|
| 304 |
|
| 305 |
if (typeof productid == 'undefined') {
|
| 306 |
productid = default_productid;
|
| 393 |
});
|
| 394 |
|
| 395 |
$('.configOptions input').change(function () {
|
| 396 |
+
replacePlaceholder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
});
|
| 398 |
});
|
| 399 |
|
