Dealer_Inquery - Version 2.1.4

Version Notes

Dealer Inquiry

Download this release

Release Info

Developer Capacity Web Solutions
Extension Dealer_Inquery
Version 2.1.4
Comparing to
See all releases


Code changes from version 2.1.3 to 2.1.4

app/code/community/CapacityWebSolutions/Inquiry/Block/Adminhtml/Inquiry/Edit.php CHANGED
@@ -17,7 +17,7 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Edit extends Mage_Adm
17
  $this->_controller = 'adminhtml_inquiry';
18
  $this->_addButton('adminhtml_inquiry', array(
19
  'label' => $this->__('Create Customer'),
20
- 'onclick' => "setLocation('{$this->getUrl('*/adminhtml_inquiry/createCustomer', array('id' => Mage::registry('inquiry_data')->getId()))}')",
21
  ));
22
 
23
  $this->_updateButton('delete', 'label', Mage::helper('inquiry')->__('Delete'));
17
  $this->_controller = 'adminhtml_inquiry';
18
  $this->_addButton('adminhtml_inquiry', array(
19
  'label' => $this->__('Create Customer'),
20
+ 'onclick' => "setLocation('{$this->getUrl('*/inquiry/createCustomer', array('id' => Mage::registry('inquiry_data')->getId()))}')",
21
  ));
22
 
23
  $this->_updateButton('delete', 'label', Mage::helper('inquiry')->__('Delete'));
app/code/community/CapacityWebSolutions/Inquiry/Block/Adminhtml/Inquiry/Edit/Tab/Form.php CHANGED
@@ -84,17 +84,31 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Edit_Tab_Form extends
84
  'value' => $data->getCity(),
85
  ));
86
  }
87
-
 
 
 
 
 
 
 
 
 
 
 
88
  if($data->getState()){
89
  $fieldset->addField('state', 'label', array(
90
  'label' => Mage::helper('inquiry')->__('State'),
91
  'name' => 'state',
92
- 'value' => $data->getState(),
 
93
  ));
94
  }
95
 
 
 
96
  if($data->getCountry()){
97
- $country = explode('$$$',$data->getCountry());
98
  $fieldset->addField('country', 'label', array(
99
  'label' => Mage::helper('inquiry')->__('Country'),
100
  'name' => 'country',
84
  'value' => $data->getCity(),
85
  ));
86
  }
87
+ $country = explode('$$$',$data->getCountry());
88
+ $statearray = Mage::getModel('directory/region_api')->items($country[0]);
89
+ if(!empty($statearray)){
90
+ foreach ($statearray as $_state) {
91
+ if($_state['region_id']== $data->getState()){
92
+ $state = $_state['name'];
93
+ break;
94
+ }else{
95
+ $state = $data->getState();
96
+ }
97
+ }
98
+ }
99
  if($data->getState()){
100
  $fieldset->addField('state', 'label', array(
101
  'label' => Mage::helper('inquiry')->__('State'),
102
  'name' => 'state',
103
+ //'value' => $data->getState(),
104
+ 'value' => $state,
105
  ));
106
  }
107
 
108
+
109
+
110
  if($data->getCountry()){
111
+
112
  $fieldset->addField('country', 'label', array(
113
  'label' => Mage::helper('inquiry')->__('Country'),
114
  'name' => 'country',
app/code/community/CapacityWebSolutions/Inquiry/Block/Adminhtml/Inquiry/Grid.php CHANGED
@@ -7,8 +7,7 @@
7
  ***************************************************************************/
8
  class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
  {
10
- public function __construct()
11
- {
12
  parent::__construct();
13
  $this->setId('inquiryGrid');
14
  $this->setDefaultSort('dealerid');
@@ -16,15 +15,13 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adm
16
  $this->setSaveParametersInSession(true);
17
  }
18
 
19
- protected function _prepareCollection()
20
- {
21
  $collection = Mage::getModel('inquiry/inquiry')->getCollection();
22
  $this->setCollection($collection);
23
  return parent::_prepareCollection();
24
  }
25
 
26
- protected function _prepareColumns()
27
- {
28
  $this->addColumn('dealerid', array(
29
  'header' => Mage::helper('inquiry')->__('ID'),
30
  'align' =>'right',
@@ -70,9 +67,7 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adm
70
  'index' => 'createddt',
71
  'type' => 'date',
72
  ));
73
-
74
-
75
-
76
  $this->addColumn('action', array(
77
  'header' => Mage::helper('inquiry')->__('Action'),
78
  'align' =>'center',
@@ -80,13 +75,11 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adm
80
  'renderer' => 'CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Renderer_Image',
81
  'filter' => false,
82
  ));
83
-
84
-
85
  return parent::_prepareColumns();
86
  }
87
 
88
- public function isCustCreated($value, $row, $column, $isExport)
89
- {
90
  if ($value=="Created") {
91
  $cell = '<span class="grid-severity-notice"><span>Created</span></span>';
92
  } else {
@@ -95,8 +88,7 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adm
95
  return $cell;
96
  }
97
 
98
- protected function _prepareMassaction()
99
- {
100
  $this->setMassactionIdField('dealer_id');
101
  $this->getMassactionBlock()->setFormFieldName('dealer');
102
 
@@ -108,8 +100,7 @@ class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adm
108
  return $this;
109
  }
110
 
111
- public function getRowUrl($row)
112
- {
113
  return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
  }
115
 
7
  ***************************************************************************/
8
  class CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
  {
10
+ public function __construct(){
 
11
  parent::__construct();
12
  $this->setId('inquiryGrid');
13
  $this->setDefaultSort('dealerid');
15
  $this->setSaveParametersInSession(true);
16
  }
17
 
18
+ protected function _prepareCollection() {
 
19
  $collection = Mage::getModel('inquiry/inquiry')->getCollection();
20
  $this->setCollection($collection);
21
  return parent::_prepareCollection();
22
  }
23
 
24
+ protected function _prepareColumns(){
 
25
  $this->addColumn('dealerid', array(
26
  'header' => Mage::helper('inquiry')->__('ID'),
27
  'align' =>'right',
67
  'index' => 'createddt',
68
  'type' => 'date',
69
  ));
70
+
 
 
71
  $this->addColumn('action', array(
72
  'header' => Mage::helper('inquiry')->__('Action'),
73
  'align' =>'center',
75
  'renderer' => 'CapacityWebSolutions_Inquiry_Block_Adminhtml_Inquiry_Renderer_Image',
76
  'filter' => false,
77
  ));
78
+
 
79
  return parent::_prepareColumns();
80
  }
81
 
82
+ public function isCustCreated($value, $row, $column, $isExport) {
 
83
  if ($value=="Created") {
84
  $cell = '<span class="grid-severity-notice"><span>Created</span></span>';
85
  } else {
88
  return $cell;
89
  }
90
 
91
+ protected function _prepareMassaction() {
 
92
  $this->setMassactionIdField('dealer_id');
93
  $this->getMassactionBlock()->setFormFieldName('dealer');
94
 
100
  return $this;
101
  }
102
 
103
+ public function getRowUrl($row) {
 
104
  return $this->getUrl('*/*/edit', array('id' => $row->getId()));
105
  }
106
 
app/code/community/CapacityWebSolutions/Inquiry/Block/Inquiry.php CHANGED
@@ -64,15 +64,13 @@ class CapacityWebSolutions_Inquiry_Block_Inquiry extends Mage_Core_Block_Templat
64
  return $collection;
65
  }
66
 
67
- public function getAllDealer($delId)
68
- {
69
  $collection = Mage::getModel("inquiry/inquiry")->load($delId)->getData();
70
  return $collection;
71
  }
72
 
73
  //for add top link
74
- public function addTopLinkStores()
75
- {
76
  $enable_link = $this->getLinkEnabled();
77
  $url_key = $this->getUrlKey()?$this->getUrlKey():"inquiry";
78
  if($enable_link){
@@ -85,8 +83,7 @@ class CapacityWebSolutions_Inquiry_Block_Inquiry extends Mage_Core_Block_Templat
85
  }
86
 
87
  //for get form data from session after captcha not match
88
- public function getFormData()
89
- {
90
  $data = $this->getData('inquiry_data');
91
  if (is_null($data)) {
92
  $formData = Mage::getSingleton('core/session')->getInquiryFormData();
@@ -99,4 +96,13 @@ class CapacityWebSolutions_Inquiry_Block_Inquiry extends Mage_Core_Block_Templat
99
  return $data;
100
  }
101
 
 
 
 
 
 
 
 
 
 
102
  }
64
  return $collection;
65
  }
66
 
67
+ public function getAllDealer($delId){
 
68
  $collection = Mage::getModel("inquiry/inquiry")->load($delId)->getData();
69
  return $collection;
70
  }
71
 
72
  //for add top link
73
+ public function addTopLinkStores(){
 
74
  $enable_link = $this->getLinkEnabled();
75
  $url_key = $this->getUrlKey()?$this->getUrlKey():"inquiry";
76
  if($enable_link){
83
  }
84
 
85
  //for get form data from session after captcha not match
86
+ public function getFormData(){
 
87
  $data = $this->getData('inquiry_data');
88
  if (is_null($data)) {
89
  $formData = Mage::getSingleton('core/session')->getInquiryFormData();
96
  return $data;
97
  }
98
 
99
+ public function getStateFromCountry($countrycode){
100
+ $code = explode('$$$',$countrycode);
101
+ $statearray = array();
102
+ if ($countrycode != '') {
103
+ $statearray = Mage::getModel('directory/region_api')->items($code[0]);
104
+ }
105
+ return $statearray;
106
+ }
107
+
108
  }
app/code/community/CapacityWebSolutions/Inquiry/Controller/Router.php CHANGED
@@ -47,6 +47,12 @@ class CapacityWebSolutions_Inquiry_Controller_Router extends Mage_Core_Controlle
47
  ));
48
 
49
  $identifier = $condition->getIdentifier();
 
 
 
 
 
 
50
 
51
  if ($condition->getRedirectUrl()) {
52
  Mage::app()->getFrontController()->getResponse()
47
  ));
48
 
49
  $identifier = $condition->getIdentifier();
50
+ /* added for solve conflict with Blog */
51
+ $custom_url = Mage::getStoreConfig(self::CUSTOM_URL_KEY);
52
+ if($identifier!=$custom_url){
53
+ return false;
54
+ }
55
+ /* end */
56
 
57
  if ($condition->getRedirectUrl()) {
58
  Mage::app()->getFrontController()->getResponse()
app/code/community/CapacityWebSolutions/Inquiry/controllers/Adminhtml/InquiryController.php CHANGED
@@ -252,4 +252,8 @@ class CapacityWebSolutions_Inquiry_Adminhtml_InquiryController extends Mage_Admi
252
  ->sendTransactional($templateId, $sender, $customerEmailId, $customerName, $vars, $storeId);
253
  $translate->setTranslateInline(true);
254
  }
 
 
 
 
255
  }
252
  ->sendTransactional($templateId, $sender, $customerEmailId, $customerName, $vars, $storeId);
253
  $translate->setTranslateInline(true);
254
  }
255
+
256
+ protected function _isAllowed(){
257
+ return true;
258
+ }
259
  }
app/code/community/CapacityWebSolutions/Inquiry/controllers/IndexController.php CHANGED
@@ -61,7 +61,8 @@ class CapacityWebSolutions_Inquiry_IndexController extends Mage_Core_Controller_
61
  }
62
 
63
  if(!empty($data['date_time'])){
64
- $data['date_time'] = preg_replace('#(\d{2})/(\d{2})/(\d{4})\s(.*)#', '$3-$2-$1 $4', $data['date_time']);//convert datetime to mysql format
 
65
  }
66
 
67
  if(!empty($_FILES['file']['name'][0]))
@@ -291,7 +292,26 @@ class CapacityWebSolutions_Inquiry_IndexController extends Mage_Core_Controller_
291
  $image_name = Mage::helper('inquiry')->createCaptchaImage();
292
  $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
293
  $this->getResponse()->setBody(json_encode($image_name));
294
- }
295
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  }
297
 
61
  }
62
 
63
  if(!empty($data['date_time'])){
64
+ $data = $this->_filterDateTime($data, array('date_time'));//convert datetime to mysql format
65
+ //$data['date_time'] = preg_replace('#(\d{2})/(\d{2})/(\d{4})\s(.*)#', '$3-$2-$1 $4', $data['date_time']);
66
  }
67
 
68
  if(!empty($_FILES['file']['name'][0]))
292
  $image_name = Mage::helper('inquiry')->createCaptchaImage();
293
  $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
294
  $this->getResponse()->setBody(json_encode($image_name));
295
+ }
296
+
297
+ public function regionlistAction(){
298
+ $state = "";
299
+ $countrycode = $this->getRequest()->getParam('country');
300
+ if ($countrycode != '') {
301
+ $statearray = Mage::getModel('directory/region_api')->items($countrycode);
302
+ if(!empty($statearray)){
303
+ $state = "<select id='state' name='state' class='drop required-entry'><option value=''>--Please Select--</option>";
304
+ foreach ($statearray as $_state) {
305
+ if($_state['region_id']){
306
+ $state .= "<option value='".$_state['region_id']."'>" . $_state['name'] . "</option>";
307
+ }
308
+ }
309
+ $state .= "</select>";
310
+ }else{
311
+ $state .= "<input type='text' name='state' size='45' class='input-text required-entry' />";
312
+ }
313
+ }
314
+ echo $state;
315
+ }
316
  }
317
 
app/code/community/CapacityWebSolutions/Inquiry/controllers/TestController.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /***************************************************************************
3
- Extension Name : Dealer Inquiry
4
- Extension URL : http://www.magebees.com/magento-dealer-inquiry-extension.html
5
- Copyright : Copyright (c) 2015 MageBees, http://www.magebees.com
6
- Support Email : support@magebees.com
7
- ***************************************************************************/
8
- class CapacityWebSolutions_Inquiry_TestController extends Mage_Core_Controller_Front_Action
9
- {
10
- const OWNER_EMAIL_TEMPLATE_XML_PATH = 'inquiry/admin_email/email_template';
11
- const CUSTOMER_EMAIL_TEMPLATE_XML_PATH = 'inquiry/customer_email/email_template';
12
- const INQUIRY_FORM_TITLE = 'inquiry/general/page_title';
13
- const INQUIRY_META_DESC = 'inquiry/general/meta_description';
14
- const INQUIRY_META_KEYWORDS = 'inquiry/general/meta_keywords';
15
-
16
-
17
- public function successAction(){
18
- $title = Mage::getStoreConfig(self::INQUIRY_FORM_TITLE);
19
- $this->_title($this->__($title));
20
- //$this->loadLayout(array('default'));
21
- $page_layout = Mage::helper("inquiry")->getDealerPageLayout();
22
- $this->loadLayout()->getLayout()->getBlock('root')->setTemplate('page/'.$page_layout);
23
- $this->renderLayout();
24
- }
25
-
26
-
27
-
28
- }
29
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/CapacityWebSolutions/Inquiry/etc/adminhtml.xml CHANGED
@@ -26,19 +26,44 @@
26
  </menu>
27
  <acl>
28
  <resources>
 
 
 
29
  <admin>
30
  <children>
31
- <system>
 
32
  <children>
33
- <config>
 
 
34
  <children>
35
- <inquiry>
36
- <title>Inquiry</title>
37
- </inquiry>
 
 
 
 
 
 
 
38
  </children>
39
- </config>
40
  </children>
41
- </system>
 
 
 
 
 
 
 
 
 
 
 
 
42
  </children>
43
  </admin>
44
  </resources>
26
  </menu>
27
  <acl>
28
  <resources>
29
+ <all>
30
+ <title>Allow Everything</title>
31
+ </all>
32
  <admin>
33
  <children>
34
+ <cws module="inquiry">
35
+ <title>MageBees</title>
36
  <children>
37
+ <inquiry module="inquiry">
38
+ <title>Dealer Inquiries</title>
39
+ <sort_order>71</sort_order>
40
  <children>
41
+ <items module="inquiry">
42
+ <title>Dealer Management</title>
43
+ <sort_order>0</sort_order>
44
+ <action>adminhtml/inquiry/index</action>
45
+ </items>
46
+ <dealer_settings module="inquiry">
47
+ <title>Settings</title>
48
+ <sort_order>10</sort_order>
49
+ <action>adminhtml/system_config/edit/section/inquiry</action>
50
+ </dealer_settings>
51
  </children>
52
+ </inquiry>
53
  </children>
54
+ </cws>
55
+ <system>
56
+ <children>
57
+ <config>
58
+ <children>
59
+ <inquiry translate="title">
60
+ <title>Dealer Inquiry Settings</title>
61
+ <sort_order>10</sort_order>
62
+ </inquiry>
63
+ </children>
64
+ </config>
65
+ </children>
66
+ </system>
67
  </children>
68
  </admin>
69
  </resources>
app/code/community/CapacityWebSolutions/Inquiry/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <CapacityWebSolutions_Inquiry>
5
- <version>2.1.2</version>
6
  </CapacityWebSolutions_Inquiry>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <CapacityWebSolutions_Inquiry>
5
+ <version>2.1.4</version>
6
  </CapacityWebSolutions_Inquiry>
7
  </modules>
8
  <global>
app/design/frontend/base/default/template/inquiry/inquiry.phtml CHANGED
@@ -19,7 +19,7 @@ function clearFileInputField(tagId) {
19
  function refresh(){
20
  var image = document.getElementById("captcha_image");
21
  <?php
22
- $url = Mage::helper('adminhtml')->getUrl('inquiry/index/refresh');
23
  ?>
24
  var urlpage = '<?php echo $url;?>';
25
  new Ajax.Request(urlpage, {
@@ -34,6 +34,27 @@ function clearFileInputField(tagId) {
34
  }
35
  </script>
36
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  <?php $image_name = Mage::helper('inquiry')->createCaptchaImage(); ?>
38
  <?php $filename = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA).DS."inquiry".DS."captcha".DS.$image_name;?>
39
  <?php if ( ! is_writable(dirname($filename))) : ?>
@@ -109,36 +130,24 @@ function clearFileInputField(tagId) {
109
  <?php endif; ?>
110
  </li>
111
  <li class="fields">
112
- <?php if($this->getStateHide()): ?>
113
- <div class="field">
114
- <?php $state_label = $this->getState()?$this->getState():"State / Province"; ?>
115
- <label><?php echo $this->__($state_label); ?><span class="required"><em>*</em></span></label>
116
- <div class="input-box">
117
- <input type="text" name="state" size="45" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getFormData()->getState()) ?>"/>
118
- </div>
119
- </div>
120
- <?php endif; ?>
121
-
122
  <?php if($this->getCountryHide()): ?>
123
  <div class="field">
124
  <?php $country_label = $this->getCountry()?$this->getCountry():"Country"; ?>
125
  <label><?php echo $this->__($country_label); ?><span class="required"><em>*</em></span></label>
126
  <div class="input-box">
127
  <?php $country_sess = $this->escapeHtml($this->getFormData()->getCountry()) ?>
128
- <select name="country" id="country" class="drop" class="input-text required-entry">
 
129
  <?php
130
- $countryCode = Mage::getStoreConfig('general/country/default');
131
- $country_name=Mage::app()->getLocale()->getCountryTranslation($countryCode);
132
- $collection = Mage::getModel('directory/country')->getCollection();
133
- foreach ($collection as $country)
134
- {
135
  $cid = $country->getId();
136
  $cname = $country->getName();
137
  $country = $cid.'$$$'.$cname;
138
 
139
  ?>
140
  <option value="<?php echo $cid.'$$$'.$cname; ?>"<?php
141
- if($country==$country_sess || (empty($country_sess) && $cid == $countryCode)){
142
  echo "SELECTED";
143
  } ?> ><?php echo $cname; ?></option>
144
  <?php
@@ -148,6 +157,40 @@ function clearFileInputField(tagId) {
148
  </div>
149
  </div>
150
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  </li>
152
  <li class="fields">
153
  <?php if($this->getPostalCodeHide()): ?>
@@ -199,13 +242,13 @@ function clearFileInputField(tagId) {
199
  <?php $datetime_label = $this->getDateTime()?$this->getDateTime():"Date Time"; ?>
200
  <label><?php echo $this->__($datetime_label); ?></label>
201
  <div class="input-box">
202
- <input type="text" name="date_time" id="date_time" size="45" class="input-text validate-date" placeholder="dd/mm/yyyy HH:MM:SS" value="<?php echo $this->escapeHtml($this->getFormData()->getDateTime()) ?>"/> <img title="Select date" id="date-picker-cal" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/images/grid-cal.gif'; ?>">
203
  </div>
204
  </div>
205
  <script type="text/javascript">// <![CDATA[
206
  Calendar.setup({
207
  inputField : 'date_time',
208
- ifFormat : '%d/%m/%Y %H:%M:%S',
209
  button : 'date-picker-cal',
210
  align : 'Br',
211
  singleClick : true ,
@@ -290,15 +333,11 @@ function clearFileInputField(tagId) {
290
  //< ![CDATA[
291
  var customForm = new VarienForm('dealerInquiry');
292
  //]]>
293
- function isNumberKey(evt)
294
- {
295
- var charCode = (evt.which) ? evt.which : evt.keyCode
296
- if (charCode > 31 && (charCode < 48 || charCode > 57))
297
- {
298
  return false;
299
  }
300
- return true;
301
  }
302
-
303
-
304
  </script>
19
  function refresh(){
20
  var image = document.getElementById("captcha_image");
21
  <?php
22
+ $url = $this->getUrl('inquiry/index/refresh');
23
  ?>
24
  var urlpage = '<?php echo $url;?>';
25
  new Ajax.Request(urlpage, {
34
  }
35
  </script>
36
  <?php endif; ?>
37
+ <script>
38
+ function getRegion(){
39
+ var country = jQuery("#country option:selected").val();
40
+ var countrycode = country.split("$$$");
41
+ <?php
42
+ $url = $this->getUrl('inquiry/index/regionlist');
43
+ ?>
44
+ var urlpage = '<?php echo $url;?>';
45
+ new Ajax.Request(urlpage, {
46
+ method:'post',
47
+ showLoader : true,
48
+ parameters: {country:countrycode[0]},
49
+ onSuccess: function(data) {
50
+ jQuery('#state_div').empty();
51
+ jQuery('#state_div').append(data.responseText);
52
+ },
53
+ onFailure: function() { alert('Something went wrong...'); }
54
+
55
+ });
56
+ }
57
+ </script>
58
  <?php $image_name = Mage::helper('inquiry')->createCaptchaImage(); ?>
59
  <?php $filename = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA).DS."inquiry".DS."captcha".DS.$image_name;?>
60
  <?php if ( ! is_writable(dirname($filename))) : ?>
130
  <?php endif; ?>
131
  </li>
132
  <li class="fields">
 
 
 
 
 
 
 
 
 
 
133
  <?php if($this->getCountryHide()): ?>
134
  <div class="field">
135
  <?php $country_label = $this->getCountry()?$this->getCountry():"Country"; ?>
136
  <label><?php echo $this->__($country_label); ?><span class="required"><em>*</em></span></label>
137
  <div class="input-box">
138
  <?php $country_sess = $this->escapeHtml($this->getFormData()->getCountry()) ?>
139
+ <select name="country" id="country" class="drop required-entry" onchange="getRegion(this)" >
140
+ <option value=''>--Please Select--</option>
141
  <?php
142
+ $collection = Mage::getModel('directory/country')->getCollection();
143
+ foreach ($collection as $country){
 
 
 
144
  $cid = $country->getId();
145
  $cname = $country->getName();
146
  $country = $cid.'$$$'.$cname;
147
 
148
  ?>
149
  <option value="<?php echo $cid.'$$$'.$cname; ?>"<?php
150
+ if($country==$country_sess){
151
  echo "SELECTED";
152
  } ?> ><?php echo $cname; ?></option>
153
  <?php
157
  </div>
158
  </div>
159
  <?php endif; ?>
160
+ <?php if($this->getStateHide()): ?>
161
+ <div class="field">
162
+ <?php $state_label = $this->getState()?$this->getState():"State / Province"; ?>
163
+ <label><?php echo $this->__($state_label); ?><span class="required"><em>*</em></span></label>
164
+ <div id="state_div" class="input-box">
165
+ <?php $statesess = $this->escapeHtml($this->getFormData()->getState()) ?>
166
+ <?php if($statesess): ?>
167
+ <?php $statearray = $this->getStateFromCountry($country_sess); ?>
168
+ <?php
169
+ if(!empty($statearray)){
170
+ ?>
171
+ <select id='state' name='state' class='drop required-entry'><option value=''>--Please Select--</option>";
172
+ <?php
173
+ foreach ($statearray as $_state) {
174
+ if($_state['region_id']){
175
+ ?>
176
+ <option value="<?php echo $_state['region_id']; ?>" <?php if($statesess==$_state['region_id']){echo "selected";}?>><?php echo $_state['name']; ?></option>
177
+ <?php
178
+ }
179
+ }
180
+ ?>
181
+ </select>
182
+ <?php
183
+ }else{ ?>
184
+ <input type="text" name="state" size="45" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getFormData()->getState()) ?>"/>
185
+ <?php
186
+ }
187
+ ?>
188
+ <?php else: ?>
189
+ <input type="text" name="state" size="45" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getFormData()->getState()) ?>"/>
190
+ <?php endif; ?>
191
+ </div>
192
+ </div>
193
+ <?php endif; ?>
194
  </li>
195
  <li class="fields">
196
  <?php if($this->getPostalCodeHide()): ?>
242
  <?php $datetime_label = $this->getDateTime()?$this->getDateTime():"Date Time"; ?>
243
  <label><?php echo $this->__($datetime_label); ?></label>
244
  <div class="input-box">
245
+ <input type="text" name="date_time" id="date_time" size="45" class="input-text validate-date" placeholder="mm/dd/yyyy HH:MM:SS" value="<?php echo $this->escapeHtml($this->getFormData()->getDateTime()) ?>"/> <img title="Select date" id="date-picker-cal" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/images/grid-cal.gif'; ?>">
246
  </div>
247
  </div>
248
  <script type="text/javascript">// <![CDATA[
249
  Calendar.setup({
250
  inputField : 'date_time',
251
+ ifFormat : '%m/%d/%Y %H:%M:%S',
252
  button : 'date-picker-cal',
253
  align : 'Br',
254
  singleClick : true ,
333
  //< ![CDATA[
334
  var customForm = new VarienForm('dealerInquiry');
335
  //]]>
336
+ function isNumberKey(evt){
337
+ var charCode = (evt.which) ? evt.which : evt.keyCode
338
+ if (charCode > 31 && (charCode < 48 || charCode > 57)) {
 
 
339
  return false;
340
  }
341
+ return true;
342
  }
 
 
343
  </script>
app/design/frontend/base/default/template/inquiry/thanks.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /***************************************************************************
3
- Extension Name : Dealer Inquiry
4
- Extension URL : http://www.magebees.com/magento-dealer-inquiry-extension.html
5
- Copyright : Copyright (c) 2015 MageBees, http://www.magebees.com
6
- Support Email : support@magebees.com
7
- ***************************************************************************/
8
- ?>
9
- <?php
10
- $success_tital = Mage::getStoreConfig('inquiry/general/success_tital');
11
- $success_des = Mage::getStoreConfig('inquiry/general/success_des');
12
- ?>
13
-
14
- <div id="about-copy" class="inquiryThank">
15
- <h1><?php if($success_tital): ?><?php echo $success_tital; ?><?php endif; ?></h1>
16
- <p>
17
- <?php if($success_des): ?>
18
- <?php echo $success_des; ?>
19
- <?php endif; ?>
20
- </p>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dealer_Inquery</name>
4
- <version>2.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Dealer filled the details like name, address, contact number, email, website and description inquiry form. It informs to customer and admin by email when customer submits inquiry form. This extension also provides customer listing who submit inquiry form in admin under Dealer Management section. You can view inquiry details of customer and also delete the inquiry information. This extension provides create customer link from dealer listing page.</description>
11
  <notes>Dealer Inquiry</notes>
12
  <authors><author><name>Capacity Web Solutions</name><user>capacitywebsolutions</user><email>magento@capacitywebsolutions.com</email></author></authors>
13
- <date>2016-02-09</date>
14
- <time>07:15:17</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="CapacityWebSolutions_Inquiry.xml" hash="02eb95f93a47babe658b8cacd8a79dba"/></dir></target><target name="magecommunity"><dir name="CapacityWebSolutions"><dir name="Inquiry"><dir name="Block"><dir name="Adminhtml"><dir name="Inquiry"><dir name="Edit"><file name="Form.php" hash="616ccd08b58c2c688994e9bd037c30f5"/><dir name="Tab"><file name="Form.php" hash="c9837fe84c7f80e5b7c24f545d5ecb33"/></dir><file name="Tabs.php" hash="38e769fead1617cfc8440d6ab47f9c37"/></dir><file name="Edit.php" hash="5b817f8b03c7af07063d542525a74d91"/><file name="Grid.php" hash="937fe5e82e22976df90de238638412c1"/><dir name="Renderer"><file name="Image.php" hash="fc785eedf6aa71062a61f02ff80d70cc"/></dir></dir><file name="Inquiry.php" hash="150b32a515d84e7ab451034971ce9271"/></dir><file name="Inquiry.php" hash="f4417ca3e1d874bf9b6e45d133e2766e"/></dir><dir name="Controller"><file name="Router.php" hash="11e413323174188558caec1ebf55c08c"/></dir><dir name="Helper"><file name="Data.php" hash="277e70c7af8be11a61d4d06dd8658239"/></dir><dir name="Model"><file name="Inquiry.php" hash="508e06f2c6f706906f54636c3ce23128"/><file name="Inquiryfiles.php" hash="8dd064c4c4fdeb5b8dc5a5ff8a640f00"/><dir name="Mysql4"><dir name="Inquiry"><file name="Collection.php" hash="250fb44b04853e77dc9250c0efe1bc99"/></dir><file name="Inquiry.php" hash="22a1244c6f65cfd62e341fbe81ed866f"/><dir name="Inquiryfiles"><file name="Collection.php" hash="9cfb6b23ec536376ae7f642be2303421"/></dir><file name="Inquiryfiles.php" hash="10bd77452ce65e31b1bcc42206c37607"/></dir><file name="Observer.php" hash="f3e9a748c50c169e9921724191d74204"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Customergroup.php" hash="b37984de49e0be9ca50645a941cb66f7"/><file name="Ownermail.php" hash="f04f98c521c0d530ed879913e8dc2941"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="InquiryController.php" hash="743d95c74956e476f0b09be7482c6017"/></dir><file name="IndexController.php" hash="6d3f5ddedecf51b9836cdbbb27b148d1"/><file name="TestController.php" hash="7078248876fe0e4c9bf21da4ad9e8d42"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0b229fc89ff2eb5eff1e4e659fedb1e1"/><file name="config.xml" hash="fe5283939b03078a5705d9c5269405cc"/><file name="system.xml" hash="af130b50bceeb458bf59655ef70c0704"/></dir><dir name="sql"><dir name="inquiry_setup"><file name="mysql4-install-0.1.0.php" hash="9a91bba5121b6618130fe56e6d0b01e2"/><file name="mysql4-upgrade-1.2.1-2.0.0.php" hash="944b85aeb8b9ead25a60faf7c2aeb9e9"/><file name="mysql4-upgrade-2.0.0-2.1.0.php" hash="faf3b74c1e2d8d6405498fcf743bb9fa"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="abd1e59f4e438af01e26d129fe4f1e72"/></dir><dir name="template"><dir name="inquiry"><file name="inquiry.phtml" hash="6864932b6a3f0637617807a9de2cc10c"/><file name="thanks.phtml" hash="eac0d84f90a9c4cbd4b83ed04936d007"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="576b36a0a56f55435bd00016b04d6a18"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="inquiry"><file name="admin_inquiry.html" hash="22e95bf5df3ffe8ba171482bae94883d"/><file name="create_customer.html" hash="01c94aac3b06a4e94081d9cc18253ead"/><file name="customer_inquiry.html" hash="6c7ed1f09acca09403dd91f774f8afe1"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="inquiry"><file name="inquiry.css" hash="c445bb2027a6f9d5332d5a805b309f2a"/></dir></dir><dir name="images"><dir name="inquiry"><file name="inquiry-icon.png" hash="2fe54ac19c9baab1c6ac4927b6a034f5"/><file name="refresh.png" hash="cb4184defa247c1b3ebfcf89cd279872"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="inquiry"><file name="create_user.png" hash="7b785ab3b563f8880819404c0382b11e"/><dir name="fonts"><file name="arial.ttf" hash="5995c725ca5a13be62d3dc75c2fc59fc"/></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.0.0</min><max>7.0.3</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dealer_Inquery</name>
4
+ <version>2.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
10
  <description>Dealer filled the details like name, address, contact number, email, website and description inquiry form. It informs to customer and admin by email when customer submits inquiry form. This extension also provides customer listing who submit inquiry form in admin under Dealer Management section. You can view inquiry details of customer and also delete the inquiry information. This extension provides create customer link from dealer listing page.</description>
11
  <notes>Dealer Inquiry</notes>
12
  <authors><author><name>Capacity Web Solutions</name><user>capacitywebsolutions</user><email>magento@capacitywebsolutions.com</email></author></authors>
13
+ <date>2016-05-27</date>
14
+ <time>05:13:49</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="CapacityWebSolutions_Inquiry.xml" hash="02eb95f93a47babe658b8cacd8a79dba"/></dir></target><target name="magecommunity"><dir name="CapacityWebSolutions"><dir name="Inquiry"><dir name="Block"><dir name="Adminhtml"><dir name="Inquiry"><dir name="Edit"><file name="Form.php" hash="616ccd08b58c2c688994e9bd037c30f5"/><dir name="Tab"><file name="Form.php" hash="6aada09a7f13dac9cdcf48eab9b9d1f7"/></dir><file name="Tabs.php" hash="38e769fead1617cfc8440d6ab47f9c37"/></dir><file name="Edit.php" hash="bbd262ab211be5a5f69bc057888c547c"/><file name="Grid.php" hash="7e5f49550dbf447fe0aeefc25c93c355"/><dir name="Renderer"><file name="Image.php" hash="fc785eedf6aa71062a61f02ff80d70cc"/></dir></dir><file name="Inquiry.php" hash="150b32a515d84e7ab451034971ce9271"/></dir><file name="Inquiry.php" hash="d3584586106d638c949a2955f5c06275"/></dir><dir name="Controller"><file name="Router.php" hash="45d51f813a787fc5b49aa1acaaf369af"/></dir><dir name="Helper"><file name="Data.php" hash="277e70c7af8be11a61d4d06dd8658239"/></dir><dir name="Model"><file name="Inquiry.php" hash="508e06f2c6f706906f54636c3ce23128"/><file name="Inquiryfiles.php" hash="8dd064c4c4fdeb5b8dc5a5ff8a640f00"/><dir name="Mysql4"><dir name="Inquiry"><file name="Collection.php" hash="250fb44b04853e77dc9250c0efe1bc99"/></dir><file name="Inquiry.php" hash="22a1244c6f65cfd62e341fbe81ed866f"/><dir name="Inquiryfiles"><file name="Collection.php" hash="9cfb6b23ec536376ae7f642be2303421"/></dir><file name="Inquiryfiles.php" hash="10bd77452ce65e31b1bcc42206c37607"/></dir><file name="Observer.php" hash="f3e9a748c50c169e9921724191d74204"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Customergroup.php" hash="b37984de49e0be9ca50645a941cb66f7"/><file name="Ownermail.php" hash="f04f98c521c0d530ed879913e8dc2941"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="InquiryController.php" hash="fa070a89bd33dc667041552a9aee7c1a"/></dir><file name="IndexController.php" hash="8a547d1761be20696ef6ddc6dbcf99f3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ea50c420769dd4f96bf1a7ed896ee87d"/><file name="config.xml" hash="a41477f2a65b31521600767187843167"/><file name="system.xml" hash="af130b50bceeb458bf59655ef70c0704"/></dir><dir name="sql"><dir name="inquiry_setup"><file name="mysql4-install-0.1.0.php" hash="9a91bba5121b6618130fe56e6d0b01e2"/><file name="mysql4-upgrade-1.2.1-2.0.0.php" hash="944b85aeb8b9ead25a60faf7c2aeb9e9"/><file name="mysql4-upgrade-2.0.0-2.1.0.php" hash="faf3b74c1e2d8d6405498fcf743bb9fa"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="abd1e59f4e438af01e26d129fe4f1e72"/></dir><dir name="template"><dir name="inquiry"><file name="inquiry.phtml" hash="59b3527c70dbe516b8a4e2a1fde9bfd5"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="576b36a0a56f55435bd00016b04d6a18"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="inquiry"><file name="admin_inquiry.html" hash="22e95bf5df3ffe8ba171482bae94883d"/><file name="create_customer.html" hash="01c94aac3b06a4e94081d9cc18253ead"/><file name="customer_inquiry.html" hash="6c7ed1f09acca09403dd91f774f8afe1"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="inquiry"><file name="inquiry.css" hash="c445bb2027a6f9d5332d5a805b309f2a"/></dir></dir><dir name="images"><dir name="inquiry"><file name="inquiry-icon.png" hash="2fe54ac19c9baab1c6ac4927b6a034f5"/><file name="refresh.png" hash="cb4184defa247c1b3ebfcf89cd279872"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="inquiry"><file name="create_user.png" hash="7b785ab3b563f8880819404c0382b11e"/><dir name="fonts"><file name="arial.ttf" hash="5995c725ca5a13be62d3dc75c2fc59fc"/></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>7.0.6</max></php></required></dependencies>
18
  </package>