Version Notes
Fixed the issue of table prefix.
Download this release
Release Info
Developer | Iverve |
Extension | Ifuturz_Questionanswer |
Version | 0.4.0 |
Comparing to | |
See all releases |
Code changes from version 0.3.0 to 0.4.0
app/code/local/Ifuturz/Questionanswer/Model/Observer.php
CHANGED
@@ -7,13 +7,15 @@ class Ifuturz_Questionanswer_Model_Observer
|
|
7 |
public function checkInstallation($observer)
|
8 |
{
|
9 |
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
10 |
-
$
|
|
|
|
|
11 |
$data = $read->fetchAll($sql);
|
12 |
if(count($data)==1)
|
13 |
{
|
14 |
-
|
15 |
-
$admindata = $read->fetchAll("SELECT email FROM
|
16 |
-
|
17 |
$storename = Mage::getStoreConfig('general/store_information/name');
|
18 |
$storephone = Mage::getStoreConfig('general/store_information/phone');
|
19 |
$store_address = Mage::getStoreConfig('general/store_information/address');
|
@@ -36,7 +38,7 @@ class Ifuturz_Questionanswer_Model_Observer
|
|
36 |
try{
|
37 |
$mail->send();
|
38 |
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
39 |
-
$write->query("update
|
40 |
}
|
41 |
catch(Exception $e)
|
42 |
{
|
7 |
public function checkInstallation($observer)
|
8 |
{
|
9 |
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
10 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
11 |
+
$table_name = $prefix.'questionanswer_lck';
|
12 |
+
$sql ="SELECT * FROM ".$table_name." WHERE flag='LCK' AND value='1'";
|
13 |
$data = $read->fetchAll($sql);
|
14 |
if(count($data)==1)
|
15 |
{
|
16 |
+
$admintable = $prefix.'admin_user';
|
17 |
+
$admindata = $read->fetchAll("SELECT email FROM ".$admintable." WHERE username='admin'");
|
18 |
+
|
19 |
$storename = Mage::getStoreConfig('general/store_information/name');
|
20 |
$storephone = Mage::getStoreConfig('general/store_information/phone');
|
21 |
$store_address = Mage::getStoreConfig('general/store_information/address');
|
38 |
try{
|
39 |
$mail->send();
|
40 |
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
41 |
+
$write->query("update ".$table_name." set value='0' where flag='LCK'");
|
42 |
}
|
43 |
catch(Exception $e)
|
44 |
{
|
app/code/local/Ifuturz/Questionanswer/controllers/IndexController.php
CHANGED
@@ -14,8 +14,9 @@ class Ifuturz_Questionanswer_IndexController extends Mage_Core_Controller_Front_
|
|
14 |
|
15 |
if ($data = $this->getRequest()->getPost())
|
16 |
{
|
17 |
-
$pageurl = $this->getRequest()->getParam('currenturl');
|
18 |
-
$
|
|
|
19 |
$model = Mage::getModel('questionanswer/questionanswer');
|
20 |
$model->setData($data)
|
21 |
->setId($this->getRequest()->getParam('id'));
|
@@ -33,7 +34,7 @@ class Ifuturz_Questionanswer_IndexController extends Mage_Core_Controller_Front_
|
|
33 |
$model->save();
|
34 |
Mage::getSingleton('core/session')->addSuccess(Mage::helper('questionanswer')->__('Question was successfully Submitted'));
|
35 |
Mage::getSingleton('core/session')->setFormData(false);
|
36 |
-
$this->
|
37 |
return;
|
38 |
}
|
39 |
catch (Exception $e)
|
@@ -45,7 +46,7 @@ class Ifuturz_Questionanswer_IndexController extends Mage_Core_Controller_Front_
|
|
45 |
}
|
46 |
}
|
47 |
Mage::getSingleton('core/session')->addError(Mage::helper('questionanswer')->__('Unable to find Question to save'));
|
48 |
-
$this->
|
49 |
}
|
50 |
|
51 |
public function filterAction()
|
14 |
|
15 |
if ($data = $this->getRequest()->getPost())
|
16 |
{
|
17 |
+
$pageurl = $this->getRequest()->getParam('currenturl');
|
18 |
+
$postdata = $this->getRequest()->getPost();
|
19 |
+
$producturl = Mage::getModel('catalog/product')->load($postdata['product_id'])->getProductUrl();
|
20 |
$model = Mage::getModel('questionanswer/questionanswer');
|
21 |
$model->setData($data)
|
22 |
->setId($this->getRequest()->getParam('id'));
|
34 |
$model->save();
|
35 |
Mage::getSingleton('core/session')->addSuccess(Mage::helper('questionanswer')->__('Question was successfully Submitted'));
|
36 |
Mage::getSingleton('core/session')->setFormData(false);
|
37 |
+
$this->_redirectUrl($producturl);
|
38 |
return;
|
39 |
}
|
40 |
catch (Exception $e)
|
46 |
}
|
47 |
}
|
48 |
Mage::getSingleton('core/session')->addError(Mage::helper('questionanswer')->__('Unable to find Question to save'));
|
49 |
+
$this->_redirectUrl($producturl);
|
50 |
}
|
51 |
|
52 |
public function filterAction()
|
app/design/frontend/base/default/template/questionanswer/form.phtml
CHANGED
@@ -124,11 +124,17 @@ jQuery(document).ready(function() {
|
|
124 |
|
125 |
jQuery('#searchque').click(function(){
|
126 |
|
127 |
-
var searchval = jQuery("#searchtext").val();
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
jQuery.post("<?php echo Mage::getBaseUrl()?>questionanswer/index/searchquestion", {searchvalue: searchval, proid: '<?php echo $pid?>' },
|
129 |
function(data)
|
130 |
{
|
131 |
-
pattern = new RegExp(searchval, '
|
132 |
data = data.replace(pattern,'<span class="highlight">'+ searchval + '</span>' );
|
133 |
jQuery('#updatequeans').html(data);
|
134 |
});
|
124 |
|
125 |
jQuery('#searchque').click(function(){
|
126 |
|
127 |
+
var searchval = jQuery("#searchtext").val();
|
128 |
+
if(searchval == '')
|
129 |
+
{
|
130 |
+
alert("Please insert the searched keword.")
|
131 |
+
jQuery("#searchtext").focus();
|
132 |
+
return false;
|
133 |
+
}
|
134 |
jQuery.post("<?php echo Mage::getBaseUrl()?>questionanswer/index/searchquestion", {searchvalue: searchval, proid: '<?php echo $pid?>' },
|
135 |
function(data)
|
136 |
{
|
137 |
+
pattern = new RegExp(searchval, 'ig');
|
138 |
data = data.replace(pattern,'<span class="highlight">'+ searchval + '</span>' );
|
139 |
jQuery('#updatequeans').html(data);
|
140 |
});
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ifuturz_Questionanswer</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -26,13 +26,11 @@ Moreover, it is helpful for the new customers to know more about the product bef
|
|
26 |
8) Like-Dislike feature for users to rate helpfulness
|
27 |

|
28 |
9) User can search a particular question-answer from the search option given here and in result page that searched keyword will be highlighted.</description>
|
29 |
-
<notes>
|
30 |
-

|
31 |
-
Fixed the issue of index.php in URL and displayed the products question-answer tab in product info tab on product detail page.</notes>
|
32 |
<authors><author><name>Iverve</name><user>iverve</user><email>extension.geek@ifuturz.com</email></author></authors>
|
33 |
-
<date>2015-
|
34 |
-
<time>
|
35 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Ifuturz_Questionanswer.xml" hash="55aedd4e9da5c9ba631b86ea0041ca35"/></dir></target><target name="magelocal"><dir name="Ifuturz"><dir name="Questionanswer"><dir name="Block"><dir name="Adminhtml"><dir name="Questionanswer"><dir name="Edit"><file name="Edit.php" hash="3460d9124fc6b96f9a122ae839deffa0"/><file name="Form.php" hash="b585dbf63b419eaecbe2db0643a1f564"/><dir name="Tab"><file name="Form.php" hash="d5f5ab76a6eaec88d03e2eace2bdaa3e"/></dir><file name="Tabs.php" hash="85b15043650897679d9b469c2ec39d82"/></dir><file name="Edit.php" hash="3460d9124fc6b96f9a122ae839deffa0"/><file name="Grid.php" hash="78eebc44212068f55f7ed276ea3ed6eb"/></dir><file name="Questionanswer.php" hash="2383771f591fd2c985a1261db4929124"/></dir><file name="Questionanswer.php" hash="976842fe4d6d55790627d88aaaff89ff"/></dir><dir name="Helper"><file name="Data.php" hash="124155d352c880c9aab2d989dac933c3"/></dir><dir name="Model"><file name="Likedislike.php" hash="cc77f99c63efededc03b5ab88bb1b267"/><dir name="Mysql4"><dir name="Likedislike"><file name="Collection.php" hash="dda2b6322f2850c7ed9b6c7b7329788f"/></dir><file name="Likedislike.php" hash="53472ce14e2a9fdab48f96ffffe4f46d"/><dir name="Questionanswer"><file name="Collection.php" hash="ca5bf89b87aa408c9f92093cb2d12b11"/></dir><file name="Questionanswer.php" hash="02a859275c940b689f32ef19b13d1c99"/></dir><file name="Observer.php" hash="
|
36 |
<compatible/>
|
37 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
38 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ifuturz_Questionanswer</name>
|
4 |
+
<version>0.4.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
26 |
8) Like-Dislike feature for users to rate helpfulness
|
27 |

|
28 |
9) User can search a particular question-answer from the search option given here and in result page that searched keyword will be highlighted.</description>
|
29 |
+
<notes>Fixed the issue of table prefix.</notes>
|
|
|
|
|
30 |
<authors><author><name>Iverve</name><user>iverve</user><email>extension.geek@ifuturz.com</email></author></authors>
|
31 |
+
<date>2015-10-07</date>
|
32 |
+
<time>09:20:04</time>
|
33 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Ifuturz_Questionanswer.xml" hash="55aedd4e9da5c9ba631b86ea0041ca35"/></dir></target><target name="magelocal"><dir name="Ifuturz"><dir name="Questionanswer"><dir name="Block"><dir name="Adminhtml"><dir name="Questionanswer"><dir name="Edit"><file name="Edit.php" hash="3460d9124fc6b96f9a122ae839deffa0"/><file name="Form.php" hash="b585dbf63b419eaecbe2db0643a1f564"/><dir name="Tab"><file name="Form.php" hash="d5f5ab76a6eaec88d03e2eace2bdaa3e"/></dir><file name="Tabs.php" hash="85b15043650897679d9b469c2ec39d82"/></dir><file name="Edit.php" hash="3460d9124fc6b96f9a122ae839deffa0"/><file name="Grid.php" hash="78eebc44212068f55f7ed276ea3ed6eb"/></dir><file name="Questionanswer.php" hash="2383771f591fd2c985a1261db4929124"/></dir><file name="Questionanswer.php" hash="976842fe4d6d55790627d88aaaff89ff"/></dir><dir name="Helper"><file name="Data.php" hash="124155d352c880c9aab2d989dac933c3"/></dir><dir name="Model"><file name="Likedislike.php" hash="cc77f99c63efededc03b5ab88bb1b267"/><dir name="Mysql4"><dir name="Likedislike"><file name="Collection.php" hash="dda2b6322f2850c7ed9b6c7b7329788f"/></dir><file name="Likedislike.php" hash="53472ce14e2a9fdab48f96ffffe4f46d"/><dir name="Questionanswer"><file name="Collection.php" hash="ca5bf89b87aa408c9f92093cb2d12b11"/></dir><file name="Questionanswer.php" hash="02a859275c940b689f32ef19b13d1c99"/></dir><file name="Observer.php" hash="2515a694bc2b251249f47135a4c5385c"/><file name="Questionanswer.php" hash="4a74426f2d0451dd506d7743ab66c8ab"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="QuestionanswerController.php" hash="deeb6799ca57c809f81c326c09910a3d"/></dir><file name="IndexController.php" hash="3c444c3a67061137d77839c696d19914"/></dir><dir name="etc"><file name="config.xml" hash="7e39b8c0c307c469125cc778a9243c3a"/></dir><dir name="sql"><dir name="questionanswer_setup"><file name="mysql4-install-0.1.0.php" hash="d8d7148d64504db234764b4a60b12048"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="a062aacc0870355924a4ec8b3e2ad999"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="questionanswer.xml" hash="05befdd50d5601d0c6c907c3a3d71afc"/></dir><dir name="template"><dir name="questionanswer"><file name="form.phtml" hash="639bce0c781d5e1539b9226bc276caba"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="questionanswer"><file name="form.phtml" hash="b7efde7991e3878d556866379e02eff3"/><file name="newquestion.phtml" hash="f645bfe33297d60e3e04362160143f95"/><file name="questionanswer_list.phtml" hash="6d6af6b77d7671dcd34e6eed42b4aae3"/></dir></dir><dir name="layout"><file name="questionanswer.xml" hash="8aee8cd064c07786113f4c307e605718"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="question_answer.html" hash="a76eb8f55f872956dc0f5a1b7f383a11"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="questionanswer"><file name="jquery-1.7.1.min.js" hash="4bab8348a52d17428f684ad1ec3a427e"/><file name="jquery_noconflict.js" hash="afdd9b4ecb226d898fe655136f849752"/></dir></dir><dir name="css"><dir name="questionanswer"><file name="ProductQA.css" hash="b3bdebbfaf3a797ea823d3a9aeca435b"/><file name="font-awesome.min.css" hash="feda974a77ea5783b8be673f142b7c88"/></dir><dir name="fonts"><file name="FontAwesome.otf" hash="19231917733e2bcdf257c9be99cdbaf1"/><file name="fontawesome-webfont.eot" hash="7149833697a959306ec3012a8588dcfa"/><file name="fontawesome-webfont.svg" hash="65bcbc899f379216109acd0b6c494618"/><file name="fontawesome-webfont.ttf" hash="c4668ed2440df82d3fd2f8be9d31d07d"/><file name="fontawesome-webfont.woff" hash="d95d6f5d5ab7cfefd09651800b69bd54"/></dir></dir><dir name="images"><dir name="questionanswer"><file name="chat_image.png" hash="208ff6087ee59ede92daae178b1c2996"/></dir></dir></dir></dir></dir></target></contents>
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|