Dexxtz_Contact_US - Version 1.0.3

Version Notes

Started

Download this release

Release Info

Developer Magento Core Team
Extension Dexxtz_Contact_US
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Dexxtz/Contactus/Helper/Data.php CHANGED
@@ -127,5 +127,23 @@ class Dexxtz_Contactus_Helper_Data extends Mage_Core_Helper_Abstract
127
  }
128
  return $browser_details['name'] . ' - ' . $browser_details['version'];
129
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  }
131
  ?>
127
  }
128
  return $browser_details['name'] . ' - ' . $browser_details['version'];
129
  }
130
+
131
+ public function getGeolocation() {
132
+ $ipInfo = json_decode(file_get_contents("http://ipinfo.io/json"), true);
133
+ $city = ($ipInfo['city']) ? $ipInfo['city'] . ' - ' : '';
134
+ $region = ($ipInfo['region']) ? $ipInfo['region'] . ' - ' : '';
135
+ $contry = ($ipInfo['country']) ? $ipInfo['country'] : '';
136
+ return ($city . $region . $contry);
137
+ }
138
+
139
+ public function strposa($haystack, $needles = array(), $offset = 0) {
140
+ $chr = array();
141
+ foreach($needles as $needle) {
142
+ $res = strpos($haystack, $needle, $offset);
143
+ if ($res !== false) $chr[$needle] = $res;
144
+ }
145
+ if(empty($chr)) return false;
146
+ return min($chr);
147
+ }
148
  }
149
  ?>
app/code/community/Dexxtz/Contactus/etc/config.xml CHANGED
@@ -11,7 +11,7 @@
11
  <config>
12
  <modules>
13
  <Dexxtz_Contactus>
14
- <version>1.0.2</version>
15
  </Dexxtz_Contactus>
16
  </modules>
17
  <frontend>
@@ -147,7 +147,7 @@
147
  <template>
148
  <email>
149
  <dexxtz_contactus_general_template translate="label" module="contactus">
150
- <label>Dexxtz - Contact US</label>
151
  <file>dexxtz_contactus.html</file>
152
  <type>html</type>
153
  </dexxtz_contactus_general_template>
11
  <config>
12
  <modules>
13
  <Dexxtz_Contactus>
14
+ <version>1.0.3</version>
15
  </Dexxtz_Contactus>
16
  </modules>
17
  <frontend>
147
  <template>
148
  <email>
149
  <dexxtz_contactus_general_template translate="label" module="contactus">
150
+ <label>Dexxtz - Formulário de contato</label>
151
  <file>dexxtz_contactus.html</file>
152
  <type>html</type>
153
  </dexxtz_contactus_general_template>
app/design/frontend/base/default/template/dexxtz/contactus/contact_form.phtml CHANGED
@@ -13,7 +13,6 @@
13
  <?php
14
  $helper = Mage::helper('contactus');
15
  $storeCode = Mage::app()->getStore()->getLocaleCode();
16
- $localeCode = ($storeCode) ? $storeCode : Mage::app()->getLocale()->getLocaleCode();
17
  ?>
18
 
19
  <script type="text/javascript">
@@ -79,7 +78,7 @@
79
  <div class="field">
80
  <label for="telephone"><?php echo $helper->__('Telephone') ?></label>
81
  <div class="input-box">
82
- <input name="telephone" id="telephone" <?php echo $helper->addMask(16, $localeCode);?> title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
83
  </div>
84
  </div>
85
  <?php } ?>
@@ -87,7 +86,7 @@
87
  <div class="field">
88
  <label for="fax"><?php echo $helper->__('Fax') ?></label>
89
  <div class="input-box">
90
- <input name="fax" id="fax" <?php echo $helper->addMask(17, $localeCode);?> title="<?php echo $helper->__('Fax') ?>" value="" class="input-text" type="text" />
91
  </div>
92
  </div>
93
  <?php } ?>
@@ -106,11 +105,13 @@
106
  $browser = $helper->getBrowser();
107
  $os = $helper->getOS();
108
  $ip = $_SERVER['REMOTE_ADDR'];
 
109
  ?>
110
 
111
  <input type="hidden" name="browser" value="<?php echo $helper->__($browser); ?>" />
112
  <input type="hidden" name="os" value="<?php echo $helper->__($os); ?>" />
113
  <input type="hidden" name="ip" value="<?php echo $ip; ?>" />
 
114
 
115
  </div>
116
  <div class="buttons-set">
13
  <?php
14
  $helper = Mage::helper('contactus');
15
  $storeCode = Mage::app()->getStore()->getLocaleCode();
 
16
  ?>
17
 
18
  <script type="text/javascript">
78
  <div class="field">
79
  <label for="telephone"><?php echo $helper->__('Telephone') ?></label>
80
  <div class="input-box">
81
+ <input name="telephone" id="telephone" <?php echo $helper->addMask(16, $storeCode);?> title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
82
  </div>
83
  </div>
84
  <?php } ?>
86
  <div class="field">
87
  <label for="fax"><?php echo $helper->__('Fax') ?></label>
88
  <div class="input-box">
89
+ <input name="fax" id="fax" <?php echo $helper->addMask(17, $storeCode);?> title="<?php echo $helper->__('Fax') ?>" value="" class="input-text" type="text" />
90
  </div>
91
  </div>
92
  <?php } ?>
105
  $browser = $helper->getBrowser();
106
  $os = $helper->getOS();
107
  $ip = $_SERVER['REMOTE_ADDR'];
108
+ $geolocation = $helper->getGeolocation();
109
  ?>
110
 
111
  <input type="hidden" name="browser" value="<?php echo $helper->__($browser); ?>" />
112
  <input type="hidden" name="os" value="<?php echo $helper->__($os); ?>" />
113
  <input type="hidden" name="ip" value="<?php echo $ip; ?>" />
114
+ <input type="hidden" name="geolocation" value="<?php echo $geolocation; ?>" />
115
 
116
  </div>
117
  <div class="buttons-set">
app/locale/en_US/Dexxtz_Contactus.csv CHANGED
@@ -34,5 +34,4 @@
34
  "* Required Fields","* Required Fields"
35
  "Submit","Submit"
36
  "Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.","Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us."
37
- "Unable to submit your request. Please, try again later","Unable to submit your request. Please, try again later."
38
- "Dexxtz - Contact US","Dexxtz - Contact US"
34
  "* Required Fields","* Required Fields"
35
  "Submit","Submit"
36
  "Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.","Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us."
37
+ "Unable to submit your request. Please, try again later","Unable to submit your request. Please, try again later."
 
app/locale/en_US/template/email/dexxtz_contactus.html CHANGED
@@ -7,7 +7,8 @@
7
  "var data.comment":"subject",
8
  "var data.comment":"Comment",
9
  "var data.comment":"browser",
10
- "var data.comment":"ip_adress"}
 
11
  @-->
12
  <table width="500" border="0" cellpadding="2" cellspacing="5">
13
  <thead>
@@ -57,5 +58,9 @@
57
  <td>IP Adress:</td>
58
  <td>{{var data.ip}}</td>
59
  </tr>
 
 
 
 
60
  </tfoot>
61
  </table>
7
  "var data.comment":"subject",
8
  "var data.comment":"Comment",
9
  "var data.comment":"browser",
10
+ "var data.comment":"ip_adress",
11
+ "var data.comment":"geolocation"}
12
  @-->
13
  <table width="500" border="0" cellpadding="2" cellspacing="5">
14
  <thead>
58
  <td>IP Adress:</td>
59
  <td>{{var data.ip}}</td>
60
  </tr>
61
+ <tr>
62
+ <td>Geolocation:</td>
63
+ <td>{{var data.geolocation}}</td>
64
+ </tr>
65
  </tfoot>
66
  </table>
app/locale/pt_BR/Dexxtz_Contactus.csv CHANGED
@@ -34,5 +34,4 @@
34
  "* Required Fields","* Campos obrigatórios"
35
  "Submit","Enviar"
36
  "Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.","Seu pedido de informação foi enviado e será respondido o mais breve possível. Obrigado por nos contatar."
37
- "Unable to submit your request. Please, try again later","Não foi possível enviar sua solicitação. Por favor, tente novamente mais tarde."
38
- "Dexxtz - Contact US","Dexxtz - Formulário de Contato"
34
  "* Required Fields","* Campos obrigatórios"
35
  "Submit","Enviar"
36
  "Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.","Seu pedido de informação foi enviado e será respondido o mais breve possível. Obrigado por nos contatar."
37
+ "Unable to submit your request. Please, try again later","Não foi possível enviar sua solicitação. Por favor, tente novamente mais tarde."
 
app/locale/pt_BR/template/email/dexxtz_contactus.html CHANGED
@@ -7,7 +7,8 @@
7
  "var data.comment":"subject",
8
  "var data.comment":"Comment",
9
  "var data.comment":"browser",
10
- "var data.comment":"ip_adress"}
 
11
  @-->
12
  <table width="500" border="0" cellpadding="2" cellspacing="5">
13
  <thead>
@@ -57,5 +58,9 @@
57
  <td>IP do Usu&aacute;rio:</td>
58
  <td>{{var data.ip}}</td>
59
  </tr>
 
 
 
 
60
  </tfoot>
61
  </table>
7
  "var data.comment":"subject",
8
  "var data.comment":"Comment",
9
  "var data.comment":"browser",
10
+ "var data.comment":"ip_adress",
11
+ "var data.comment":"geolocation"}
12
  @-->
13
  <table width="500" border="0" cellpadding="2" cellspacing="5">
14
  <thead>
58
  <td>IP do Usu&aacute;rio:</td>
59
  <td>{{var data.ip}}</td>
60
  </tr>
61
+ <tr>
62
+ <td>Localiza&ccedil;&atilde;o Aprox.:</td>
63
+ <td>{{var data.geolocation}}</td>
64
+ </tr>
65
  </tfoot>
66
  </table>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dexxtz_Contact_US</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/apachepl.php">Apache Software License</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Sign departments easily to your contact form</description>
11
  <notes>Started</notes>
12
  <authors><author><name>D&#xE9;cio Mattos</name><user>auto-converted</user><email>dexxtz@gmail.com</email></author></authors>
13
- <date>2014-10-25</date>
14
- <time>17:50:45</time>
15
- <contents><target name="magecommunity"><dir name="Dexxtz"><dir name="Contactus"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Source"><file name="Department.php" hash="44fd9fde781e507aa8296033bbc14b44"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="6ff55e3eaba9e7ad64e571ca04cd5f7a"/></dir><dir name="controllers"><file name="IndexController.php" hash="96cf6a27c634395d7419eb8919f4434f"/></dir><dir name="etc"><file name="config.xml" hash="26fb85578133a0f0116384f571d9acfe"/><file name="system.xml" hash="6d1f9a85cdd0119fd9dc6c40f08c8d81"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dexxtz_Contactus.xml" hash="2d8cddbe2e2b59799c5f6d98331c696a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="dexxtz"><dir name="contactus"><file name="contact_form.phtml" hash="e08c4bd956671f4c181306eddde92e33"/></dir></dir></dir><dir name="layout"><dir name="dexxtz"><file name="contactus.xml" hash="b5a046d28d62c4f5aa9fb95f275d16d2"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="pt_BR"><dir name="template"><dir name="email"><file name="dexxtz_contactus.html" hash="fb15f708b50290cedc5f999a2e1633ca"/></dir></dir><file name="Dexxtz_Contactus.csv" hash="1d168227a61545170b9ae547097e65c7"/></dir><dir name="en_US"><dir name="template"><dir name="email"><file name="dexxtz_contactus.html" hash="2645f61ea15e6e92a8cd7964843f5633"/></dir></dir><file name="Dexxtz_Contactus.csv" hash="3d392afbab552ad6117ca0d51effaf16"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="dexxtz"><dir name="contactus"><dir name="css"><file name="dexxtz.css" hash="ecc17302be69a534747ac12b6f4af133"/></dir><dir name="js"><file name="dexxtz-mask.js" hash="82a587a1262b6940a38c3dbf2ddf7ab3"/><file name="jquery-2.1.1.js" hash="9a094379d98c6458d480ad5a51c4aa27"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dexxtz_Contact_US</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/apachepl.php">Apache Software License</license>
7
  <channel>community</channel>
10
  <description>Sign departments easily to your contact form</description>
11
  <notes>Started</notes>
12
  <authors><author><name>D&#xE9;cio Mattos</name><user>auto-converted</user><email>dexxtz@gmail.com</email></author></authors>
13
+ <date>2014-10-31</date>
14
+ <time>19:56:22</time>
15
+ <contents><target name="magecommunity"><dir name="Dexxtz"><dir name="Contactus"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Source"><file name="Department.php" hash="44fd9fde781e507aa8296033bbc14b44"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c18f631f4c37759137e8546b58077d41"/></dir><dir name="controllers"><file name="IndexController.php" hash="96cf6a27c634395d7419eb8919f4434f"/></dir><dir name="etc"><file name="config.xml" hash="aa408971a05cfb74a60217534c4750e6"/><file name="system.xml" hash="6d1f9a85cdd0119fd9dc6c40f08c8d81"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dexxtz_Contactus.xml" hash="2d8cddbe2e2b59799c5f6d98331c696a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="dexxtz"><dir name="contactus"><file name="contact_form.phtml" hash="9d44c695f1b84101ae70003fe3fbb7f9"/></dir></dir></dir><dir name="layout"><dir name="dexxtz"><file name="contactus.xml" hash="b5a046d28d62c4f5aa9fb95f275d16d2"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="pt_BR"><dir name="template"><dir name="email"><file name="dexxtz_contactus.html" hash="667dd8ef9a4f5160e18843a7486bb368"/></dir></dir><file name="Dexxtz_Contactus.csv" hash="9969f283708cd99e065fd9f4fb85bae6"/></dir><dir name="en_US"><dir name="template"><dir name="email"><file name="dexxtz_contactus.html" hash="84687e658c6add8ecb77e8a433991bfc"/></dir></dir><file name="Dexxtz_Contactus.csv" hash="3963a983d3fb50bb15b93700aba9814f"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="dexxtz"><dir name="contactus"><dir name="css"><file name="dexxtz.css" hash="ecc17302be69a534747ac12b6f4af133"/></dir><dir name="js"><file name="dexxtz-mask.js" hash="82a587a1262b6940a38c3dbf2ddf7ab3"/><file name="jquery-2.1.1.js" hash="9a094379d98c6458d480ad5a51c4aa27"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>