Version Notes
Zestard Advancecontactform provide a feature to send mail to specific departpartment persons simultaneously.
Download this release
Release Info
| Developer | yogesh |
| Extension | advancedcontactform |
| Version | 1.0.0 |
| Comparing to | |
| See all releases | |
Version 1.0.0
- app/code/community/Zestard/Advancecontactform/Helper/Data.php +6 -0
- app/code/community/Zestard/Advancecontactform/controllers/IndexController.php +135 -0
- app/code/community/Zestard/Advancecontactform/etc/config.xml +87 -0
- app/code/community/Zestard/Advancecontactform/etc/system.xml +74 -0
- app/design/frontend/base/default/layout/advancecontactform.xml +45 -0
- app/design/frontend/base/default/template/advancecontactform/advancecontactform.phtml +118 -0
- app/etc/modules/Zestard_Advancecontactform.xml +9 -0
- app/locale/en_US/template/email/advancecontactform/advancecontactform.html +12 -0
- package.xml +18 -0
app/code/community/Zestard/Advancecontactform/Helper/Data.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Zestard_Advancecontactform_Helper_Data extends Mage_Core_Helper_Abstract
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
}
|
app/code/community/Zestard/Advancecontactform/controllers/IndexController.php
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* DISCLAIMER
|
| 16 |
+
*
|
| 17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
+
* versions in the future. If you wish to customize Magento for your
|
| 19 |
+
* needs please refer to http://www.magento.com for more information.
|
| 20 |
+
*
|
| 21 |
+
* @category Mage
|
| 22 |
+
* @package Mage_Contacts
|
| 23 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
| 24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Contacts index controller
|
| 29 |
+
*
|
| 30 |
+
* @category Mage
|
| 31 |
+
* @package Mage_Contacts
|
| 32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
| 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();
|
| 46 |
+
}
|
| 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 */
|
| 56 |
+
$translate->setTranslateInline(false);
|
| 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 |
+
}
|
| 66 |
+
if (!Zend_Validate::is(trim($post['lname']) , 'NotEmpty')) {
|
| 67 |
+
$error = true;
|
| 68 |
+
}
|
| 69 |
+
if (!Zend_Validate::is(trim($post['telephone']) , 'NotEmpty')) {
|
| 70 |
+
$error = true;
|
| 71 |
+
}
|
| 72 |
+
if (!Zend_Validate::is(trim($post['contactperson']) , 'NotEmpty')) {
|
| 73 |
+
$error = true;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
|
| 77 |
+
$error = true;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
|
| 81 |
+
$error = true;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
|
| 85 |
+
$error = true;
|
| 86 |
+
}
|
| 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');
|
| 96 |
+
/* @var $mailTemplate Mage_Core_Model_Email_Template */
|
| 97 |
+
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
|
| 98 |
+
->setReplyTo($post['email'])
|
| 99 |
+
->sendTransactional(
|
| 100 |
+
Mage::getStoreConfig('advancecontactformsetting/advancecontactform/advancecontactformtemplate'),
|
| 101 |
+
Mage::getStoreConfig('advancecontactformsetting/advancecontactform/sender_email_identity'),
|
| 102 |
+
trim($contactPerson),
|
| 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 |
+
}
|
app/code/community/Zestard/Advancecontactform/etc/config.xml
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Zestard_Advancecontactform>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
</Zestard_Advancecontactform>
|
| 7 |
+
</modules>
|
| 8 |
+
|
| 9 |
+
<adminhtml>
|
| 10 |
+
<acl>
|
| 11 |
+
<resources>
|
| 12 |
+
<all>
|
| 13 |
+
<title>Advancecontactform</title>
|
| 14 |
+
</all>
|
| 15 |
+
<admin>
|
| 16 |
+
<children>
|
| 17 |
+
<Zestard_Advancecontactform>
|
| 18 |
+
<title>Departmental Contact Setting</title>
|
| 19 |
+
<sort_order>10</sort_order>
|
| 20 |
+
</Zestard_Advancecontactform>
|
| 21 |
+
<system>
|
| 22 |
+
<children>
|
| 23 |
+
<config>
|
| 24 |
+
<children>
|
| 25 |
+
<advancecontactformsetting translate="title" module="advancecontactform">
|
| 26 |
+
<title>Contact Setting</title>
|
| 27 |
+
<sort_order>100</sort_order>
|
| 28 |
+
</advancecontactformsetting>
|
| 29 |
+
</children>
|
| 30 |
+
</config>
|
| 31 |
+
</children>
|
| 32 |
+
</system>
|
| 33 |
+
</children>
|
| 34 |
+
</admin>
|
| 35 |
+
</resources>
|
| 36 |
+
</acl>
|
| 37 |
+
<layout>
|
| 38 |
+
<updates>
|
| 39 |
+
<advancecontactform>
|
| 40 |
+
<file>advancecontactform.xml</file>
|
| 41 |
+
</advancecontactform>
|
| 42 |
+
</updates>
|
| 43 |
+
</layout>
|
| 44 |
+
</adminhtml>
|
| 45 |
+
<frontend>
|
| 46 |
+
<routers>
|
| 47 |
+
<advancecontactform>
|
| 48 |
+
<use>standard</use>
|
| 49 |
+
<args>
|
| 50 |
+
<module>Zestard_Advancecontactform</module>
|
| 51 |
+
<frontName>contact-us</frontName>
|
| 52 |
+
</args>
|
| 53 |
+
</advancecontactform>
|
| 54 |
+
</routers>
|
| 55 |
+
<layout>
|
| 56 |
+
<updates>
|
| 57 |
+
<advancecontactform>
|
| 58 |
+
<file>advancecontactform.xml</file>
|
| 59 |
+
</advancecontactform>
|
| 60 |
+
</updates>
|
| 61 |
+
</layout>
|
| 62 |
+
</frontend>
|
| 63 |
+
<global>
|
| 64 |
+
<helpers>
|
| 65 |
+
<advancecontactform>
|
| 66 |
+
<class>Zestard_Advancecontactform_Helper</class>
|
| 67 |
+
</advancecontactform>
|
| 68 |
+
</helpers>
|
| 69 |
+
<template>
|
| 70 |
+
<email>
|
| 71 |
+
<advancecontactformsetting_advancecontactform_advancecontactformtemplate module="advancecontactform">
|
| 72 |
+
<label>Advance Contact Form</label>
|
| 73 |
+
<file>advancecontactform/advancecontactform.html</file>
|
| 74 |
+
<type>html</type>
|
| 75 |
+
</advancecontactformsetting_advancecontactform_advancecontactformtemplate>
|
| 76 |
+
</email>
|
| 77 |
+
</template>
|
| 78 |
+
</global>
|
| 79 |
+
<default>
|
| 80 |
+
<advancecontactformsetting>
|
| 81 |
+
<advancecontactform>
|
| 82 |
+
<advancecontactformtemplate>advancecontactformsetting_advancecontactform_advancecontactformtemplate</advancecontactformtemplate>
|
| 83 |
+
</advancecontactform>
|
| 84 |
+
</advancecontactformsetting>
|
| 85 |
+
</default>
|
| 86 |
+
|
| 87 |
+
</config>
|
app/code/community/Zestard/Advancecontactform/etc/system.xml
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<tabs>
|
| 4 |
+
<advancecontactformtab translate="label" module="advancecontactform">
|
| 5 |
+
<label>Advance Contact Form</label>
|
| 6 |
+
<sort_order>200</sort_order>
|
| 7 |
+
</advancecontactformtab>
|
| 8 |
+
</tabs>
|
| 9 |
+
<sections>
|
| 10 |
+
<advancecontactformsetting translate="label" module="advancecontactform">
|
| 11 |
+
<label>Advance Contact Form Setting</label>
|
| 12 |
+
<tab>advancecontactformtab</tab>
|
| 13 |
+
<frontend_type>text</frontend_type>
|
| 14 |
+
<sort_order>100</sort_order>
|
| 15 |
+
<show_in_default>1</show_in_default>
|
| 16 |
+
<show_in_website>1</show_in_website>
|
| 17 |
+
<show_in_store>1</show_in_store>
|
| 18 |
+
<groups>
|
| 19 |
+
<advancecontactform translate="label">
|
| 20 |
+
<label>Contact Setting</label>
|
| 21 |
+
<sort_order>1</sort_order>
|
| 22 |
+
<show_in_default>1</show_in_default>
|
| 23 |
+
<show_in_website>1</show_in_website>
|
| 24 |
+
<show_in_store>1</show_in_store>
|
| 25 |
+
<fields>
|
| 26 |
+
<advancecontactformstatus translate="">
|
| 27 |
+
<label>Advance Contact Form Status</label>
|
| 28 |
+
<frontend_type>select</frontend_type>
|
| 29 |
+
<sort_order>1</sort_order>
|
| 30 |
+
<show_in_default>1</show_in_default>
|
| 31 |
+
<show_in_website>1</show_in_website>
|
| 32 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 33 |
+
</advancecontactformstatus>
|
| 34 |
+
<sender_email_identity translate="label">
|
| 35 |
+
<label>Email Sender</label>
|
| 36 |
+
<frontend_type>select</frontend_type>
|
| 37 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
| 38 |
+
<sort_order>5</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 |
+
<depends>
|
| 43 |
+
<advancecontactformstatus>1</advancecontactformstatus>
|
| 44 |
+
</depends>
|
| 45 |
+
</sender_email_identity>
|
| 46 |
+
<departmentalcontact translate="advancecontactform">
|
| 47 |
+
<label>Contacts for Advance Contact Form</label>
|
| 48 |
+
<frontend_type>text</frontend_type>
|
| 49 |
+
<sort_order>10</sort_order>
|
| 50 |
+
<show_in_default>1</show_in_default>
|
| 51 |
+
<show_in_website>1</show_in_website>
|
| 52 |
+
<depends>
|
| 53 |
+
<advancecontactformstatus>1</advancecontactformstatus>
|
| 54 |
+
</depends>
|
| 55 |
+
<comment>Must be in the format eg: contact name1 | email address1,email address2;contact name3 | email address3;</comment>
|
| 56 |
+
</departmentalcontact>
|
| 57 |
+
<advancecontactformtemplate translate="advancecontactform">
|
| 58 |
+
<label>Email Template for Advance Contact Form</label>
|
| 59 |
+
<frontend_type>select</frontend_type>
|
| 60 |
+
<sort_order>20</sort_order>
|
| 61 |
+
<show_in_default>1</show_in_default>
|
| 62 |
+
<show_in_website>1</show_in_website>
|
| 63 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
| 64 |
+
<depends>
|
| 65 |
+
<advancecontactformstatus>1</advancecontactformstatus>
|
| 66 |
+
</depends>
|
| 67 |
+
</advancecontactformtemplate>
|
| 68 |
+
</fields>
|
| 69 |
+
</advancecontactform>
|
| 70 |
+
|
| 71 |
+
</groups>
|
| 72 |
+
</advancecontactformsetting>
|
| 73 |
+
</sections>
|
| 74 |
+
</config>
|
app/design/frontend/base/default/layout/advancecontactform.xml
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magento.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* DISCLAIMER
|
| 17 |
+
*
|
| 18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 19 |
+
* versions in the future. If you wish to customize Magento for your
|
| 20 |
+
* needs please refer to http://www.magento.com for more information.
|
| 21 |
+
*
|
| 22 |
+
* @category design
|
| 23 |
+
* @package base_default
|
| 24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
| 25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 26 |
+
*/
|
| 27 |
+
-->
|
| 28 |
+
<layout version="0.1.0">
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
<advancecontactform_index_index translate="label">
|
| 32 |
+
<label>Departmental Contact Us Form</label>
|
| 33 |
+
<reference name="head">
|
| 34 |
+
<action method="setTitle" translate="title" module="advancecontactform"><title>Advance Contact Form</title></action>
|
| 35 |
+
</reference>
|
| 36 |
+
<reference name="root">
|
| 37 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
| 38 |
+
<action method="setHeaderTitle" translate="title" module="advancecontactform"><title>Advance Contact Form</title></action>
|
| 39 |
+
</reference>
|
| 40 |
+
<reference name="content">
|
| 41 |
+
<block type="core/template" name="advancecontactForm" template="advancecontactform/advancecontactform.phtml"/>
|
| 42 |
+
</reference>
|
| 43 |
+
</advancecontactform_index_index>
|
| 44 |
+
|
| 45 |
+
</layout>
|
app/design/frontend/base/default/template/advancecontactform/advancecontactform.phtml
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magento.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* DISCLAIMER
|
| 16 |
+
*
|
| 17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
| 18 |
+
* versions in the future. If you wish to customize Magento for your
|
| 19 |
+
* needs please refer to http://www.magento.com for more information.
|
| 20 |
+
*
|
| 21 |
+
* @category design
|
| 22 |
+
* @package base_default
|
| 23 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
| 24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
?>
|
| 27 |
+
<?php
|
| 28 |
+
$advancecontactformStatus = Mage::getStoreConfig('advancecontactformsetting/advancecontactform/advancecontactformstatus');
|
| 29 |
+
$hideit = 'ok';
|
| 30 |
+
$option .= '<option value="">'. $this->__("Please Select Department") .'</option>';
|
| 31 |
+
if($advancecontactformStatus)
|
| 32 |
+
{
|
| 33 |
+
$departmentContactsValue = Mage::getStoreConfig('advancecontactformsetting/advancecontactform/departmentalcontact');
|
| 34 |
+
$departmentContactsArray = explode(";", $departmentContactsValue);
|
| 35 |
+
foreach ($departmentContactsArray as $key => $contactInfoString)
|
| 36 |
+
{
|
| 37 |
+
if(!empty($departmentContactsArray[$key]))
|
| 38 |
+
{
|
| 39 |
+
if(strstr($contactInfoString, "|"))
|
| 40 |
+
{
|
| 41 |
+
$contactInfoArray = explode("|", $contactInfoString);
|
| 42 |
+
$option .= '<option value="'.trim($contactInfoArray[1]).'">'.trim($contactInfoArray[0]).'';
|
| 43 |
+
$hideit = "";
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
?>
|
| 50 |
+
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
|
| 51 |
+
<div class="page-title">
|
| 52 |
+
<h1><?php echo Mage::helper('advancecontactform')->__('Advance Contact Form') ?></h1>
|
| 53 |
+
</div>
|
| 54 |
+
<form action="<?php echo $this->getFormAction(); ?>" id="salesforceForm" method="post">
|
| 55 |
+
<div class="fieldset">
|
| 56 |
+
<h2 class="legend"><?php echo Mage::helper('advancecontactform')->__('Contact Information') ?></h2>
|
| 57 |
+
<ul class="form-list">
|
| 58 |
+
<li class="fields">
|
| 59 |
+
<div class="field">
|
| 60 |
+
<label for="fname" class="required"><em>*</em><?php echo Mage::helper('advancecontactform')->__('First Name') ?></label>
|
| 61 |
+
<div class="input-box">
|
| 62 |
+
<input name="fname" id="fname" title="<?php echo Mage::helper('advancecontactform')->__('First Name') ?>" value="" class="input-text required-entry" type="text" />
|
| 63 |
+
</div>
|
| 64 |
+
</div>
|
| 65 |
+
<div class="field">
|
| 66 |
+
<label for="lname" class="required"><em>*</em><?php echo Mage::helper('advancecontactform')->__('Last Name') ?></label>
|
| 67 |
+
<div class="input-box">
|
| 68 |
+
<input name="lname" id="lname" title="<?php echo Mage::helper('advancecontactform')->__('Last Name') ?>" value="" class="input-text required-entry" type="text" />
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
</li>
|
| 72 |
+
|
| 73 |
+
<li class="fields">
|
| 74 |
+
<div class="field">
|
| 75 |
+
<label for="telephone" class="required"><em>*</em><?php echo Mage::helper('advancecontactform')->__('Home Phone Number') ?></label>
|
| 76 |
+
<div class="input-box">
|
| 77 |
+
<input name="telephone" id="telephone" title="<?php echo Mage::helper('advancecontactform')->__('Telephone') ?>" value="" class="input-text required-entry" type="text" />
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
<div class="field">
|
| 81 |
+
<label for="email" class="required"><em>*</em><?php echo Mage::helper('advancecontactform')->__('Email') ?></label>
|
| 82 |
+
<div class="input-box">
|
| 83 |
+
<input name="email" id="email" title="<?php echo Mage::helper('advancecontactform')->__('Email') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
|
| 84 |
+
</div>
|
| 85 |
+
</div>
|
| 86 |
+
</li>
|
| 87 |
+
<li class="fields">
|
| 88 |
+
|
| 89 |
+
<div class="field">
|
| 90 |
+
<label for="Department" class="required"><em>*</em><?php echo Mage::helper('advancecontactform')->__('Department') ?></label>
|
| 91 |
+
<div class="input-box">
|
| 92 |
+
<select id="contactperson" name="contactperson" title="<?php echo $this->__('Select Department') ?>" class="validate-select">
|
| 93 |
+
<?php
|
| 94 |
+
echo $option;
|
| 95 |
+
?>
|
| 96 |
+
</select>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</li>
|
| 100 |
+
<li class="wide">
|
| 101 |
+
<label for="comment" class="required"><em>*</em><?php echo Mage::helper('advancecontactform')->__('Comment') ?></label>
|
| 102 |
+
<div class="input-box">
|
| 103 |
+
<textarea name="comment" id="comment" title="<?php echo Mage::helper('advancecontactform')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
|
| 104 |
+
</div>
|
| 105 |
+
</li>
|
| 106 |
+
</ul>
|
| 107 |
+
</div>
|
| 108 |
+
<div class="buttons-set">
|
| 109 |
+
<p class="required"><?php echo Mage::helper('advancecontactform')->__('* Required Fields') ?></p>
|
| 110 |
+
<input type="text" name="hideit" id="hideit" value="<?php echo $hideit; ?>" style="display:none !important;" />
|
| 111 |
+
<button type="submit" title="<?php echo Mage::helper('advancecontactform')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
|
| 112 |
+
</div>
|
| 113 |
+
</form>
|
| 114 |
+
<script type="text/javascript">
|
| 115 |
+
//<![CDATA[
|
| 116 |
+
var salesforceForm = new VarienForm('salesforceForm', true);
|
| 117 |
+
//]]>
|
| 118 |
+
</script>
|
app/etc/modules/Zestard_Advancecontactform.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Zestard_Advancecontactform>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
</Zestard_Advancecontactform>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
app/locale/en_US/template/email/advancecontactform/advancecontactform.html
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!--@subject Contact Form@-->
|
| 2 |
+
<!--@vars
|
| 3 |
+
{"var data.name":"Sender Name",
|
| 4 |
+
"var data.email":"Sender Email",
|
| 5 |
+
"var data.telephone":"Sender Telephone",
|
| 6 |
+
"var data.comment":"Comment"}
|
| 7 |
+
@-->
|
| 8 |
+
First Name: {{var data.fname}}<br/>
|
| 9 |
+
Last Name: {{var data.lname}}<br/>
|
| 10 |
+
Email: {{var data.email}}<br/>
|
| 11 |
+
Home Phone Number: {{var data.telephone}}<br/>
|
| 12 |
+
Comment: {{var data.comment}}<br/>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>advancedcontactform</name>
|
| 4 |
+
<version>1.0.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>
|
| 8 |
+
<extends/>
|
| 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>yogesh</name><user>yogesh</user><email>yogesh@zestard.com</email></author></authors>
|
| 13 |
+
<date>2015-06-30</date>
|
| 14 |
+
<time>13:45:55</time>
|
| 15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Zestard_Advancecontactform.xml" hash="a8e91bdc9a6bdda213510593b8ee10d2"/></dir></target><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="6b0f6d2859026d7c360d63b892544d47"/></dir><dir name="etc"><file name="config.xml" hash="a2b83cf38dffad01d23563b2609c778e"/><file name="system.xml" hash="6bf50409036648d00c3081f360941836"/></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="e87b5080f5cbbee9ba579774be921857"/></dir></dir></dir></dir></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></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
+
</package>
|
