Version Notes
1.Customer Activation Approved by Admin
2.Date Validation
3.Image type validations
Download this release
Release Info
Developer | developer |
Extension | Wholesale_Customer_Activation |
Version | 4.1.0 |
Comparing to | |
See all releases |
Code changes from version 4.0.0 to 4.1.0
- app/code/community/Exinent/CustomerActivation/Block/Adminhtml/Customer/Edit/Tab/Customerimages.php +1 -1
- app/code/community/Exinent/CustomerActivation/Block/Adminhtml/Rewrite/Fieldset.php +12 -0
- app/code/community/Exinent/CustomerActivation/Block/Rewrite/Fieldset.php +9 -0
- app/code/community/Exinent/CustomerActivation/Block/collection/toobar.php +26 -0
- app/code/community/Exinent/CustomerActivation/Block/toobar.php +26 -0
- app/code/community/Exinent/CustomerActivation/Model/Adminhtml/System/Config/Source/Pages/Group/Multiselect.php +5 -1
- app/code/community/Exinent/CustomerActivation/Model/Adminhtml/System/Config/Source/Products/Group/Multiselect.php +1 -0
- app/code/community/Exinent/CustomerActivation/Model/Info.php +44 -0
- app/code/community/Exinent/CustomerActivation/Model/Mysql4/Info.php +76 -0
- app/code/community/Exinent/CustomerActivation/Model/Mysql4/Subscriber.php +9 -0
- app/code/community/Exinent/CustomerActivation/Model/Mysql4/Subscriber/Collection.php +30 -0
- app/code/community/Exinent/CustomerActivation/Model/Observer.php +20 -10
- app/code/community/Exinent/CustomerActivation/Model/Subscriber.php +12 -0
- app/code/community/Exinent/CustomerActivation/controllers/AccountController.php +4 -0
- app/code/community/Exinent/CustomerActivation/etc/config.xml +15 -1
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.4-0.3.5.php +28 -0
- app/design/adminhtml/default/default/layout/customerActivation.xml +2 -2
- app/design/adminhtml/default/default/template/customerActivation/fieldset.phtml +75 -0
- app/design/frontend/base/default/layout/customerActivation.xml +2 -2
- app/design/frontend/base/default/template/customerActivation/wholesaleRegister.phtml +166 -20
- package.xml +14 -10
app/code/community/Exinent/CustomerActivation/Block/Adminhtml/Customer/Edit/Tab/Customerimages.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
class Exinent_CustomerActivation_Block_Adminhtml_Customer_Edit_Tab_Customerimages extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface {
|
4 |
|
5 |
public function __construct() {
|
6 |
-
parent::_construct();
|
7 |
$this->setTemplate('customerActivation/customerImages.phtml');
|
8 |
}
|
9 |
|
3 |
class Exinent_CustomerActivation_Block_Adminhtml_Customer_Edit_Tab_Customerimages extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface {
|
4 |
|
5 |
public function __construct() {
|
6 |
+
//parent::_construct();
|
7 |
$this->setTemplate('customerActivation/customerImages.phtml');
|
8 |
}
|
9 |
|
app/code/community/Exinent/CustomerActivation/Block/Adminhtml/Rewrite/Fieldset.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once("Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php");
|
4 |
+
class Exinent_CustomerActivation_Block_Adminhtml_Rewrite_Fieldset extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset
|
5 |
+
{
|
6 |
+
protected $_element;
|
7 |
+
protected function _construct()
|
8 |
+
{
|
9 |
+
$this->setTemplate('customerActivation/fieldset.phtml');
|
10 |
+
}
|
11 |
+
|
12 |
+
}
|
app/code/community/Exinent/CustomerActivation/Block/Rewrite/Fieldset.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Exinent_CustomerActivation_Block_Rewrite_Fieldset extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->setTemplate('customerActivation/fieldset.phtml');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Exinent/CustomerActivation/Block/collection/toobar.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Exinent_CustomerActivation_Block_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar {
|
4 |
+
|
5 |
+
public function getPagerHtml()
|
6 |
+
{
|
7 |
+
$pagerBlock = $this->getLayout()->createBlock('page/html_pager');
|
8 |
+
|
9 |
+
if ($pagerBlock instanceof Varien_Object) {
|
10 |
+
|
11 |
+
/* @var $pagerBlock Mage_Page_Block_Html_Pager */
|
12 |
+
$pagerBlock->setAvailableLimit($this->getAvailableLimit());
|
13 |
+
|
14 |
+
$pagerBlock->setUseContainer(false)
|
15 |
+
->setShowPerPage(false)
|
16 |
+
->setShowAmounts(false)
|
17 |
+
->setLimitVarName($this->getLimitVarName())
|
18 |
+
->setPageVarName($this->getPageVarName())
|
19 |
+
->setLimit($this->getLimit())
|
20 |
+
->setCollection($this->getCollection());
|
21 |
+
return $pagerBlock->toHtml();
|
22 |
+
}
|
23 |
+
return '';
|
24 |
+
}
|
25 |
+
}
|
26 |
+
?>
|
app/code/community/Exinent/CustomerActivation/Block/toobar.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Exinent_CustomerActivation_Block_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar {
|
4 |
+
|
5 |
+
public function getPagerHtml()
|
6 |
+
{
|
7 |
+
$pagerBlock = $this->getLayout()->createBlock('page/html_pager');
|
8 |
+
|
9 |
+
if ($pagerBlock instanceof Varien_Object) {
|
10 |
+
|
11 |
+
/* @var $pagerBlock Mage_Page_Block_Html_Pager */
|
12 |
+
$pagerBlock->setAvailableLimit($this->getAvailableLimit());
|
13 |
+
|
14 |
+
$pagerBlock->setUseContainer(false)
|
15 |
+
->setShowPerPage(false)
|
16 |
+
->setShowAmounts(false)
|
17 |
+
->setLimitVarName($this->getLimitVarName())
|
18 |
+
->setPageVarName($this->getPageVarName())
|
19 |
+
->setLimit($this->getLimit())
|
20 |
+
->setCollection($this->getCollection());
|
21 |
+
return $pagerBlock->toHtml();
|
22 |
+
}
|
23 |
+
return '';
|
24 |
+
}
|
25 |
+
}
|
26 |
+
?>
|
app/code/community/Exinent/CustomerActivation/Model/Adminhtml/System/Config/Source/Pages/Group/Multiselect.php
CHANGED
@@ -6,7 +6,11 @@ class Exinent_CustomerActivation_Model_Adminhtml_System_Config_Source_Pages_Grou
|
|
6 |
|
7 |
public function toOptionArray() {
|
8 |
if (!$this->_options) {
|
9 |
-
$this->_options = Mage::getModel('cms/page')->getCollection()
|
|
|
|
|
|
|
|
|
10 |
array_unshift($this->_options, array('value' => '', 'label' => Mage::helper('adminhtml')->__('No page Selected')));
|
11 |
}
|
12 |
return $this->_options;
|
6 |
|
7 |
public function toOptionArray() {
|
8 |
if (!$this->_options) {
|
9 |
+
$this->_options = Mage::getModel('cms/page')->getCollection()
|
10 |
+
|
11 |
+
->addFieldToFilter('is_active',1)
|
12 |
+
->addFieldToFilter('identifier',array(array('nin'=>array('home','enable-cookies'))))->toOptionArray();
|
13 |
+
// echo '<pre>';print_r($this->_options);
|
14 |
array_unshift($this->_options, array('value' => '', 'label' => Mage::helper('adminhtml')->__('No page Selected')));
|
15 |
}
|
16 |
return $this->_options;
|
app/code/community/Exinent/CustomerActivation/Model/Adminhtml/System/Config/Source/Products/Group/Multiselect.php
CHANGED
@@ -8,6 +8,7 @@ class Exinent_CustomerActivation_Model_Adminhtml_System_Config_Source_Products_G
|
|
8 |
if (!$this->_options) {
|
9 |
$categoryCollection = Mage::getModel('catalog/product')
|
10 |
->getCollection()
|
|
|
11 |
->addAttributeToSelect('*');
|
12 |
}
|
13 |
$optionArrays = array();
|
8 |
if (!$this->_options) {
|
9 |
$categoryCollection = Mage::getModel('catalog/product')
|
10 |
->getCollection()
|
11 |
+
->addAttributeToFilter('status', array('eq'=>'1'))
|
12 |
->addAttributeToSelect('*');
|
13 |
}
|
14 |
$optionArrays = array();
|
app/code/community/Exinent/CustomerActivation/Model/Info.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Exinent_CustomerActivation_Model_Info extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
9 |
+
|
10 |
+
public function saveSubscrition($productId, $email)
|
11 |
+
{
|
12 |
+
Mage::getResourceSingleton('outofstocksubscription/info')->saveSubscrition($productId, $email);
|
13 |
+
}
|
14 |
+
|
15 |
+
public function deleteSubscrition($id)
|
16 |
+
{
|
17 |
+
Mage::getResourceSingleton('outofstocksubscription/info')->deleteSubscrition($id);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getProducts()
|
21 |
+
{
|
22 |
+
return Mage::getResourceSingleton('outofstocksubscription/info')->getProducts();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function saveProductAttributesInfo($productId, $supplier, $supplierSku)
|
26 |
+
{
|
27 |
+
Mage::getResourceSingleton('outofstocksubscription/info')->saveProductAttributesInfo($productId, $supplier, $supplierSku);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getSupplierAttributeId()
|
31 |
+
{
|
32 |
+
return Mage::getResourceSingleton('outofstocksubscription/info')->getSupplierAttributeId();
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getSupplierValues($supplierAttributeId)
|
36 |
+
{
|
37 |
+
return Mage::getResourceSingleton('outofstocksubscription/info')->getSupplierValues($supplierAttributeId);
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getCollection()
|
41 |
+
{
|
42 |
+
return Mage::getResourceSingleton('outofstocksubscription/info')->getCollection();
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Exinent/CustomerActivation/Model/Mysql4/Info.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Exinent_CustomerActivation_Model_Mysql4_Info extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('core/store', 'store_id');
|
8 |
+
}
|
9 |
+
|
10 |
+
public function saveSubscrition($productId, $email)
|
11 |
+
{
|
12 |
+
$write = $this->_getWriteAdapter();
|
13 |
+
$read = $this->_getReadAdapter();
|
14 |
+
|
15 |
+
$select = $read->select()
|
16 |
+
->from($this->getTable('outofstocksubscription/info'))
|
17 |
+
->where("product_id = ".$productId." AND email = '".$email."'");
|
18 |
+
$result = $read->fetchRow($select);
|
19 |
+
|
20 |
+
if (!isset($result['id'])) {
|
21 |
+
$write->insert($this->getTable('outofstocksubscription/info'), array('product_id'=>$productId, 'email'=>$email, 'date'=>date('Y-m-d H:i:s')));
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
public function deleteSubscrition($id)
|
26 |
+
{
|
27 |
+
if ($id)
|
28 |
+
{
|
29 |
+
$write = $this->_getWriteAdapter();
|
30 |
+
$write->delete($this->getTable('outofstocksubscription/info'), 'id='.$id);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getProducts()
|
35 |
+
{
|
36 |
+
$read = $this->_getReadAdapter();
|
37 |
+
|
38 |
+
$select = "SELECT DISTINCT(product_id) FROM ".$this->getTable('outofstocksubscription/info');
|
39 |
+
|
40 |
+
return $read->fetchAll($select);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getSubscriptions($productId)
|
44 |
+
{
|
45 |
+
$read = $this->_getReadAdapter();
|
46 |
+
|
47 |
+
$select = $read->select()
|
48 |
+
->from($this->getTable('outofstocksubscription/info'))
|
49 |
+
->where("product_id = ".$productId);
|
50 |
+
|
51 |
+
return $read->fetchAll($select);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function deleteSubscription($id)
|
55 |
+
{
|
56 |
+
$write = $this->_getWriteAdapter();
|
57 |
+
$write->delete($this->getTable('outofstocksubscription/info'), 'id='.$id);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getAttributeId()
|
61 |
+
{
|
62 |
+
$read = $this->_getReadAdapter();
|
63 |
+
|
64 |
+
$select = $read->select()
|
65 |
+
->from('eav_entity_type', 'entity_type_id')
|
66 |
+
->where("entity_type_code = 'catalog_product'");
|
67 |
+
$entityTypeId = $read->fetchOne($select);
|
68 |
+
if (!$entityTypeId) {
|
69 |
+
$entityTypeId = 4;
|
70 |
+
}
|
71 |
+
$select = $read->select()
|
72 |
+
->from('eav_attribute', 'attribute_id')
|
73 |
+
->where("entity_type_id = ".$entityTypeId." AND attribute_code = 'name'");
|
74 |
+
return $read->fetchOne($select);
|
75 |
+
}
|
76 |
+
}
|
app/code/community/Exinent/CustomerActivation/Model/Mysql4/Subscriber.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Exinent_CustomerActivation_Model_Mysql4_Subscriber extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('outofstocksubscription/info', 'id');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Exinent/CustomerActivation/Model/Mysql4/Subscriber/Collection.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @category BusinessKing
|
5 |
+
* @package BusinessKing_OutofStockSubscription
|
6 |
+
*/
|
7 |
+
class Exinent_CustomerActivation_Model_Mysql4_Subscriber_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Initialize collection
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
protected function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('outofstocksubscription/subscriber');
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _initSelect()
|
19 |
+
{
|
20 |
+
parent::_initSelect();
|
21 |
+
//$attributeId = Mage::getResourceSingleton('outofstocksubscription/info')->getAttributeId();
|
22 |
+
$this->getSelect()->join(array("cpe" => 'catalog_product_entity'), 'main_table.product_id=cpe.entity_id', array('sku'=>'cpe.sku'));
|
23 |
+
//$this->getSelect()->join(array("cpev" => 'catalog_product_entity_varchar'), 'cpe.entity_id=cpev.entity_id', array('value'=>'cpev.value'));
|
24 |
+
//$this->getSelect()->where("cpev.attribute_id=".$attributeId);
|
25 |
+
|
26 |
+
//$this->getSelect()->group("con.ticket_id");
|
27 |
+
//$this->getSelect()->order("con.comment_date DESC");
|
28 |
+
//exit($this->getSelect());
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Exinent/CustomerActivation/Model/Observer.php
CHANGED
@@ -78,6 +78,7 @@ class Exinent_CustomerActivation_Model_Observer {
|
|
78 |
|
79 |
public function customerSaveBefore($observer) {
|
80 |
$customer = $observer->getEvent()->getCustomer();
|
|
|
81 |
|
82 |
$storeId = Mage::helper('customeractivation')->getCustomerStoreId($customer);
|
83 |
|
@@ -101,9 +102,11 @@ class Exinent_CustomerActivation_Model_Observer {
|
|
101 |
$contractDateEnd = date('Y-m-d', strtotime($enddate));
|
102 |
|
103 |
if ($paymentDate > $contractDateBegin && $paymentDate < $contractDateEnd) {
|
|
|
104 |
$date_range = 'between';
|
105 |
-
} else if ($enddate == '') {
|
106 |
$date_range = 'notmentioned';
|
|
|
107 |
} else {
|
108 |
$date_range = 'notin';
|
109 |
}
|
@@ -112,9 +115,11 @@ class Exinent_CustomerActivation_Model_Observer {
|
|
112 |
$defaultStatus = Mage::helper('customeractivation')->getDefaultActivationStatus($groupId, $storeId);
|
113 |
if ($customer->getGroupId() == 1) {
|
114 |
$customer->setCustomerActivated('1');
|
115 |
-
} else if (Mage::getStoreConfig(self::XML_PATH_ACTIVATION_STATUS) == 1
|
116 |
-
|
117 |
-
|
|
|
|
|
118 |
$customer->setCustomerActivated('New');
|
119 |
}
|
120 |
|
@@ -140,7 +145,7 @@ class Exinent_CustomerActivation_Model_Observer {
|
|
140 |
public function customerSaveAfter($observer) {
|
141 |
/** @var Mage_Customer_Model_Customer $customer */
|
142 |
$customer = $observer->getEvent()->getCustomer();
|
143 |
-
|
144 |
$storeId = Mage::helper('customeractivation')->getCustomerStoreId($customer);
|
145 |
|
146 |
if (Mage::getStoreConfig(self::XML_PATH_MODULE_DISABLED, $storeId) == 0) {
|
@@ -155,10 +160,11 @@ class Exinent_CustomerActivation_Model_Observer {
|
|
155 |
|
156 |
$contractDateBegin = date('Y-m-d', strtotime($startdate));
|
157 |
$contractDateEnd = date('Y-m-d', strtotime($enddate));
|
|
|
158 |
|
159 |
if ($paymentDate > $contractDateBegin && $paymentDate < $contractDateEnd) {
|
160 |
$date_range = 'between';
|
161 |
-
} else if ($enddate == '') {
|
162 |
$date_range = 'notmentioned';
|
163 |
} else {
|
164 |
$date_range = 'notin';
|
@@ -166,12 +172,16 @@ class Exinent_CustomerActivation_Model_Observer {
|
|
166 |
|
167 |
$groupId = $customer->getGroupId();
|
168 |
$defaultStatus = Mage::helper('customeractivation')->getDefaultActivationStatus($groupId, $storeId);
|
|
|
|
|
169 |
if ($customer->getGroupId() == 1) {
|
170 |
-
$customer->setCustomerActivated('1');
|
171 |
-
} else if (Mage::getStoreConfig(self::XML_PATH_ACTIVATION_STATUS) == 1
|
172 |
-
|
|
|
|
|
173 |
} else {
|
174 |
-
$customer->setCustomerActivated('New');
|
175 |
}
|
176 |
|
177 |
try {
|
78 |
|
79 |
public function customerSaveBefore($observer) {
|
80 |
$customer = $observer->getEvent()->getCustomer();
|
81 |
+
|
82 |
|
83 |
$storeId = Mage::helper('customeractivation')->getCustomerStoreId($customer);
|
84 |
|
102 |
$contractDateEnd = date('Y-m-d', strtotime($enddate));
|
103 |
|
104 |
if ($paymentDate > $contractDateBegin && $paymentDate < $contractDateEnd) {
|
105 |
+
|
106 |
$date_range = 'between';
|
107 |
+
} else if ($paymentDate > $contractDateBegin && $enddate == '') {
|
108 |
$date_range = 'notmentioned';
|
109 |
+
|
110 |
} else {
|
111 |
$date_range = 'notin';
|
112 |
}
|
115 |
$defaultStatus = Mage::helper('customeractivation')->getDefaultActivationStatus($groupId, $storeId);
|
116 |
if ($customer->getGroupId() == 1) {
|
117 |
$customer->setCustomerActivated('1');
|
118 |
+
} else if (Mage::getStoreConfig(self::XML_PATH_ACTIVATION_STATUS) == 1) {
|
119 |
+
if(($date_range == 'between') || ($date_range == 'notmentioned')) {
|
120 |
+
$customer->setCustomerActivated('1');
|
121 |
+
}
|
122 |
+
} else {
|
123 |
$customer->setCustomerActivated('New');
|
124 |
}
|
125 |
|
145 |
public function customerSaveAfter($observer) {
|
146 |
/** @var Mage_Customer_Model_Customer $customer */
|
147 |
$customer = $observer->getEvent()->getCustomer();
|
148 |
+
|
149 |
$storeId = Mage::helper('customeractivation')->getCustomerStoreId($customer);
|
150 |
|
151 |
if (Mage::getStoreConfig(self::XML_PATH_MODULE_DISABLED, $storeId) == 0) {
|
160 |
|
161 |
$contractDateBegin = date('Y-m-d', strtotime($startdate));
|
162 |
$contractDateEnd = date('Y-m-d', strtotime($enddate));
|
163 |
+
|
164 |
|
165 |
if ($paymentDate > $contractDateBegin && $paymentDate < $contractDateEnd) {
|
166 |
$date_range = 'between';
|
167 |
+
} else if ($paymentDate > $contractDateBegin && $enddate == '') {
|
168 |
$date_range = 'notmentioned';
|
169 |
} else {
|
170 |
$date_range = 'notin';
|
172 |
|
173 |
$groupId = $customer->getGroupId();
|
174 |
$defaultStatus = Mage::helper('customeractivation')->getDefaultActivationStatus($groupId, $storeId);
|
175 |
+
|
176 |
+
|
177 |
if ($customer->getGroupId() == 1) {
|
178 |
+
$customer->setCustomerActivated('1');
|
179 |
+
} else if (Mage::getStoreConfig(self::XML_PATH_ACTIVATION_STATUS) == 1) {
|
180 |
+
if(($date_range == 'between') || ($date_range == 'notmentioned')) {
|
181 |
+
$customer->setCustomerActivated('1');
|
182 |
+
}
|
183 |
} else {
|
184 |
+
$customer->setCustomerActivated('New');
|
185 |
}
|
186 |
|
187 |
try {
|
app/code/community/Exinent/CustomerActivation/Model/Subscriber.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Exinent_CustomerActivation_Model_Subscriber extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Init model
|
7 |
+
*/
|
8 |
+
protected function _construct()
|
9 |
+
{
|
10 |
+
$this->_init('outofstocksubscription/info');
|
11 |
+
}
|
12 |
+
}
|
app/code/community/Exinent/CustomerActivation/controllers/AccountController.php
CHANGED
@@ -56,18 +56,22 @@ class Exinent_CustomerActivation_AccountController extends Mage_Customer_Account
|
|
56 |
$brands = implode(',', $brandsCarry);
|
57 |
$customer->setBrandsCarry($brands);
|
58 |
try {
|
|
|
59 |
$uploader = new Varien_File_Uploader('attachment');
|
60 |
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
|
61 |
$uploader->setAllowRenameFiles(true);
|
62 |
$path = Mage::getBaseDir('media') . DS . 'customerlogs' . DS;
|
63 |
$img = $uploader->save($path, $_FILES['attachment']['name']);
|
64 |
$logoImage = 'customerlogs/' . $_FILES['attachment']['name'];
|
|
|
|
|
65 |
} catch (Exception $e) {
|
66 |
echo $e->getMessage();
|
67 |
Mage::log($e->getMessage());
|
68 |
}
|
69 |
$customer->setLogoImage($logoImage);
|
70 |
try {
|
|
|
71 |
$paymentreference = new Varien_File_Uploader('net30reference');
|
72 |
$uploader->setAllowedExtensions(array('doc', 'pdf', 'txt', 'docx', 'jpg', 'jpeg', 'gif', 'png'));
|
73 |
$paymentreference->setAllowRenameFiles(true);
|
56 |
$brands = implode(',', $brandsCarry);
|
57 |
$customer->setBrandsCarry($brands);
|
58 |
try {
|
59 |
+
$logoImage='';
|
60 |
$uploader = new Varien_File_Uploader('attachment');
|
61 |
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
|
62 |
$uploader->setAllowRenameFiles(true);
|
63 |
$path = Mage::getBaseDir('media') . DS . 'customerlogs' . DS;
|
64 |
$img = $uploader->save($path, $_FILES['attachment']['name']);
|
65 |
$logoImage = 'customerlogs/' . $_FILES['attachment']['name'];
|
66 |
+
|
67 |
+
|
68 |
} catch (Exception $e) {
|
69 |
echo $e->getMessage();
|
70 |
Mage::log($e->getMessage());
|
71 |
}
|
72 |
$customer->setLogoImage($logoImage);
|
73 |
try {
|
74 |
+
$paymentreferenceImage='';
|
75 |
$paymentreference = new Varien_File_Uploader('net30reference');
|
76 |
$uploader->setAllowedExtensions(array('doc', 'pdf', 'txt', 'docx', 'jpg', 'jpeg', 'gif', 'png'));
|
77 |
$paymentreference->setAllowRenameFiles(true);
|
app/code/community/Exinent/CustomerActivation/etc/config.xml
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
</Exinent_CustomerActivation>
|
7 |
</modules>
|
8 |
<global>
|
|
|
9 |
<rewrite>
|
10 |
<customeractivation>
|
11 |
<from><![CDATA[#^/customer/account/createpost/#]]></from>
|
@@ -45,6 +46,16 @@
|
|
45 |
<html_topmenu>Exinent_CustomerActivation_Block_Page_Html_Topmenu</html_topmenu>
|
46 |
</rewrite>
|
47 |
</page>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
</blocks>
|
49 |
<resources>
|
50 |
<customeractivation_setup>
|
@@ -235,7 +246,10 @@
|
|
235 |
|
236 |
</carriers>
|
237 |
</default>
|
238 |
-
|
|
|
|
|
|
|
239 |
<layout>
|
240 |
<updates>
|
241 |
<customeractivation>
|
6 |
</Exinent_CustomerActivation>
|
7 |
</modules>
|
8 |
<global>
|
9 |
+
|
10 |
<rewrite>
|
11 |
<customeractivation>
|
12 |
<from><![CDATA[#^/customer/account/createpost/#]]></from>
|
46 |
<html_topmenu>Exinent_CustomerActivation_Block_Page_Html_Topmenu</html_topmenu>
|
47 |
</rewrite>
|
48 |
</page>
|
49 |
+
|
50 |
+
|
51 |
+
<adminhtml>
|
52 |
+
<rewrite>
|
53 |
+
<widget_form_renderer_fieldset>Exinent_CustomerActivation_Block_Adminhtml_Rewrite_Fieldset</widget_form_renderer_fieldset>
|
54 |
+
</rewrite>
|
55 |
+
</adminhtml>
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
</blocks>
|
60 |
<resources>
|
61 |
<customeractivation_setup>
|
246 |
|
247 |
</carriers>
|
248 |
</default>
|
249 |
+
|
250 |
+
|
251 |
+
|
252 |
+
<adminhtml>
|
253 |
<layout>
|
254 |
<updates>
|
255 |
<customeractivation>
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.4-0.3.5.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category BusinessKing
|
4 |
+
* @package BusinessKing_OutofStockSubscription
|
5 |
+
*/
|
6 |
+
|
7 |
+
$installer = $this;
|
8 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
+
|
10 |
+
$installer->startSetup();
|
11 |
+
|
12 |
+
$installer->run("
|
13 |
+
|
14 |
+
-- DROP TABLE IF EXISTS `{$this->getTable('outofstocksubscription_info')}`;
|
15 |
+
CREATE TABLE `{$this->getTable('outofstocksubscription_info')}` (
|
16 |
+
`id` INTEGER unsigned NOT NULL auto_increment,
|
17 |
+
`product_id` INTEGER unsigned NOT NULL,
|
18 |
+
`email` TEXT NOT NULL default '',
|
19 |
+
`is_active` ENUM('0','1') NOT NULL DEFAULT '0',
|
20 |
+
`date` DATETIME default '0000-00-00 00:00:00',
|
21 |
+
PRIMARY KEY (`id`),
|
22 |
+
KEY `FK_OUTOFSTOCKSUBSCRIPTION_PRODUCT_ID` (`product_id`),
|
23 |
+
CONSTRAINT `FK_OUTOFSTOCKSUBSCRIPTION_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
24 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
25 |
+
|
26 |
+
");
|
27 |
+
|
28 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/customerActivation.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
|
4 |
-
|
5 |
<reference name="customer_edit_tabs">
|
6 |
<action method="addTab">
|
7 |
<name>customer_edit_tab_customerimages</name>
|
@@ -9,5 +9,5 @@
|
|
9 |
</action>
|
10 |
</reference>
|
11 |
</adminhtml_customer_edit>
|
12 |
-
|
13 |
</layout>
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
|
4 |
+
<!-- <adminhtml_customer_edit>
|
5 |
<reference name="customer_edit_tabs">
|
6 |
<action method="addTab">
|
7 |
<name>customer_edit_tab_customerimages</name>
|
9 |
</action>
|
10 |
</reference>
|
11 |
</adminhtml_customer_edit>
|
12 |
+
-->
|
13 |
</layout>
|
app/design/adminhtml/default/default/template/customerActivation/fieldset.phtml
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 default_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 $_element = $this->getElement() ?>
|
28 |
+
<?php if ($_element->getFieldsetContainerId()): ?>
|
29 |
+
<div id="<?php echo $_element->getFieldsetContainerId(); ?>">
|
30 |
+
<?php endif; ?>
|
31 |
+
<?php if ($_element->getLegend()): ?>
|
32 |
+
<div class="entry-edit-head">
|
33 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $_element->getLegend() ?></h4>
|
34 |
+
<div class="form-buttons"><?php echo $_element->getHeaderBar() ?></div>
|
35 |
+
</div>
|
36 |
+
<?php endif; ?>
|
37 |
+
<?php if (!$_element->getNoContainer()): ?>
|
38 |
+
<div class="fieldset <?php echo $_element->getClass() ?>" id="<?php echo $_element->getHtmlId() ?>">
|
39 |
+
<?php if($_element->getHtmlId()=='_accountbase_fieldset'): ?>
|
40 |
+
<div>
|
41 |
+
<?php
|
42 |
+
$customerId = $this->getRequest()->getParam('id');
|
43 |
+
$model = Mage::getModel('customer/customer')->load($customerId);
|
44 |
+
$logoImage = $model->getData('logo_image');
|
45 |
+
if($logoImage!=''){
|
46 |
+
|
47 |
+
?>
|
48 |
+
<span><b>Logo Image:</b> </span><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);echo $logoImage;?>" title="yamini" height="150">
|
49 |
+
<a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);echo $logoImage;?>">View Full Image</a>
|
50 |
+
<?php }?>
|
51 |
+
</div>
|
52 |
+
<div> </div>
|
53 |
+
<?php endif;?>
|
54 |
+
<?php endif; ?>
|
55 |
+
<div class="hor-scroll">
|
56 |
+
<?php if ($_element->getComment()): ?>
|
57 |
+
<p class="comment"><?php echo $this->escapeHtml($_element->getComment()) ?></p>
|
58 |
+
<?php endif; ?>
|
59 |
+
<?php if ($_element->hasHtmlContent()): ?>
|
60 |
+
<?php echo $_element->getHtmlContent(); ?>
|
61 |
+
<?php else: ?>
|
62 |
+
<table cellspacing="0" class="<?php echo $_element->hasTableClass() ? $_element->getTableClass() : 'form-list'?>">
|
63 |
+
<tbody>
|
64 |
+
<?php echo $_element->getChildrenHtml(); ?>
|
65 |
+
</tbody>
|
66 |
+
</table>
|
67 |
+
<?php endif; ?>
|
68 |
+
</div>
|
69 |
+
<?php echo $_element->getSubFieldsetHtml() ?>
|
70 |
+
<?php if (!$_element->getNoContainer()): ?>
|
71 |
+
</div>
|
72 |
+
<?php endif; ?>
|
73 |
+
<?php if ($_element->getFieldsetContainerId()): ?>
|
74 |
+
</div>
|
75 |
+
<?php endif; ?>
|
app/design/frontend/base/default/layout/customerActivation.xml
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
</action>
|
8 |
</reference>
|
9 |
</customer_account_login>
|
10 |
-
|
11 |
<reference name="catalog.topnav">
|
12 |
<action method="addLink" translate="label">
|
13 |
<label>Quick Order</label>
|
@@ -15,7 +15,7 @@
|
|
15 |
<path>customeractivation/productorder/quickorderproduct/</path>
|
16 |
</action>
|
17 |
</reference>
|
18 |
-
</default>
|
19 |
|
20 |
<customer_logged_out>
|
21 |
<reference name="top.links">
|
7 |
</action>
|
8 |
</reference>
|
9 |
</customer_account_login>
|
10 |
+
<!--<default>
|
11 |
<reference name="catalog.topnav">
|
12 |
<action method="addLink" translate="label">
|
13 |
<label>Quick Order</label>
|
15 |
<path>customeractivation/productorder/quickorderproduct/</path>
|
16 |
</action>
|
17 |
</reference>
|
18 |
+
</default> -->
|
19 |
|
20 |
<customer_logged_out>
|
21 |
<reference name="top.links">
|
app/design/frontend/base/default/template/customerActivation/wholesaleRegister.phtml
CHANGED
@@ -12,8 +12,8 @@
|
|
12 |
Mage::getSingleton('core/session')->unsEmailError();
|
13 |
}
|
14 |
?>
|
15 |
-
<?php echo $this->getChildHtml('form_fields_before') ?>
|
16 |
-
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data">
|
17 |
<div class="fieldset">
|
18 |
<input type="hidden" name="customer_activation" value="customerActivation" />
|
19 |
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
|
@@ -21,9 +21,9 @@
|
|
21 |
<h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
|
22 |
<ul class="form-list">
|
23 |
<input type="hidden" name="group_id" id="group_id" value="2"/>
|
24 |
-
|
25 |
<li class="fields">
|
26 |
-
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?>
|
27 |
</li>
|
28 |
<li>
|
29 |
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
@@ -42,15 +42,15 @@
|
|
42 |
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
43 |
<?php if ($_gender->isEnabled()): ?>
|
44 |
<li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
|
45 |
-
<?php endif ?>
|
46 |
</ul>
|
47 |
</div>
|
48 |
|
49 |
<div class="fieldset">
|
50 |
|
51 |
<ul class="form-list">
|
52 |
-
<?php $addressconfig = Mage::getStoreConfig('customer/customeractivation/address_field'); ?>
|
53 |
-
<?php if ($addressconfig == 1): ?>
|
54 |
<input type="hidden" name="create_address" value="1" />
|
55 |
<li class="fields">
|
56 |
<div class="field">
|
@@ -68,7 +68,7 @@
|
|
68 |
</li>
|
69 |
|
70 |
|
71 |
-
|
72 |
<li class="wide">
|
73 |
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Address line 1') ?></label>
|
74 |
<div class="input-box">
|
@@ -79,7 +79,7 @@
|
|
79 |
|
80 |
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
81 |
|
82 |
-
|
83 |
<li class="wide">
|
84 |
<label for="street_1"><?php echo $this->__('Address line 2') ?></label>
|
85 |
<div class="input-box">
|
@@ -119,7 +119,7 @@
|
|
119 |
<div class="field">
|
120 |
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
121 |
<div class="input-box">
|
122 |
-
|
123 |
</div>
|
124 |
</div>
|
125 |
</li>
|
@@ -140,8 +140,8 @@
|
|
140 |
</script>
|
141 |
<label for="termas"><?php echo $this->__('Box if Billing and Shipping address are the same') ?></label>
|
142 |
</li>
|
143 |
-
|
144 |
-
<?php endif; ?>
|
145 |
<li class="fields">
|
146 |
<div class="field">
|
147 |
<label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
@@ -196,15 +196,17 @@
|
|
196 |
</div>
|
197 |
</li>
|
198 |
<li>
|
199 |
-
<label for="datefounded"><?php echo $this->__("Date Founded") ?></label>
|
200 |
<div class="input-box">
|
201 |
-
<input type="text" id="
|
202 |
</div>
|
|
|
203 |
</li>
|
204 |
<li>
|
205 |
-
<label for="uploadimage" ><?php echo $this->__('Upload Image of store') ?></label>
|
206 |
<input name="MAX_FILE_SIZE" type="hidden" value="2000000" />
|
207 |
<input name="attachment" id="attachment" type="file" />
|
|
|
208 |
</li>
|
209 |
<li id="payment-terms">
|
210 |
<label for="paymentterms" ><?php echo $this->__('Payment-terms Options') ?></label>
|
@@ -248,8 +250,8 @@
|
|
248 |
</ul>
|
249 |
</div>
|
250 |
<?php if (Mage::getStoreConfig("fontis_recaptcha/recaptcha/customer")): ?>
|
251 |
-
|
252 |
-
<?php endif; ?>
|
253 |
|
254 |
<div class="buttons-set">
|
255 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
@@ -259,9 +261,54 @@
|
|
259 |
</form>
|
260 |
<script type="text/javascript">
|
261 |
jQuery.noConflict();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
var paymentterms = jQuery('#paymentterms').val();
|
263 |
-
jQuery(document).ready(function() {
|
264 |
-
jQuery("#paymentterms").change(function(event) {
|
265 |
if (jQuery(this).val() == 'net30' || jQuery(this).val() == 'net15') {
|
266 |
jQuery("#information_msg").show();
|
267 |
} else {
|
@@ -276,4 +323,103 @@
|
|
276 |
</div>
|
277 |
<style type="text/css">
|
278 |
#payment-terms, #brandsyoucarry, #ups{display: none;}
|
279 |
-
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
Mage::getSingleton('core/session')->unsEmailError();
|
13 |
}
|
14 |
?>
|
15 |
+
<?php echo $this->getChildHtml('form_fields_before') ?>
|
16 |
+
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" onsubmit="return Validate(this);" name="frmSample" enctype="multipart/form-data">
|
17 |
<div class="fieldset">
|
18 |
<input type="hidden" name="customer_activation" value="customerActivation" />
|
19 |
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
|
21 |
<h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
|
22 |
<ul class="form-list">
|
23 |
<input type="hidden" name="group_id" id="group_id" value="2"/>
|
24 |
+
<?php Mage::getSingleton('customer/session')->setNewRegistration(1); ?>
|
25 |
<li class="fields">
|
26 |
+
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?>
|
27 |
</li>
|
28 |
<li>
|
29 |
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
42 |
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
43 |
<?php if ($_gender->isEnabled()): ?>
|
44 |
<li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
|
45 |
+
<?php endif ?>
|
46 |
</ul>
|
47 |
</div>
|
48 |
|
49 |
<div class="fieldset">
|
50 |
|
51 |
<ul class="form-list">
|
52 |
+
<?php $addressconfig = Mage::getStoreConfig('customer/customeractivation/address_field'); ?>
|
53 |
+
<?php if ($addressconfig == 1): ?>
|
54 |
<input type="hidden" name="create_address" value="1" />
|
55 |
<li class="fields">
|
56 |
<div class="field">
|
68 |
</li>
|
69 |
|
70 |
|
71 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
72 |
<li class="wide">
|
73 |
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Address line 1') ?></label>
|
74 |
<div class="input-box">
|
79 |
|
80 |
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
81 |
|
82 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
83 |
<li class="wide">
|
84 |
<label for="street_1"><?php echo $this->__('Address line 2') ?></label>
|
85 |
<div class="input-box">
|
119 |
<div class="field">
|
120 |
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
121 |
<div class="input-box">
|
122 |
+
<?php echo $this->getCountryHtmlSelect() ?>
|
123 |
</div>
|
124 |
</div>
|
125 |
</li>
|
140 |
</script>
|
141 |
<label for="termas"><?php echo $this->__('Box if Billing and Shipping address are the same') ?></label>
|
142 |
</li>
|
143 |
+
<?php endfor; ?>
|
144 |
+
<?php endif; ?>
|
145 |
<li class="fields">
|
146 |
<div class="field">
|
147 |
<label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
196 |
</div>
|
197 |
</li>
|
198 |
<li>
|
199 |
+
<label for="datefounded"class="required"><em>*</em><?php echo $this->__("Date Founded") ?></label>
|
200 |
<div class="input-box">
|
201 |
+
<input type="text" id="datefounded" name="datefounded" class="input-text" />
|
202 |
</div>
|
203 |
+
<div id="dateerror"></div>
|
204 |
</li>
|
205 |
<li>
|
206 |
+
<label for="uploadimage" class="required"><em>*</em><?php echo $this->__('Upload Image of store') ?></label>
|
207 |
<input name="MAX_FILE_SIZE" type="hidden" value="2000000" />
|
208 |
<input name="attachment" id="attachment" type="file" />
|
209 |
+
<div id="imgerror"></div>
|
210 |
</li>
|
211 |
<li id="payment-terms">
|
212 |
<label for="paymentterms" ><?php echo $this->__('Payment-terms Options') ?></label>
|
250 |
</ul>
|
251 |
</div>
|
252 |
<?php if (Mage::getStoreConfig("fontis_recaptcha/recaptcha/customer")): ?>
|
253 |
+
<?php echo $this->getChildHtml('recaptcha_box') ?>
|
254 |
+
<?php endif; ?>
|
255 |
|
256 |
<div class="buttons-set">
|
257 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
261 |
</form>
|
262 |
<script type="text/javascript">
|
263 |
jQuery.noConflict();
|
264 |
+
var _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"];
|
265 |
+
function Validate() {
|
266 |
+
|
267 |
+
var dt = document.frmSample.datefounded
|
268 |
+
if (isDate(dt.value) == false) {
|
269 |
+
dt.focus()
|
270 |
+
return false
|
271 |
+
}
|
272 |
+
|
273 |
+
var fup = document.getElementById('attachment');
|
274 |
+
var fileName = fup.value;
|
275 |
+
var imagename = fileName.substring(0,fileName.lastIndexOf('.'));
|
276 |
+
var ck_username = /^[A-Za-z0-9_]{3,20}$/;
|
277 |
+
|
278 |
+
|
279 |
+
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
|
280 |
+
|
281 |
+
if (ext == "png" || ext == "PNG" || ext == "JPG" || ext == "jpg" || ext == "JPEG" || ext == "jpeg")
|
282 |
+
{
|
283 |
+
jQuery('#imgerror').removeClass( 'validation-advice' );
|
284 |
+
document.getElementById("imgerror").innerHTML="";
|
285 |
+
|
286 |
+
}
|
287 |
+
else
|
288 |
+
{
|
289 |
+
|
290 |
+
jQuery('#imgerror').addClass( 'validation-advice' );
|
291 |
+
document.getElementById("imgerror").innerHTML="Upload PNG or JPG Images only";
|
292 |
+
//alert("Upload PNG or JPG Images only");
|
293 |
+
return false;
|
294 |
+
}
|
295 |
+
if (!ck_username.test(imagename)) {
|
296 |
+
jQuery('#imgerror').addClass( 'validation-advice' );
|
297 |
+
document.getElementById("imgerror").innerHTML="Please upload valid FileName";
|
298 |
+
return false;
|
299 |
+
}else
|
300 |
+
{
|
301 |
+
|
302 |
+
jQuery('#imgerror').removeClass( 'validation-advice' );
|
303 |
+
document.getElementById("imgerror").innerHTML="";
|
304 |
+
//alert("Upload PNG or JPG Images only");
|
305 |
+
return true;;
|
306 |
+
}
|
307 |
+
|
308 |
+
}
|
309 |
var paymentterms = jQuery('#paymentterms').val();
|
310 |
+
jQuery(document).ready(function () {
|
311 |
+
jQuery("#paymentterms").change(function (event) {
|
312 |
if (jQuery(this).val() == 'net30' || jQuery(this).val() == 'net15') {
|
313 |
jQuery("#information_msg").show();
|
314 |
} else {
|
323 |
</div>
|
324 |
<style type="text/css">
|
325 |
#payment-terms, #brandsyoucarry, #ups{display: none;}
|
326 |
+
</style>
|
327 |
+
<script language = "Javascript">
|
328 |
+
|
329 |
+
var dtCh = "/";
|
330 |
+
var minYear = 1900;
|
331 |
+
var maxYear = 2100;
|
332 |
+
|
333 |
+
function isInteger(s) {
|
334 |
+
var i;
|
335 |
+
for (i = 0; i < s.length; i++) {
|
336 |
+
// Check that current character is number.
|
337 |
+
var c = s.charAt(i);
|
338 |
+
if (((c < "0") || (c > "9")))
|
339 |
+
return false;
|
340 |
+
}
|
341 |
+
// All characters are numbers.
|
342 |
+
return true;
|
343 |
+
}
|
344 |
+
|
345 |
+
function stripCharsInBag(s, bag) {
|
346 |
+
var i;
|
347 |
+
var returnString = "";
|
348 |
+
// Search through string's characters one by one.
|
349 |
+
// If character is not in bag, append to returnString.
|
350 |
+
for (i = 0; i < s.length; i++) {
|
351 |
+
var c = s.charAt(i);
|
352 |
+
if (bag.indexOf(c) == -1)
|
353 |
+
returnString += c;
|
354 |
+
}
|
355 |
+
return returnString;
|
356 |
+
}
|
357 |
+
|
358 |
+
function daysInFebruary(year) {
|
359 |
+
// February has 29 days in any year evenly divisible by four,
|
360 |
+
// EXCEPT for centurial years which are not also divisible by 400.
|
361 |
+
return (((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28);
|
362 |
+
}
|
363 |
+
function DaysArray(n) {
|
364 |
+
for (var i = 1; i <= n; i++) {
|
365 |
+
this[i] = 31
|
366 |
+
if (i == 4 || i == 6 || i == 9 || i == 11) {
|
367 |
+
this[i] = 30
|
368 |
+
}
|
369 |
+
if (i == 2) {
|
370 |
+
this[i] = 29
|
371 |
+
}
|
372 |
+
}
|
373 |
+
return this
|
374 |
+
}
|
375 |
+
|
376 |
+
function isDate(dtStr) {
|
377 |
+
var daysInMonth = DaysArray(12)
|
378 |
+
var pos1 = dtStr.indexOf(dtCh)
|
379 |
+
var pos2 = dtStr.indexOf(dtCh, pos1 + 1)
|
380 |
+
var strMonth = dtStr.substring(0, pos1)
|
381 |
+
var strDay = dtStr.substring(pos1 + 1, pos2)
|
382 |
+
var strYear = dtStr.substring(pos2 + 1)
|
383 |
+
strYr = strYear
|
384 |
+
if (strDay.charAt(0) == "0" && strDay.length > 1)
|
385 |
+
strDay = strDay.substring(1)
|
386 |
+
if (strMonth.charAt(0) == "0" && strMonth.length > 1)
|
387 |
+
strMonth = strMonth.substring(1)
|
388 |
+
for (var i = 1; i <= 3; i++) {
|
389 |
+
if (strYr.charAt(0) == "0" && strYr.length > 1)
|
390 |
+
strYr = strYr.substring(1)
|
391 |
+
}
|
392 |
+
month = parseInt(strMonth)
|
393 |
+
day = parseInt(strDay)
|
394 |
+
year = parseInt(strYr)
|
395 |
+
if (pos1 == -1 || pos2 == -1) {
|
396 |
+
jQuery('#dateerror').addClass( 'validation-advice' );
|
397 |
+
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
398 |
+
//alert("The date format should be : mm/dd/yyyy")
|
399 |
+
return false
|
400 |
+
}
|
401 |
+
if (strMonth.length < 1 || month < 1 || month > 12) {
|
402 |
+
jQuery('#dateerror').addClass( 'validation-advice' );
|
403 |
+
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
404 |
+
return false
|
405 |
+
}
|
406 |
+
if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) {
|
407 |
+
jQuery('#dateerror').addClass( 'validation-advice' );
|
408 |
+
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
409 |
+
return false
|
410 |
+
}
|
411 |
+
if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) {
|
412 |
+
jQuery('#dateerror').addClass( 'validation-advice' );
|
413 |
+
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
414 |
+
return false
|
415 |
+
}
|
416 |
+
if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) {
|
417 |
+
jQuery('#dateerror').addClass( 'validation-advice' );
|
418 |
+
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
419 |
+
return false
|
420 |
+
}
|
421 |
+
jQuery('#dateerror').removeClass( 'validation-advice' );
|
422 |
+
document.getElementById("dateerror").innerHTML="";
|
423 |
+
return true
|
424 |
+
}
|
425 |
+
</script>
|
package.xml
CHANGED
@@ -1,18 +1,22 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wholesale_Customer_Activation</name>
|
4 |
-
<version>4.
|
5 |
<stability>stable</stability>
|
6 |
-
<license>Open Software License
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
|
12 |
-
|
13 |
-
<
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wholesale_Customer_Activation</name>
|
4 |
+
<version>4.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>Open Software License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Bug Fixes and New Features Added</summary>
|
10 |
+
<description>1.Customer Activation Approved by Admin
|
11 |
+
2.Date Validation
|
12 |
+
3.Image type validations</description>
|
13 |
+
<notes>1.Customer Activation Approved by Admin
|
14 |
+
2.Date Validation
|
15 |
+
3.Image type validations</notes>
|
16 |
+
<authors><author><name>Dev Team</name><user>Exinent</user><email>support@exinent.com</email></author></authors>
|
17 |
+
<date>2015-04-07</date>
|
18 |
+
<time>10:31:31</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Exinent"><dir name="CustomerActivation"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Customerimages.php" hash="ec2737955a76186f2b87bcaf6d6343f8"/></dir></dir></dir><dir name="Rewrite"><file name="Fieldset.php" hash="321e2819e5846b44669cef7a1b66d341"/></dir><dir name="System"><dir name="Config"><file name="Date.php" hash="d2f7482b63e9737fd0974828fd644ab5"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Boolean.php" hash="52734afb3fac7f81717aa83842371d1d"/></dir></dir></dir></dir></dir><file name="Orderproduct.php" hash="ec5f2831bb78470510604e71ac35ebae"/><dir name="Page"><dir name="Html"><file name="Topmenu.php" hash="f37cedb38f22f7e60ba3f9c263cd3366"/></dir></dir><file name="Purchaseorder.php" hash="523393a9a08456231a552576f9a9623d"/><file name="Purchaseorderinfo.php" hash="0f21876ad1e1d7870a56e842e34b2c79"/><dir name="Rewrite"><file name="Fieldset.php" hash="d796319c6cde74e5cfa1934c5263b7d8"/></dir><dir name="collection"><file name="toobar.php" hash="413b12a74f97d71ef9a5da03364dc2e3"/></dir><file name="toobar.php" hash="413b12a74f97d71ef9a5da03364dc2e3"/></dir><dir name="Helper"><file name="Data.php" hash="1391011773d402f2d8eb62afe955663b"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Categories"><dir name="Group"><file name="Multiselect.php" hash="a8dc5c2fbff41fa315043ec348ca360b"/></dir></dir><dir name="Customer"><dir name="Group"><file name="Multiselect.php" hash="21f9f4f675cf60dce1a8ce945084f1bd"/></dir></dir><dir name="Pages"><dir name="Group"><file name="Multiselect.php" hash="9bdf2acc492fe0b8c924f2fb41c3afcd"/></dir></dir><dir name="Products"><dir name="Group"><file name="Multiselect.php" hash="ad4f5f67ef290444e6bc8c617da013c1"/></dir><dir name="Price"><file name="Multiselect.php" hash="490373ac424eade10f0479a5e14d2a9c"/></dir></dir></dir></dir></dir></dir><file name="Customer.php" hash="4124537f87d8f57809525875c79d5eb2"/><file name="Info.php" hash="156b808fd5aaeb2b6efa1aba81460218"/><dir name="Mysql4"><file name="Info.php" hash="07051efccbacd7f0c81307bf9fcc23e7"/><dir name="Subscriber"><file name="Collection.php" hash="56da157699fd0627ddc9f991b41fd613"/></dir><file name="Subscriber.php" hash="bfffd406f9eddba5ed714fba7ad99a25"/></dir><file name="Net15.php" hash="bcb24ede3b498f7488a1986b3a33acb5"/><file name="Net30.php" hash="2dcface31c58114c204db5aca3ca65f8"/><file name="Observer.php" hash="8d2e122f2d9fc174e54cf11e211032a9"/><file name="Order.php" hash="7eaebf565655776cd7bcba2fce39b641"/><dir name="Resource"><dir name="Attribute"><dir name="Source"><file name="Customeractivation.php" hash="ac458e05c1bb963d73cbd19d3c2aecd9"/><file name="Customerpayment.php" hash="f11636b19de571c5f50de686b813e30d"/><file name="Customershippingmethods.php" hash="a6f870b8425acd1dab692f2e1494e859"/><file name="Iswebsitelive.php" hash="7d8ae067b8885639e6dd5f4f443226b1"/><file name="StoreType.php" hash="8bd57ac868cb24486a9361d8146a965d"/></dir></dir><file name="Customer.php" hash="d4909a22628e2c448a7be2f98cb4a011"/></dir><file name="Subscriber.php" hash="5ae9d8289a4a9d031154250e6ea6e636"/><file name="Thirdparty.php" hash="ad9ba9fe7110b8ef640f4ddc7aad51ee"/><file name="Thirdpartyfed.php" hash="f29004693ca109b35e26a1ede67a7e1b"/><file name="Thirdpartyfedex.php" hash="9074b87a23c4648ecb76e4c7faee211e"/><file name="Thirdpartyups.php" hash="13898e8a383d27fd33c6f587e574228d"/></dir><dir name="controllers"><file name="AccountController.php" hash="2d21de757322f1ce256db7c232fa6596"/><file name="AdminController.php" hash="d585098ce860d3644d28852d9ffe1526"/><file name="CategoryController.php" hash="700eb1ae4819d60b4ccf20ae99f96ecb"/><file name="IndexController.php" hash="bc0a9613fbdc285ba4ce64e337792442"/><file name="PageController.php" hash="046dd6eccb032499afc205097e2bf266"/><file name="ProductController.php" hash="97eecbd93d3ba49490adae969ff45ed6"/><file name="productOrderController.php" hash="d6347c26c70b421ede78637c3b85757c"/></dir><dir name="etc"><file name="config.xml" hash="0ef464353eb05398089564dcdc0c2424"/><file name="system.xml" hash="80e9ed6e8e77e6517e87f1c258e51ae5"/></dir><dir name="sql"><dir name="customeractivation_setup"><file name="install-0.1.0.php" hash="daba549afd5282910754038d4bc1c637"/><file name="mysql4-install-0.1.0.php" hash="0b688c4f0c39efb95d4031c632f6b14d"/><file name="mysql4-upgrade-0.2.3-0.2.4.php" hash="d0739de5c91381e11828a033cb496659"/><file name="mysql4-upgrade-0.2.4-0.2.5.php" hash="3be30bef278024b66199c2df6526784d"/><file name="mysql4-upgrade-0.2.7-0.2.8.php" hash="086ef43b26c39e14e7d1211ad444576a"/><file name="mysql4-upgrade-0.2.8-0.2.9.php" hash="857f64d31b13d5c7954591bcad4b45e2"/><file name="mysql4-upgrade-0.2.9-0.3.0.php" hash="86e1cd5ae59f0591e3720f31c41fdf54"/><file name="mysql4-upgrade-0.3.0-0.3.1.php" hash="df03a10a2d5468cd083a800fbfdfe8ee"/><file name="mysql4-upgrade-0.3.1-0.3.2.php" hash="80cf342b3125b4411ffb038446aa25c2"/><file name="mysql4-upgrade-0.3.2-0.3.3.php" hash="7a49fbb49f7515b02385369dae61744e"/><file name="mysql4-upgrade-0.3.3-0.3.4.php" hash="e6830f6ac3625d64209d8ebf9ab4a272"/><file name="mysql4-upgrade-0.3.4-0.3.5.php" hash="520def5968f83a974b59a94e9ec7f043"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="customerActivation.xml" hash="3e8b4f8041c225a3e16c825ffa9deb42"/></dir><dir name="template"><dir name="customerActivation"><file name="customerActivation.phtml" hash="617232d6030f4d5dc8f115886f576009"/><file name="customerImages.phtml" hash="40df0fb4b7eddfec77faf04f91284117"/><file name="fieldset.phtml" hash="b4ea61336d856aeabd9f186db3c6402b"/><dir name="info"><file name="purchaseorder.phtml" hash="8288341954620536133ce8f388b1864c"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="customerActivation.xml" hash="80a57bc40135ecd04987c8619dc899cf"/></dir><dir name="template"><dir name="customerActivation"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="771f8c61ca0baa431b0a7aa70b2e1546"/></dir><dir name="shipping_method"><file name="available.phtml" hash="ab11683efa3f497e8c06c7a1176f9d66"/></dir></dir></dir><file name="customerActivation.phtml" hash="83d6ecadd3dfbb95d4cf37ff22261bc1"/><dir name="form"><file name="purchaseorder.phtml" hash="94707f241d7203a08860891c909142dd"/></dir><dir name="info"><file name="purchaseorder.phtml" hash="d3f2a08ee55199680d563929493d0973"/></dir><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="343efe739dab39cd62da8d80c591f8e5"/></dir></dir><file name="quickorderproduct.phtml" hash="ba034c95ebf2cf8258c0815323f22985"/><file name="wholesaleLogin.phtml" hash="16455d9db43ab72c1b385d0ab8e8caee"/><file name="wholesaleRegister.phtml" hash="598d1f9dfca3ff67e5979c53621a7d3d"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Exinent_CustomerActivation.xml" hash="1c70d1597abb1a6401935436754cfc50"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
+
<dependencies><required><php><min>5.0.0</min><max>5.6.0</max></php></required></dependencies>
|
22 |
</package>
|