Version Notes
Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.
Download this release
Release Info
Developer | Zestard |
Extension | advancedcontactform |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Zestard/Advancecontactform/controllers/IndexController.php +3 -20
- app/code/community/Zestard/Advancecontactform/etc/config.xml +2 -3
- app/code/community/Zestard/Advancecontactform/etc/system.xml +87 -71
- app/design/frontend/base/default/template/advancecontactform/advancecontactform.phtml +3 -2
- package.xml +6 -6
- skin/adminhtml/default/default/images/acf/zestard-logo.png +0 -0
app/code/community/Zestard/Advancecontactform/controllers/IndexController.php
CHANGED
@@ -33,13 +33,11 @@
|
|
33 |
*/
|
34 |
class Zestard_Advancecontactform_IndexController extends Mage_Core_Controller_Front_Action
|
35 |
{
|
36 |
-
|
37 |
public function indexAction()
|
38 |
{
|
39 |
$this->loadLayout();
|
40 |
$this->getLayout()->getBlock('advancecontactForm')
|
41 |
->setFormAction( Mage::getUrl('*/*/post') );
|
42 |
-
|
43 |
$this->_initLayoutMessages('customer/session');
|
44 |
$this->_initLayoutMessages('catalog/session');
|
45 |
$this->renderLayout();
|
@@ -47,9 +45,6 @@ class Zestard_Advancecontactform_IndexController extends Mage_Core_Controller_Fr
|
|
47 |
public function postAction()
|
48 |
{
|
49 |
$post = $this->getRequest()->getPost();
|
50 |
-
// echo '<pre>';
|
51 |
-
// print_r($post);
|
52 |
-
// die();
|
53 |
if ( $post ) {
|
54 |
$translate = Mage::getSingleton('core/translate');
|
55 |
/* @var $translate Mage_Core_Model_Translate */
|
@@ -57,9 +52,7 @@ class Zestard_Advancecontactform_IndexController extends Mage_Core_Controller_Fr
|
|
57 |
try {
|
58 |
$postObject = new Varien_Object();
|
59 |
$postObject->setData($post);
|
60 |
-
|
61 |
$error = false;
|
62 |
-
|
63 |
if (!Zend_Validate::is(trim($post['fname']) , 'NotEmpty')) {
|
64 |
$error = true;
|
65 |
}
|
@@ -87,9 +80,7 @@ class Zestard_Advancecontactform_IndexController extends Mage_Core_Controller_Fr
|
|
87 |
if ($error) {
|
88 |
throw new Exception();
|
89 |
}
|
90 |
-
|
91 |
$contactPersons = explode(",", $post["contactperson"]);
|
92 |
-
|
93 |
foreach ($contactPersons as $key => $contactPerson)
|
94 |
{
|
95 |
$mailTemplate = Mage::getModel('core/email_template');
|
@@ -103,33 +94,25 @@ class Zestard_Advancecontactform_IndexController extends Mage_Core_Controller_Fr
|
|
103 |
null,
|
104 |
array('data' => $postObject)
|
105 |
);
|
106 |
-
|
107 |
if (!$mailTemplate->getSentSuccess())
|
108 |
{
|
109 |
throw new Exception();
|
110 |
}
|
111 |
}
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
$translate->setTranslateInline(true);
|
116 |
-
|
117 |
-
Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
|
118 |
$this->_redirect('*/*/index');
|
119 |
-
|
120 |
return;
|
121 |
} catch (Exception $e) {
|
122 |
$translate->setTranslateInline(true);
|
123 |
-
|
124 |
-
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'
|
125 |
));
|
126 |
$this->_redirect('*/*/index');
|
127 |
return;
|
128 |
}
|
129 |
-
|
130 |
} else {
|
131 |
$this->_redirect('*/*/index');
|
132 |
}
|
133 |
}
|
134 |
-
|
135 |
}
|
|
33 |
*/
|
34 |
class Zestard_Advancecontactform_IndexController extends Mage_Core_Controller_Front_Action
|
35 |
{
|
|
|
36 |
public function indexAction()
|
37 |
{
|
38 |
$this->loadLayout();
|
39 |
$this->getLayout()->getBlock('advancecontactForm')
|
40 |
->setFormAction( Mage::getUrl('*/*/post') );
|
|
|
41 |
$this->_initLayoutMessages('customer/session');
|
42 |
$this->_initLayoutMessages('catalog/session');
|
43 |
$this->renderLayout();
|
45 |
public function postAction()
|
46 |
{
|
47 |
$post = $this->getRequest()->getPost();
|
|
|
|
|
|
|
48 |
if ( $post ) {
|
49 |
$translate = Mage::getSingleton('core/translate');
|
50 |
/* @var $translate Mage_Core_Model_Translate */
|
52 |
try {
|
53 |
$postObject = new Varien_Object();
|
54 |
$postObject->setData($post);
|
|
|
55 |
$error = false;
|
|
|
56 |
if (!Zend_Validate::is(trim($post['fname']) , 'NotEmpty')) {
|
57 |
$error = true;
|
58 |
}
|
80 |
if ($error) {
|
81 |
throw new Exception();
|
82 |
}
|
|
|
83 |
$contactPersons = explode(",", $post["contactperson"]);
|
|
|
84 |
foreach ($contactPersons as $key => $contactPerson)
|
85 |
{
|
86 |
$mailTemplate = Mage::getModel('core/email_template');
|
94 |
null,
|
95 |
array('data' => $postObject)
|
96 |
);
|
|
|
97 |
if (!$mailTemplate->getSentSuccess())
|
98 |
{
|
99 |
throw new Exception();
|
100 |
}
|
101 |
}
|
|
|
|
|
|
|
102 |
$translate->setTranslateInline(true);
|
103 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
|
|
|
104 |
$this->_redirect('*/*/index');
|
|
|
105 |
return;
|
106 |
} catch (Exception $e) {
|
107 |
$translate->setTranslateInline(true);
|
108 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'
|
|
|
109 |
));
|
110 |
$this->_redirect('*/*/index');
|
111 |
return;
|
112 |
}
|
|
|
113 |
} else {
|
114 |
$this->_redirect('*/*/index');
|
115 |
}
|
116 |
}
|
|
|
117 |
}
|
118 |
+
?>
|
app/code/community/Zestard/Advancecontactform/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Zestard_Advancecontactform>
|
5 |
-
<version>1.0.
|
6 |
</Zestard_Advancecontactform>
|
7 |
</modules>
|
8 |
|
@@ -10,7 +10,7 @@
|
|
10 |
<acl>
|
11 |
<resources>
|
12 |
<all>
|
13 |
-
<title>
|
14 |
</all>
|
15 |
<admin>
|
16 |
<children>
|
@@ -83,5 +83,4 @@
|
|
83 |
</advancecontactform>
|
84 |
</advancecontactformsetting>
|
85 |
</default>
|
86 |
-
|
87 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Zestard_Advancecontactform>
|
5 |
+
<version>1.0.2</version>
|
6 |
</Zestard_Advancecontactform>
|
7 |
</modules>
|
8 |
|
10 |
<acl>
|
11 |
<resources>
|
12 |
<all>
|
13 |
+
<title>Advance Contact Form</title>
|
14 |
</all>
|
15 |
<admin>
|
16 |
<children>
|
83 |
</advancecontactform>
|
84 |
</advancecontactformsetting>
|
85 |
</default>
|
|
|
86 |
</config>
|
app/code/community/Zestard/Advancecontactform/etc/system.xml
CHANGED
@@ -1,74 +1,90 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
<
|
5 |
-
<label>
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
</tabs>
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
+
<tabs>
|
4 |
+
<zestard translate="label" module="advancecontactform">
|
5 |
+
<label>
|
6 |
+
<![CDATA[
|
7 |
+
<div style="margin-left: -10px;position: absolute;width: 200px;display: inline-block;">
|
8 |
+
<a style="background:transparent;text-align:left;" onclick="redirectSite(event,this)"><img id="zestard_block" src="" alt="ZESTARD" style="float:left;height: 25px;margin-top: -5px;width: 55%;" border="0"/> Extensions</a>
|
9 |
+
</div>
|
10 |
+
<script>
|
11 |
+
function redirectSite(event,obj){
|
12 |
+
event.preventDefault();
|
13 |
+
event.stopPropagation();
|
14 |
+
window.open("http://www.zestard.com/", '_blank');
|
15 |
+
}
|
16 |
+
document.observe('dom:loaded', function() {
|
17 |
+
var n = SKIN_URL.indexOf("adminhtml");
|
18 |
+
$('zestard_block').src = SKIN_URL.substring(0, n) + "adminhtml/default/default/images/acf/zestard-logo.png";
|
19 |
+
});
|
20 |
+
</script>
|
21 |
+
]]>
|
22 |
+
</label>
|
23 |
+
<sort_order>0</sort_order>
|
24 |
+
</zestard>
|
25 |
</tabs>
|
26 |
+
<sections>
|
27 |
+
<advancecontactformsetting translate="label" module="advancecontactform">
|
28 |
+
<label>Advance Contact Form</label>
|
29 |
+
<tab>zestard</tab>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>110</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<groups>
|
36 |
+
<advancecontactform translate="label">
|
37 |
+
<label>Contact Setting</label>
|
38 |
+
<sort_order>1</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
<fields>
|
43 |
+
<advancecontactformstatus translate="">
|
44 |
+
<label>Advance Contact Form Status</label>
|
45 |
+
<frontend_type>select</frontend_type>
|
46 |
+
<sort_order>1</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
50 |
+
</advancecontactformstatus>
|
51 |
+
<sender_email_identity translate="label">
|
52 |
+
<label>Email Sender</label>
|
53 |
+
<frontend_type>select</frontend_type>
|
54 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
55 |
+
<sort_order>5</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>1</show_in_store>
|
59 |
+
<depends>
|
60 |
+
<advancecontactformstatus>1</advancecontactformstatus>
|
61 |
+
</depends>
|
62 |
+
</sender_email_identity>
|
63 |
+
<departmentalcontact translate="advancecontactform">
|
64 |
+
<label>Contacts for Advance Contact Form</label>
|
65 |
+
<frontend_type>text</frontend_type>
|
66 |
+
<sort_order>10</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<depends>
|
70 |
+
<advancecontactformstatus>1</advancecontactformstatus>
|
71 |
+
</depends>
|
72 |
+
<comment>Must be in the format eg: contact name1 | email address1,email address2;contact name3 | email address3;</comment>
|
73 |
+
</departmentalcontact>
|
74 |
+
<advancecontactformtemplate translate="advancecontactform">
|
75 |
+
<label>Email Template for Advance Contact Form</label>
|
76 |
+
<frontend_type>select</frontend_type>
|
77 |
+
<sort_order>20</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
<show_in_website>1</show_in_website>
|
80 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
81 |
+
<depends>
|
82 |
+
<advancecontactformstatus>1</advancecontactformstatus>
|
83 |
+
</depends>
|
84 |
+
</advancecontactformtemplate>
|
85 |
+
</fields>
|
86 |
+
</advancecontactform>
|
87 |
+
</groups>
|
88 |
+
</advancecontactformsetting>
|
89 |
+
</sections>
|
90 |
+
</config>
|
|
app/design/frontend/base/default/template/advancecontactform/advancecontactform.phtml
CHANGED
@@ -25,6 +25,7 @@
|
|
25 |
*/
|
26 |
?>
|
27 |
<?php
|
|
|
28 |
$advancecontactformStatus = Mage::getStoreConfig('advancecontactformsetting/advancecontactform/advancecontactformstatus');
|
29 |
$hideit = 'ok';
|
30 |
$option .= '<option value="">'. $this->__("Please Select Department") .'</option>';
|
@@ -72,9 +73,9 @@ if($advancecontactformStatus)
|
|
72 |
|
73 |
<li class="fields">
|
74 |
<div class="field">
|
75 |
-
<label for="telephone"
|
76 |
<div class="input-box">
|
77 |
-
<input name="telephone" id="telephone" title="<?php echo Mage::helper('advancecontactform')->__('Telephone') ?>" value="" class="input-text
|
78 |
</div>
|
79 |
</div>
|
80 |
<div class="field">
|
25 |
*/
|
26 |
?>
|
27 |
<?php
|
28 |
+
$option = '';
|
29 |
$advancecontactformStatus = Mage::getStoreConfig('advancecontactformsetting/advancecontactform/advancecontactformstatus');
|
30 |
$hideit = 'ok';
|
31 |
$option .= '<option value="">'. $this->__("Please Select Department") .'</option>';
|
73 |
|
74 |
<li class="fields">
|
75 |
<div class="field">
|
76 |
+
<label for="telephone"><?php echo Mage::helper('advancecontactform')->__('Home Phone Number') ?></label>
|
77 |
<div class="input-box">
|
78 |
+
<input name="telephone" id="telephone" title="<?php echo Mage::helper('advancecontactform')->__('Telephone') ?>" value="" class="input-text" type="text" />
|
79 |
</div>
|
80 |
</div>
|
81 |
<div class="field">
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>advancedcontactform</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -9,10 +9,10 @@
|
|
9 |
<summary>Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.</summary>
|
10 |
<description>Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.</description>
|
11 |
<notes>Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.</notes>
|
12 |
-
<authors><author><name>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>advancedcontactform</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.</summary>
|
10 |
<description>Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.</description>
|
11 |
<notes>Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.</notes>
|
12 |
+
<authors><author><name>Zestard</name><user>ZestardTech</user><email>support@zestard.com</email></author></authors>
|
13 |
+
<date>2016-02-09</date>
|
14 |
+
<time>10:52:03</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Zestard"><dir name="Advancecontactform"><dir name="Helper"><file name="Data.php" hash="d949271129e03a46e21daf7a516de831"/></dir><dir name="controllers"><file name="IndexController.php" hash="af4212410810a5b760e593140dfa7299"/></dir><dir name="etc"><file name="config.xml" hash="6c8702614453462b5556e121d74cad37"/><file name="system.xml" hash="2c339ef4d31012264abe79655b12e467"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zestard_Advancecontactform.xml" hash="a8e91bdc9a6bdda213510593b8ee10d2"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="advancecontactform"><file name="advancecontactform.html" hash="9e9ac4507c297010569d63fe26c3c1f1"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="advancecontactform.xml" hash="3a211ee456777c0316268d65259bebf2"/></dir><dir name="template"><dir name="advancecontactform"><file name="advancecontactform.phtml" hash="7e9eda6a49e04313c1ed00b651ec1172"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="acf"><file name="zestard-logo.png" hash="fbf51108e5c6f796c5d2a6294690c352"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/adminhtml/default/default/images/acf/zestard-logo.png
ADDED
Binary file
|