Version Notes
Allow moving to trash / restoring affiliate transaction, withdrawal quickly.
Download this release
Release Info
Developer | Magestore |
Extension | Affiliateplus_Trash |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Deleted.php +41 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Deleted/Grid.php +183 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit.php +32 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Form.php +19 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tab/Form.php +356 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tab/History.php +30 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tab/vssver2.scc +0 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tabs.php +32 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/vssver2.scc +0 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Transaction/Deleted.php +41 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Transaction/Deleted/Grid.php +210 -0
- app/code/local/Magestore/AffiliateplusTrash/Block/Affiliateplustrash.php +40 -0
- app/code/local/Magestore/AffiliateplusTrash/Helper/Data.php +32 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Mysql4/Payment/Collection.php +59 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Mysql4/Sales/Collection.php +59 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Mysql4/Transaction/Collection.php +59 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Observer.php +123 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Payment.php +109 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Status.php +63 -0
- app/code/local/Magestore/AffiliateplusTrash/Model/Transaction.php +92 -0
- app/code/local/Magestore/AffiliateplusTrash/controllers/Adminhtml/PaymentController.php +199 -0
- app/code/local/Magestore/AffiliateplusTrash/controllers/Adminhtml/TransactionController.php +156 -0
- app/code/local/Magestore/AffiliateplusTrash/controllers/IndexController.php +39 -0
- app/code/local/Magestore/AffiliateplusTrash/etc/adminhtml.xml +72 -0
- app/code/local/Magestore/AffiliateplusTrash/etc/config.xml +171 -0
- app/code/local/Magestore/AffiliateplusTrash/etc/system.xml +24 -0
- app/code/local/Magestore/AffiliateplusTrash/sql/affiliateplustrash_setup/mysql4-install-0.1.0.php +33 -0
- app/design/adminhtml/default/default/layout/affiliateplustrash.xml +45 -0
- app/etc/modules/Magestore_AffiliateplusTrash.xml +34 -0
- app/locale/en_US/Magestore_AffiliateplusTrash.csv +81 -0
- package.xml +37 -0
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Deleted.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Deleted Payment Block
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Deleted
|
30 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Container
|
31 |
+
{
|
32 |
+
|
33 |
+
public function __construct()
|
34 |
+
{
|
35 |
+
$this->_controller = 'adminhtml_payment_deleted';
|
36 |
+
$this->_blockGroup = 'affiliateplustrash';
|
37 |
+
$this->_headerText = Mage::helper('affiliateplustrash')->__('Deleted Withdrawal Manager');
|
38 |
+
parent::__construct();
|
39 |
+
$this->_removeButton('add');
|
40 |
+
}
|
41 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Deleted/Grid.php
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Affiliateplustrash Block
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Deleted_Grid
|
30 |
+
extends Mage_Adminhtml_Block_Widget_Grid
|
31 |
+
{
|
32 |
+
public function __construct()
|
33 |
+
{
|
34 |
+
parent::__construct();
|
35 |
+
$this->setId('deletedPaymentGrid');
|
36 |
+
$this->setDefaultSort('payment_id');
|
37 |
+
$this->setDefaultDir('DESC');
|
38 |
+
$this->setUseAjax(true);
|
39 |
+
$this->setSaveParametersInSession(true);
|
40 |
+
}
|
41 |
+
|
42 |
+
protected function _prepareCollection()
|
43 |
+
{
|
44 |
+
$collection = Mage::getModel('affiliateplus/payment')->getCollection();
|
45 |
+
$collection->setShowDeleted()->addFieldToFilter('payment_is_deleted', 1);
|
46 |
+
|
47 |
+
//event to join other table
|
48 |
+
Mage::dispatchEvent('affiliateplus_adminhtml_join_payment_other_table', array('collection' => $collection));
|
49 |
+
|
50 |
+
$storeId = $this->getRequest()->getParam('store');
|
51 |
+
if($storeId)
|
52 |
+
$collection->addFieldToFilter('store_ids', array('finset' => $storeId));
|
53 |
+
|
54 |
+
$this->setCollection($collection);
|
55 |
+
return parent::_prepareCollection();
|
56 |
+
}
|
57 |
+
|
58 |
+
protected function _prepareColumns()
|
59 |
+
{
|
60 |
+
$currencyCode = Mage::app()->getStore()->getBaseCurrency()->getCode();
|
61 |
+
|
62 |
+
$this->addColumn('payment_id', array(
|
63 |
+
'header' => Mage::helper('affiliateplus')->__('ID'),
|
64 |
+
'align' =>'right',
|
65 |
+
'width' => '50px',
|
66 |
+
'index' => 'payment_id',
|
67 |
+
'type' => 'number'
|
68 |
+
));
|
69 |
+
|
70 |
+
$this->addColumn('account_email', array(
|
71 |
+
'header' => Mage::helper('affiliateplus')->__('Affiliate Account'),
|
72 |
+
'index' => 'account_email',
|
73 |
+
'renderer' => 'affiliateplus/adminhtml_transaction_renderer_account',
|
74 |
+
));
|
75 |
+
|
76 |
+
$this->addColumn('amount', array(
|
77 |
+
'header' => Mage::helper('affiliateplus')->__('Amount'),
|
78 |
+
'width' => '80px',
|
79 |
+
'align' =>'right',
|
80 |
+
'index' => 'amount',
|
81 |
+
'type' => 'price',
|
82 |
+
'currency_code' => $currencyCode,
|
83 |
+
));
|
84 |
+
|
85 |
+
$this->addColumn('tax_amount', array(
|
86 |
+
'header' => Mage::helper('affiliateplus')->__('Tax'),
|
87 |
+
'width' => '80px',
|
88 |
+
'align' =>'right',
|
89 |
+
'index' => 'tax_amount',
|
90 |
+
'type' => 'price',
|
91 |
+
'currency_code' => $currencyCode,
|
92 |
+
));
|
93 |
+
|
94 |
+
$this->addColumn('fee', array(
|
95 |
+
'header' => Mage::helper('affiliateplus')->__('Fee'),
|
96 |
+
'width' => '80px',
|
97 |
+
'align' =>'right',
|
98 |
+
'index' => 'fee',
|
99 |
+
'type' => 'price',
|
100 |
+
'currency_code' => $currencyCode,
|
101 |
+
));
|
102 |
+
|
103 |
+
$this->addColumn('payment_method', array(
|
104 |
+
'header' => Mage::helper('affiliateplus')->__('Withdrawal Method'),
|
105 |
+
'index' => 'payment_method',
|
106 |
+
'renderer' => 'affiliateplus/adminhtml_payment_renderer_info',
|
107 |
+
'type' => 'options',
|
108 |
+
'options' => Mage::helper('affiliateplus/payment')->getAllPaymentOptionArray()
|
109 |
+
));
|
110 |
+
|
111 |
+
//add event to add more column
|
112 |
+
//$this->removeColumn('transaction_id');
|
113 |
+
Mage::dispatchEvent('affiliateplus_adminhtml_change_column_payment_grid', array('grid' => $this));
|
114 |
+
|
115 |
+
|
116 |
+
$this->addColumn('request_time', array(
|
117 |
+
'header' => Mage::helper('affiliateplus')->__('Time'),
|
118 |
+
'width' => '180px',
|
119 |
+
'align' =>'right',
|
120 |
+
'index' => 'request_time',
|
121 |
+
'type' => 'date'
|
122 |
+
));
|
123 |
+
|
124 |
+
$this->addColumn('status', array(
|
125 |
+
'header' => Mage::helper('affiliateplus')->__('Status'),
|
126 |
+
'align' => 'left',
|
127 |
+
'width' => '80px',
|
128 |
+
'index' => 'status',
|
129 |
+
'type' => 'options',
|
130 |
+
'options' => array(
|
131 |
+
1 => Mage::helper('affiliateplus')->__('Pending'),
|
132 |
+
2 => Mage::helper('affiliateplus')->__('Processing'),
|
133 |
+
3 => Mage::helper('affiliateplus')->__('Completed'),
|
134 |
+
4 => Mage::helper('affiliateplus')->__('Canceled')
|
135 |
+
),
|
136 |
+
));
|
137 |
+
|
138 |
+
$this->addColumn('action',
|
139 |
+
array(
|
140 |
+
'header' => Mage::helper('affiliateplus')->__('Action'),
|
141 |
+
'width' => '80px',
|
142 |
+
'type' => 'action',
|
143 |
+
'getter' => 'getId',
|
144 |
+
'actions' => array(
|
145 |
+
array(
|
146 |
+
'caption' => Mage::helper('affiliateplus')->__('View'),
|
147 |
+
'url' => array('base'=> '*/*/edit'),
|
148 |
+
'field' => 'id'
|
149 |
+
)
|
150 |
+
),
|
151 |
+
'filter' => false,
|
152 |
+
'sortable' => false,
|
153 |
+
'index' => 'stores',
|
154 |
+
'is_system' => true,
|
155 |
+
));
|
156 |
+
|
157 |
+
return parent::_prepareColumns();
|
158 |
+
}
|
159 |
+
|
160 |
+
protected function _prepareMassaction()
|
161 |
+
{
|
162 |
+
$this->setMassactionIdField('payment_id');
|
163 |
+
$this->getMassactionBlock()->setFormFieldName('payment');
|
164 |
+
|
165 |
+
$this->getMassactionBlock()->addItem('restore', array(
|
166 |
+
'label' => Mage::helper('affiliateplus')->__('Restore'),
|
167 |
+
'url' => $this->getUrl('*/*/massRestore'),
|
168 |
+
'confirm' => Mage::helper('affiliateplus')->__('Are you sure?'),
|
169 |
+
));
|
170 |
+
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
public function getRowUrl($row)
|
175 |
+
{
|
176 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
177 |
+
}
|
178 |
+
|
179 |
+
public function getGridUrl()
|
180 |
+
{
|
181 |
+
return $this->getUrl('*/*/deletedGrid', array('_current'=>true));
|
182 |
+
}
|
183 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
|
4 |
+
|
5 |
+
public function __construct() {
|
6 |
+
parent::__construct();
|
7 |
+
|
8 |
+
$this->_objectId = 'id';
|
9 |
+
$this->_blockGroup = 'affiliateplustrash';
|
10 |
+
$this->_controller = 'adminhtml_payment';
|
11 |
+
$this->_removeButton('reset');
|
12 |
+
$this->_removeButton('save');
|
13 |
+
$this->_removeButton('delete');
|
14 |
+
|
15 |
+
$data = Mage::registry('payment_data');
|
16 |
+
$this->updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/deleted') . '\')');
|
17 |
+
$this->addButton('restore', array(
|
18 |
+
'label' => Mage::helper('affiliateplustrash')->__('Restore'),
|
19 |
+
'onclick' => 'deleteConfirm(\''
|
20 |
+
. Mage::helper('affiliateplustrash')->__('Restore deleted transaction. Are you sure?')
|
21 |
+
. '\', \''
|
22 |
+
. $this->getUrl('*/*/restore', array('id' => $data->getId()))
|
23 |
+
. '\')',
|
24 |
+
'class' => 'save'
|
25 |
+
), 0);
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getHeaderText() {
|
29 |
+
$data = Mage::registry('payment_data');
|
30 |
+
return Mage::helper('affiliateplus')->__("View Withdrawal for '%s'", $this->htmlEscape($data->getAccountName()));
|
31 |
+
}
|
32 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Form.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* get Affiliate Payment Helper
|
7 |
+
*
|
8 |
+
* @return Magestore_Affiliateplus_Helper_Payment
|
9 |
+
*/
|
10 |
+
protected function _getPaymentHelper() {
|
11 |
+
return Mage::helper('affiliateplus/payment');
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareForm() {
|
15 |
+
$form = new Varien_Data_Form();
|
16 |
+
$this->setForm($form);
|
17 |
+
$fieldset = $form->addFieldset('payment_data', array('legend' => Mage::helper('affiliateplus')->__('Withdrawal information')));
|
18 |
+
|
19 |
+
|
20 |
+
$data = array();
|
21 |
+
if (Mage::getSingleton('adminhtml/session')->getPaymentData()) {
|
22 |
+
$data = Mage::getSingleton('adminhtml/session')->getPaymentData();
|
23 |
+
if (!isset($data['payment_method']) || !$data['payment_method']) {
|
24 |
+
$data['payment_method'] = 'paypal';
|
25 |
+
}
|
26 |
+
$data['temp_payment_method'] = $data['payment_method'];
|
27 |
+
$data['affiliate_account'] = $data['account_email'];
|
28 |
+
Mage::getSingleton('adminhtml/session')->setPaymentData(null);
|
29 |
+
} elseif (Mage::registry('payment_data')) {
|
30 |
+
if (!isset($data['payment_method']) || !$data['payment_method']) {
|
31 |
+
$data['payment_method'] = 'paypal';
|
32 |
+
}
|
33 |
+
$data = Mage::registry('payment_data')->getData();
|
34 |
+
$data['temp_payment_method'] = $data['payment_method'];
|
35 |
+
$data['affiliate_account'] = $data['account_email'];
|
36 |
+
}
|
37 |
+
if (!isset($data['payment_method']) || !$data['payment_method']) {
|
38 |
+
$data['payment_method'] = 'paypal';
|
39 |
+
}
|
40 |
+
$form->setFormValues($data);
|
41 |
+
|
42 |
+
|
43 |
+
$fieldset->addField('account_id', 'hidden', array(
|
44 |
+
'name' => 'account_id',
|
45 |
+
));
|
46 |
+
|
47 |
+
$fieldset->addField('account_email', 'hidden', array(
|
48 |
+
'name' => 'account_email',
|
49 |
+
));
|
50 |
+
|
51 |
+
$fieldset->addField('affiliate_account', 'link', array(
|
52 |
+
'label' => Mage::helper('affiliateplus')->__('Affiliate Account'),
|
53 |
+
'href' => $this->getUrl('*/adminhtml_account/edit', array('_current' => true, 'id' => $data['account_id'])),
|
54 |
+
'title' => Mage::helper('affiliateplus')->__('View Affiliate Account Detail'),
|
55 |
+
));
|
56 |
+
$fieldset->addField('account_name', 'hidden', array(
|
57 |
+
'name' => 'account_name',
|
58 |
+
));
|
59 |
+
$storeId = $this->getRequest()->getParam('store');
|
60 |
+
if (isset($data['account_balance'])) {
|
61 |
+
$fieldset->addField('account_balance', 'note', array(
|
62 |
+
'label' => Mage::helper('affiliateplus')->__('Balance'),
|
63 |
+
'text' => Mage::app()->getStore($storeId)->getBaseCurrency()->format($data['account_balance'])
|
64 |
+
));
|
65 |
+
}
|
66 |
+
|
67 |
+
$whoPayFees = Mage::getStoreConfig('affiliateplus/payment/who_pay_fees', $storeId);
|
68 |
+
if ($whoPayFees == 'payer')
|
69 |
+
$note = Mage::helper('affiliateplus')->__('Not including fee');
|
70 |
+
else
|
71 |
+
$note = Mage::helper('affiliateplus')->__('Including fee');
|
72 |
+
$js='';
|
73 |
+
if (isset($data['account_balance'])) {
|
74 |
+
$js .='<script type="text/javascript">
|
75 |
+
var request_amount_max ='.$data['account_balance'].';
|
76 |
+
function checkAmountBalance(el){
|
77 |
+
el.value = parseFloat(el.value);
|
78 |
+
if (el.value < 0) el.value = 0;
|
79 |
+
else if (el.value > request_amount_max || el.value == \'NaN\') el.value = request_amount_max;
|
80 |
+
}
|
81 |
+
</script>';
|
82 |
+
}
|
83 |
+
$params = array(
|
84 |
+
'label' => Mage::helper('affiliateplus')->__('Amount'),
|
85 |
+
'name' => 'amount',
|
86 |
+
'class' => 'required-entry',
|
87 |
+
'required' => true,
|
88 |
+
'onchange' =>'checkAmountBalance(this)',
|
89 |
+
'note' => $note,
|
90 |
+
'after_element_html' => $js,
|
91 |
+
);
|
92 |
+
if (isset($data['payment_method']) && $data['payment_method'] == 'credit') {
|
93 |
+
unset($params['note']);
|
94 |
+
}
|
95 |
+
|
96 |
+
if ($this->getRequest()->getParam('id'))
|
97 |
+
$params['readonly'] = 'readonly';
|
98 |
+
|
99 |
+
|
100 |
+
if (isset($data['tax_amount']) && $data['tax_amount']) {
|
101 |
+
$taxParams = $params;
|
102 |
+
unset($taxParams['after_element_html']);
|
103 |
+
if (isset($taxParams['note'])) unset($taxParams['note']);
|
104 |
+
|
105 |
+
$taxParams['name'] = 'amount_incl_tax';
|
106 |
+
$fieldset->addField('amount_incl_tax', 'text', $taxParams);
|
107 |
+
|
108 |
+
$taxParams['name'] = 'tax_amount';
|
109 |
+
$taxParams['label'] = Mage::helper('affiliateplus')->__('Tax');
|
110 |
+
$fieldset->addField('tax_amount', 'text', $taxParams);
|
111 |
+
|
112 |
+
$params['label'] = Mage::helper('affiliateplus')->__('Amount (Excl. Tax)');
|
113 |
+
}
|
114 |
+
if (isset($data['affiliateplus_account']) && $data['affiliateplus_account']) {
|
115 |
+
$rate = Mage::helper('affiliateplus/payment_tax')->getTaxRate($data['affiliateplus_account']);
|
116 |
+
if ($rate > 0) {
|
117 |
+
$taxParams = $params;
|
118 |
+
|
119 |
+
$taxParams['name'] = 'amount_incl_tax';
|
120 |
+
$taxParams['note'] = Mage::helper('affiliateplus')->__('Including %s tax', round($rate, 2) . '%');
|
121 |
+
$taxParams['after_element_html'] = '
|
122 |
+
<script type="text/javascript">
|
123 |
+
var request_amount_max ='.$data['account_balance'].';
|
124 |
+
function checkAmountBalance(el){
|
125 |
+
el.value = parseFloat(el.value);
|
126 |
+
if (el.value < 0) el.value = 0;
|
127 |
+
else if (el.value > request_amount_max || el.value == \'NaN\') el.value = request_amount_max;
|
128 |
+
var taxRate = '.$rate.';
|
129 |
+
var taxAmount = el.value * taxRate / (100 + taxRate);
|
130 |
+
taxAmount = Math.round(taxAmount * 100) / 100;
|
131 |
+
$(\'amount\').value = el.value - taxAmount;
|
132 |
+
}
|
133 |
+
function changeRealAmount(el) {
|
134 |
+
var taxRate = '.$rate.';
|
135 |
+
var maxRequestAmount = request_amount_max * taxRate / (100 + taxRate);
|
136 |
+
maxRequestAmount = Math.round(maxRequestAmount * 100) / 100;
|
137 |
+
|
138 |
+
el.value = parseFloat(el.value);
|
139 |
+
if (el.value < 0) el.value = 0;
|
140 |
+
else if (el.value > maxRequestAmount || el.value == \'NaN\') el.value = maxRequestAmount;
|
141 |
+
|
142 |
+
var taxAmount = el.value * taxRate / 100;
|
143 |
+
var totalAmount = parseFloat(el.value) + parseFloat(taxAmount);
|
144 |
+
totalAmount = Math.round(totalAmount * 100) / 100;
|
145 |
+
$(\'amount_incl_tax\').value = totalAmount;
|
146 |
+
}
|
147 |
+
</script>
|
148 |
+
';
|
149 |
+
$fieldset->addField('amount_incl_tax', 'text', $taxParams);
|
150 |
+
$params['label'] = Mage::helper('affiliateplus')->__('Amount (Excl. Tax)');
|
151 |
+
$params['onchange'] = 'changeRealAmount(this)';
|
152 |
+
unset($params['after_element_html']);
|
153 |
+
}
|
154 |
+
}
|
155 |
+
$fieldset->addField('amount', 'text', $params);
|
156 |
+
|
157 |
+
$paymentMethods = $this->_getPaymentHelper()->getAvailablePayment();
|
158 |
+
|
159 |
+
if (isset($data['payment_method']) && $data['payment_method'] == 'credit') {
|
160 |
+
$fieldset->addField('credit_refund_amount', 'text', array(
|
161 |
+
'name' => 'credit_refund_amount',
|
162 |
+
'label' => Mage::helper('affiliateplus')->__('Refunded'),
|
163 |
+
'readonly' => true,
|
164 |
+
));
|
165 |
+
$fieldset->addField('order_increment_id', 'note', array(
|
166 |
+
'label' => Mage::helper('affiliateplus')->__('Pay for Order'),
|
167 |
+
'text' => '<a title="'.Mage::helper('affiliateplus')->__('View Order')
|
168 |
+
. '" href="' . Mage::getUrl('adminhtml/sales_order/view', array('order_id' => $data['credit_order_id']))
|
169 |
+
. '">#'
|
170 |
+
. $data['credit_order_increment_id'] . '</a>'
|
171 |
+
));
|
172 |
+
} else if (!$this->_isActivePaymentPlugin()) {
|
173 |
+
$fieldset->addField('payment_method', 'hidden', array(
|
174 |
+
'name' => 'payment_method',
|
175 |
+
'value' => 'paypal',
|
176 |
+
));
|
177 |
+
$feeParams = array(
|
178 |
+
'label' => Mage::helper('affiliateplus')->__('Fee'),
|
179 |
+
'name' => 'fee',
|
180 |
+
);
|
181 |
+
if (isset($data['status']) && $data['status'] >= 3) {
|
182 |
+
$feeParams['disabled'] = true;
|
183 |
+
}
|
184 |
+
$fieldset->addField('fee', 'text', $feeParams);
|
185 |
+
|
186 |
+
$fieldset->addField('paypal_email', 'text', array(
|
187 |
+
'label' => Mage::helper('affiliateplus')->__('Paypal Email'),
|
188 |
+
'name' => 'paypal_email',
|
189 |
+
'readonly' => 'readonly',
|
190 |
+
'class' => 'required-entry',
|
191 |
+
'required' => true,
|
192 |
+
));
|
193 |
+
|
194 |
+
if ($data['transaction_id'] || $data['status'] < 3) {
|
195 |
+
$fieldset->addField('transaction_id', 'text', array(
|
196 |
+
'label' => Mage::helper('affiliateplus')->__('Transaction ID'),
|
197 |
+
'name' => 'transaction_id',
|
198 |
+
// 'class' => 'required-entry',
|
199 |
+
// 'required' => true,
|
200 |
+
));
|
201 |
+
}
|
202 |
+
} else {
|
203 |
+
$params = array(
|
204 |
+
'label' => Mage::helper('affiliateplus')->__('Payment Method'),
|
205 |
+
'name' => 'payment_method',
|
206 |
+
'required' => true,
|
207 |
+
'values' => $this->_getPaymentHelper()->getPaymentOption(),
|
208 |
+
'onclick' => 'changePaymentMethod(this);',
|
209 |
+
);
|
210 |
+
|
211 |
+
if ($data['status'] >= 3 || $data['is_request'] == 1) {
|
212 |
+
$params['disabled'] = true;
|
213 |
+
$fieldset->addField('temp_payment_method', 'select', $params);
|
214 |
+
|
215 |
+
$fieldset->addField('payment_method', 'hidden', array(
|
216 |
+
'name' => 'payment_method',
|
217 |
+
));
|
218 |
+
}else{
|
219 |
+
if ($this->getRequest()->getParam('id')) {
|
220 |
+
$params['disabled'] = true;
|
221 |
+
}
|
222 |
+
$fieldset->addField('payment_method', 'select', $params);
|
223 |
+
}
|
224 |
+
|
225 |
+
$feeParams = array(
|
226 |
+
'label' => Mage::helper('affiliateplus')->__('Fee'),
|
227 |
+
'name' => 'fee',
|
228 |
+
);
|
229 |
+
if (isset($data['status']) && $data['status'] >= 3) {
|
230 |
+
$feeParams['disabled'] = true;
|
231 |
+
}
|
232 |
+
$fieldset->addField('fee', 'text', $feeParams);
|
233 |
+
|
234 |
+
$form->addFieldset('payment_method_data', array('legend' => Mage::helper('affiliateplus')->__('Payment Method Information')));
|
235 |
+
|
236 |
+
foreach ($paymentMethods as $code => $paymentMethod) {
|
237 |
+
$paymentFieldset = $form->addFieldset("payment_fieldset_$code");
|
238 |
+
|
239 |
+
Mage::dispatchEvent("affiliateplus_adminhtml_payment_method_form_$code", array(
|
240 |
+
'form' => $form,
|
241 |
+
'fieldset' => $paymentFieldset,
|
242 |
+
));
|
243 |
+
if ($code == 'paypal') {
|
244 |
+
$readOnly = (isset($data['status']) && $data['status'] >= 3);
|
245 |
+
$paymentFieldset->addField('paypal_email', 'text', array(
|
246 |
+
'label' => Mage::helper('affiliateplus')->__('Paypal Email'),
|
247 |
+
'name' => 'paypal_email',
|
248 |
+
'readonly' => 'readonly',
|
249 |
+
'class' => 'required-entry',
|
250 |
+
'required' => true,
|
251 |
+
'note' => $readOnly ? null : Mage::helper('affiliateplus')->__('You can change this email on the acount edit page'),
|
252 |
+
));
|
253 |
+
|
254 |
+
// if($methodPaypalPayment != 'api'){
|
255 |
+
$params = array(
|
256 |
+
'label' => Mage::helper('affiliateplus')->__('Transaction ID'),
|
257 |
+
'name' => 'transaction_id',
|
258 |
+
// 'class' => 'required-entry',
|
259 |
+
// 'required' => true,
|
260 |
+
);
|
261 |
+
if ($readOnly)
|
262 |
+
$params['readonly'] = 'readonly';
|
263 |
+
if (!$readOnly || (isset($data['paypal_transaction_id']) && $data['paypal_transaction_id'])) {
|
264 |
+
$paymentFieldset->addField('paypal_transaction_id', 'text', $params);
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
$fieldset->addField('javascript', 'hidden', array(
|
269 |
+
'after_element_html' => '
|
270 |
+
<script type="text/javascript">
|
271 |
+
function changePaymentMethod(el){
|
272 |
+
var payment_fieldset = "payment_fieldset_" + el.value;
|
273 |
+
$$("div.fieldset").each(function(e){
|
274 |
+
if (e.id.startsWith("payment_fieldset_")){
|
275 |
+
e.hide();
|
276 |
+
var i = 0;
|
277 |
+
while(e.down(".required-entry",i) != undefined)
|
278 |
+
e.down(".required-entry",i++).disabled = true;
|
279 |
+
}if (e.id == payment_fieldset){
|
280 |
+
var i = 0;
|
281 |
+
while(e.down(".required-entry",i) != undefined)
|
282 |
+
e.down(".required-entry",i++).disabled = false;
|
283 |
+
e.show();
|
284 |
+
}
|
285 |
+
});
|
286 |
+
if (el.value == "paypal" || el.value == "moneybooker") {
|
287 |
+
$("pay_now").parentNode.parentNode.show();
|
288 |
+
} else {
|
289 |
+
$("pay_now").parentNode.parentNode.hide();
|
290 |
+
}
|
291 |
+
}
|
292 |
+
document.observe("dom:loaded",function(){
|
293 |
+
if ($("payment_method_data")) $("payment_method_data").hide();
|
294 |
+
changePaymentMethod($("payment_method"));
|
295 |
+
});
|
296 |
+
</script>
|
297 |
+
',
|
298 |
+
));
|
299 |
+
}
|
300 |
+
|
301 |
+
//event to add more field
|
302 |
+
Mage::dispatchEvent('affiliateplus_adminhtml_add_field_payment_form', array('fieldset' => $fieldset, 'form' => $form));
|
303 |
+
/*
|
304 |
+
$params = array(
|
305 |
+
'label' => Mage::helper('affiliateplus')->__('Status'),
|
306 |
+
'name' => 'status',
|
307 |
+
'values' => array(
|
308 |
+
array('value' => 3, 'label' => Mage::helper('affiliateplus')->__('Completed')),
|
309 |
+
array('value' => 1, 'label' => Mage::helper('affiliateplus')->__('Waiting')),
|
310 |
+
array('value' => 2, 'label' => Mage::helper('affiliateplus')->__('Processing')),
|
311 |
+
array('value' => 4, 'label' => Mage::helper('affiliateplus')->__('Canceled')),
|
312 |
+
));
|
313 |
+
*/
|
314 |
+
$status = array(
|
315 |
+
'1' => Mage::helper('affiliateplus')->__('Pending'),
|
316 |
+
'2' => Mage::helper('affiliateplus')->__('Processing'),
|
317 |
+
'3' => Mage::helper('affiliateplus')->__('Completed'),
|
318 |
+
'4' => Mage::helper('affiliateplus')->__('Canceled')
|
319 |
+
);
|
320 |
+
// if (/* ($methodPaypalPayment == 'api' && $data['payment_method'] == 'paypal') || */$data['status'] >= 3 /* completed */)
|
321 |
+
// $params['disabled'] = true;
|
322 |
+
|
323 |
+
$id = $this->getRequest()->getParam('id');
|
324 |
+
|
325 |
+
if ($id) {
|
326 |
+
// $fieldset->addField('status', 'select', $params);
|
327 |
+
$fieldset->addField('status_note', 'note', array(
|
328 |
+
'label' => Mage::helper('affiliateplus')->__('Status'),
|
329 |
+
'text' => '<strong>' . $status[$data['status']] . '</strong>'
|
330 |
+
));
|
331 |
+
$fieldset->addField('status', 'hidden', array(
|
332 |
+
'name' => 'status',
|
333 |
+
));
|
334 |
+
$fieldset->addField('request_time', 'note', array(
|
335 |
+
'label' => Mage::helper('affiliateplus')->__('Requested time'),
|
336 |
+
'name' => 'request_time',
|
337 |
+
'text' => $this->formatDate($data['request_time'], 'medium')
|
338 |
+
));
|
339 |
+
}
|
340 |
+
|
341 |
+
//$form->removeField('payment_data');
|
342 |
+
|
343 |
+
$form->setValues($form->getFormValues());
|
344 |
+
|
345 |
+
return parent::_prepareForm();
|
346 |
+
}
|
347 |
+
|
348 |
+
protected function _isActivePaymentPlugin() {
|
349 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
350 |
+
$modulesArray = (array) $modules;
|
351 |
+
if (is_object($modulesArray['Magestore_Affiliatepluspayment']))
|
352 |
+
return $modulesArray['Magestore_Affiliatepluspayment']->is('active');
|
353 |
+
return false;
|
354 |
+
}
|
355 |
+
|
356 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tab/History.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Edit_Tab_History extends Mage_Adminhtml_Block_Template
|
4 |
+
{
|
5 |
+
protected function _prepareLayout() {
|
6 |
+
parent::_prepareLayout();
|
7 |
+
return $this->setTemplate('affiliateplus/payment/history.phtml');
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getFullHistory() {
|
11 |
+
if (!$this->hasData('collection')) {
|
12 |
+
$collection = Mage::getResourceModel('affiliateplus/payment_history_collection')
|
13 |
+
->addFieldToFilter('payment_id', $this->getPayment()->getId());
|
14 |
+
$collection->getSelect()->order('created_time DESC');
|
15 |
+
$this->setData('collection', $collection);
|
16 |
+
}
|
17 |
+
return $this->getData('collection');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getCollection() {
|
21 |
+
return $this->getFullHistory();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getPayment() {
|
25 |
+
if (Mage::registry('payment_data')) {
|
26 |
+
return Mage::registry('payment_data');
|
27 |
+
}
|
28 |
+
return new Varien_Object();
|
29 |
+
}
|
30 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tab/vssver2.scc
ADDED
Binary file
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/Tabs.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Payment_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('payment_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('affiliateplus')->__('Withdrawal Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('affiliateplus')->__('Withdrawal Information'),
|
18 |
+
'title' => Mage::helper('affiliateplus')->__('Withdrawal Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('affiliateplustrash/adminhtml_payment_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
if ($this->getRequest()->getParam('id')) {
|
23 |
+
$this->addTab('history_tab', array(
|
24 |
+
'label' => Mage::helper('affiliateplus')->__('Status History'),
|
25 |
+
'title' => Mage::helper('affiliateplus')->__('Status History'),
|
26 |
+
'content' => $this->getLayout()->createBlock('affiliateplustrash/adminhtml_payment_edit_tab_history')->toHtml(),
|
27 |
+
));
|
28 |
+
}
|
29 |
+
|
30 |
+
return parent::_beforeToHtml();
|
31 |
+
}
|
32 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Payment/Edit/vssver2.scc
ADDED
Binary file
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Transaction/Deleted.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Deleted Transaction Block
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Transaction_Deleted
|
30 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Container
|
31 |
+
{
|
32 |
+
|
33 |
+
public function __construct()
|
34 |
+
{
|
35 |
+
$this->_controller = 'adminhtml_transaction_deleted';
|
36 |
+
$this->_blockGroup = 'affiliateplustrash';
|
37 |
+
$this->_headerText = Mage::helper('affiliateplustrash')->__('Deleted Transaction Manager');
|
38 |
+
parent::__construct();
|
39 |
+
$this->_removeButton('add');
|
40 |
+
}
|
41 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Adminhtml/Transaction/Deleted/Grid.php
ADDED
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Affiliateplustrash Block
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Block_Adminhtml_Transaction_Deleted_Grid
|
30 |
+
extends Mage_Adminhtml_Block_Widget_Grid
|
31 |
+
{
|
32 |
+
public function __construct()
|
33 |
+
{
|
34 |
+
parent::__construct();
|
35 |
+
$this->setId('deletedTransactionGrid');
|
36 |
+
$this->setDefaultSort('transaction_id');
|
37 |
+
$this->setDefaultDir('DESC');
|
38 |
+
$this->setUseAjax(true);
|
39 |
+
$this->setSaveParametersInSession(true);
|
40 |
+
}
|
41 |
+
|
42 |
+
protected function _prepareCollection()
|
43 |
+
{
|
44 |
+
$collection = Mage::getModel('affiliateplus/transaction')->getCollection()
|
45 |
+
->setShowDeleted()->addFieldToFilter('transaction_is_deleted', 1);
|
46 |
+
|
47 |
+
//event to join other table
|
48 |
+
Mage::dispatchEvent('affiliateplus_adminhtml_join_transaction_other_table', array('collection' => $collection));
|
49 |
+
$collection ->getSelect()
|
50 |
+
->columns(array('customer_email'=>'if (main_table.customer_email="", "N/A", main_table.customer_email)'))
|
51 |
+
->columns(array('order_number'=>'if (main_table.order_number="", "N/A", main_table.order_number)'))
|
52 |
+
->columns(array('order_item_names'=>'if (main_table.order_item_names IS NULL, "N/A", main_table.order_item_names)'))
|
53 |
+
;
|
54 |
+
//Zend_Debug::dump($collection->getSelect()->__toString());
|
55 |
+
$this->setCollection($collection);
|
56 |
+
return parent::_prepareCollection();
|
57 |
+
}
|
58 |
+
|
59 |
+
protected function _prepareColumns()
|
60 |
+
{
|
61 |
+
$currencyCode = Mage::app()->getStore()->getBaseCurrency()->getCode();
|
62 |
+
|
63 |
+
$this->addColumn('transaction_id', array(
|
64 |
+
'header' => Mage::helper('affiliateplus')->__('ID'),
|
65 |
+
'align' =>'right',
|
66 |
+
'width' => '50px',
|
67 |
+
'index' => 'transaction_id',
|
68 |
+
));
|
69 |
+
|
70 |
+
$this->addColumn('order_item_names', array(
|
71 |
+
'header' => Mage::helper('affiliateplus')->__('Product Name'),
|
72 |
+
'align' =>'left',
|
73 |
+
'index' => 'order_item_names',
|
74 |
+
'filter_index' => 'if (main_table.order_item_names IS NULL, "N/A", main_table.order_item_names)',
|
75 |
+
'renderer' => 'affiliateplus/adminhtml_transaction_renderer_product',
|
76 |
+
));
|
77 |
+
|
78 |
+
$this->addColumn('account_email', array(
|
79 |
+
'header' => Mage::helper('affiliateplus')->__('Affiliate Email'),
|
80 |
+
'width' => '150px',
|
81 |
+
'index' => 'account_email',
|
82 |
+
'renderer' => 'affiliateplus/adminhtml_transaction_renderer_account',
|
83 |
+
));
|
84 |
+
|
85 |
+
$this->addColumn('customer_email', array(
|
86 |
+
'header' => Mage::helper('affiliateplus')->__('Customer Email'),
|
87 |
+
'width' => '150px',
|
88 |
+
'align' =>'left',
|
89 |
+
'index' => 'customer_email',
|
90 |
+
'filter_index' => 'if (main_table.customer_email="", "NA", main_table.customer_email)',
|
91 |
+
'renderer' => 'affiliateplus/adminhtml_transaction_renderer_customer',
|
92 |
+
));
|
93 |
+
|
94 |
+
$this->addColumn('order_number', array(
|
95 |
+
'header' => Mage::helper('affiliateplus')->__('Order'),
|
96 |
+
'width' => '150px',
|
97 |
+
'align' =>'left',
|
98 |
+
'index' => 'order_number',
|
99 |
+
'filter_index' => 'if (main_table.order_number="", "N/A", main_table.order_number)',
|
100 |
+
'renderer' => 'affiliateplus/adminhtml_transaction_renderer_order',
|
101 |
+
));
|
102 |
+
|
103 |
+
$this->addColumn('total_amount', array(
|
104 |
+
'header' => Mage::helper('affiliateplus')->__('Total Amount'),
|
105 |
+
'width' => '150px',
|
106 |
+
'align' =>'right',
|
107 |
+
'index' => 'total_amount',
|
108 |
+
'type' => 'price',
|
109 |
+
'currency_code' => $currencyCode,
|
110 |
+
));
|
111 |
+
|
112 |
+
$this->addColumn('commission', array(
|
113 |
+
'header' => Mage::helper('affiliateplus')->__('Commission'),
|
114 |
+
'width' => '150px',
|
115 |
+
'align' =>'right',
|
116 |
+
'index' => 'commission',
|
117 |
+
'type' => 'price',
|
118 |
+
'currency_code' => $currencyCode,
|
119 |
+
));
|
120 |
+
|
121 |
+
$this->addColumn('discount', array(
|
122 |
+
'header' => Mage::helper('affiliateplus')->__('Discount'),
|
123 |
+
'width' => '150px',
|
124 |
+
'align' =>'right',
|
125 |
+
'index' => 'discount',
|
126 |
+
'type' => 'price',
|
127 |
+
'currency_code' => $currencyCode,
|
128 |
+
));
|
129 |
+
|
130 |
+
//add event to add more column
|
131 |
+
Mage::dispatchEvent('affiliateplus_adminhtml_add_column_transaction_grid', array('grid' => $this));
|
132 |
+
|
133 |
+
$this->addColumn('created_time', array(
|
134 |
+
'header' => Mage::helper('affiliateplus')->__('Time'),
|
135 |
+
'width' => '150px',
|
136 |
+
'align' =>'right',
|
137 |
+
'index' => 'created_time',
|
138 |
+
'type' => 'date'
|
139 |
+
));
|
140 |
+
|
141 |
+
$this->addColumn('status', array(
|
142 |
+
'header' => Mage::helper('affiliateplus')->__('Status'),
|
143 |
+
'align' => 'left',
|
144 |
+
'width' => '80px',
|
145 |
+
'index' => 'status',
|
146 |
+
'type' => 'options',
|
147 |
+
'options' => array(
|
148 |
+
1 => 'Completed',
|
149 |
+
2 => 'Pending',
|
150 |
+
3 => 'Canceled',
|
151 |
+
),
|
152 |
+
));
|
153 |
+
|
154 |
+
$this->addColumn('store_id', array(
|
155 |
+
'header' => Mage::helper('affiliateplus')->__('Store view'),
|
156 |
+
'align' =>'left',
|
157 |
+
'index' =>'store_id',
|
158 |
+
'type' =>'store',
|
159 |
+
'store_view'=>true,
|
160 |
+
));
|
161 |
+
|
162 |
+
$this->addColumn('action',
|
163 |
+
array(
|
164 |
+
'header' => Mage::helper('affiliateplus')->__('Action'),
|
165 |
+
'width' => '100',
|
166 |
+
'type' => 'action',
|
167 |
+
'getter' => 'getId',
|
168 |
+
'actions' => array(
|
169 |
+
array(
|
170 |
+
'caption' => Mage::helper('affiliateplus')->__('View'),
|
171 |
+
'url' => array('base'=> 'affiliateplusadmin/*/view'),
|
172 |
+
'field' => 'id'
|
173 |
+
)
|
174 |
+
),
|
175 |
+
'filter' => false,
|
176 |
+
'sortable' => false,
|
177 |
+
'index' => 'stores',
|
178 |
+
'is_system' => true,
|
179 |
+
));
|
180 |
+
|
181 |
+
//$this->addExportType('*/*/exportCsv', Mage::helper('affiliateplus')->__('CSV'));
|
182 |
+
//$this->addExportType('*/*/exportXml', Mage::helper('affiliateplus')->__('XML'));
|
183 |
+
|
184 |
+
return parent::_prepareColumns();
|
185 |
+
}
|
186 |
+
|
187 |
+
protected function _prepareMassaction()
|
188 |
+
{
|
189 |
+
$this->setMassactionIdField('transaction_id');
|
190 |
+
$this->getMassactionBlock()->setFormFieldName('transaction');
|
191 |
+
|
192 |
+
$this->getMassactionBlock()->addItem('restore', array(
|
193 |
+
'label' => Mage::helper('affiliateplus')->__('Restore'),
|
194 |
+
'url' => $this->getUrl('*/*/massRestore'),
|
195 |
+
'confirm' => Mage::helper('affiliateplus')->__('Are you sure?'),
|
196 |
+
));
|
197 |
+
|
198 |
+
return $this;
|
199 |
+
}
|
200 |
+
|
201 |
+
public function getRowUrl($row)
|
202 |
+
{
|
203 |
+
return $this->getUrl('affiliateplusadmin/*/view', array('id' => $row->getId()));
|
204 |
+
}
|
205 |
+
|
206 |
+
public function getGridUrl()
|
207 |
+
{
|
208 |
+
return $this->getUrl('*/*/deletedGrid', array('_current'=>true));
|
209 |
+
}
|
210 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Block/Affiliateplustrash.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Affiliateplustrash Block
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Block_Affiliateplustrash extends Mage_Core_Block_Template
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* prepare block's layout
|
33 |
+
*
|
34 |
+
* @return Magestore_AffiliateplusTrash_Block_Affiliateplustrash
|
35 |
+
*/
|
36 |
+
public function _prepareLayout()
|
37 |
+
{
|
38 |
+
return parent::_prepareLayout();
|
39 |
+
}
|
40 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Helper/Data.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* AffiliateplusTrash Helper
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Helper_Data extends Mage_Core_Helper_Abstract
|
30 |
+
{
|
31 |
+
|
32 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Mysql4/Payment/Collection.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Rewrite Payment Collection Model
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Mysql4_Payment_Collection
|
30 |
+
extends Magestore_Affiliateplus_Model_Mysql4_Payment_Collection
|
31 |
+
{
|
32 |
+
protected $_showDeleted = false;
|
33 |
+
protected $_addedDeletedQuery = false;
|
34 |
+
|
35 |
+
public function setShowDeleted($value = true) {
|
36 |
+
$this->_showDeleted = $value;
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function load($printQuery = false, $logQuery = false) {
|
41 |
+
if ($this->_showDeleted == false
|
42 |
+
&& $this->_addedDeletedQuery == false
|
43 |
+
) {
|
44 |
+
$this->addFieldToFilter('payment_is_deleted', 0);
|
45 |
+
$this->_addedDeletedQuery = true;
|
46 |
+
}
|
47 |
+
return parent::load($printQuery, $logQuery);
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getSelectCountSql() {
|
51 |
+
if ($this->_showDeleted == false
|
52 |
+
&& $this->_addedDeletedQuery == false
|
53 |
+
) {
|
54 |
+
$this->addFieldToFilter('payment_is_deleted', 0);
|
55 |
+
$this->_addedDeletedQuery = true;
|
56 |
+
}
|
57 |
+
return parent::getSelectCountSql();
|
58 |
+
}
|
59 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Mysql4/Sales/Collection.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Rewrite Transaction Sales Collection
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Mysql4_Sales_Collection
|
30 |
+
extends Magestore_Affiliateplusstatistic_Model_Mysql4_Sales_Collection
|
31 |
+
{
|
32 |
+
protected $_showDeleted = false;
|
33 |
+
protected $_addedDeletedQuery = false;
|
34 |
+
|
35 |
+
public function setShowDeleted($value = true) {
|
36 |
+
$this->_showDeleted = $value;
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function load($printQuery = false, $logQuery = false) {
|
41 |
+
if ($this->_showDeleted == false
|
42 |
+
&& $this->_addedDeletedQuery == false
|
43 |
+
) {
|
44 |
+
$this->addFieldToFilter('transaction_is_deleted', 0);
|
45 |
+
$this->_addedDeletedQuery = true;
|
46 |
+
}
|
47 |
+
return parent::load($printQuery, $logQuery);
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getSelectCountSql() {
|
51 |
+
if ($this->_showDeleted == false
|
52 |
+
&& $this->_addedDeletedQuery == false
|
53 |
+
) {
|
54 |
+
$this->addFieldToFilter('transaction_is_deleted', 0);
|
55 |
+
$this->_addedDeletedQuery = true;
|
56 |
+
}
|
57 |
+
return parent::getSelectCountSql();
|
58 |
+
}
|
59 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Mysql4/Transaction/Collection.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Rewrite Transaction Collection Model
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Mysql4_Transaction_Collection
|
30 |
+
extends Magestore_Affiliateplus_Model_Mysql4_Transaction_Collection
|
31 |
+
{
|
32 |
+
protected $_showDeleted = false;
|
33 |
+
protected $_addedDeletedQuery = false;
|
34 |
+
|
35 |
+
public function setShowDeleted($value = true) {
|
36 |
+
$this->_showDeleted = $value;
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function load($printQuery = false, $logQuery = false) {
|
41 |
+
if ($this->_showDeleted == false
|
42 |
+
&& $this->_addedDeletedQuery == false
|
43 |
+
) {
|
44 |
+
$this->addFieldToFilter('transaction_is_deleted', 0);
|
45 |
+
$this->_addedDeletedQuery = true;
|
46 |
+
}
|
47 |
+
return parent::load($printQuery, $logQuery);
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getSelectCountSql() {
|
51 |
+
if ($this->_showDeleted == false
|
52 |
+
&& $this->_addedDeletedQuery == false
|
53 |
+
) {
|
54 |
+
$this->addFieldToFilter('transaction_is_deleted', 0);
|
55 |
+
$this->_addedDeletedQuery = true;
|
56 |
+
}
|
57 |
+
return parent::getSelectCountSql();
|
58 |
+
}
|
59 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Observer.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* AffiliateplusTrash Observer Model
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Observer
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* add massaction for transaction grid
|
33 |
+
* @param type $observer
|
34 |
+
*/
|
35 |
+
public function adminhtmlAddMassactionTransactionGrid($observer)
|
36 |
+
{
|
37 |
+
$grid = $observer['grid'];
|
38 |
+
$grid->getMassactionBlock()->addItem('delete', array(
|
39 |
+
'label' => Mage::helper('affiliateplustrash')->__('Move to Trash'),
|
40 |
+
'url' => $grid->getUrl('affiliateplustrashadmin/*/massDelete'),
|
41 |
+
'confirm' => Mage::helper('affiliateplustrash')->__('Are you sure?'),
|
42 |
+
));
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* update transaction edit form action button
|
47 |
+
*
|
48 |
+
* @param type $observer
|
49 |
+
*/
|
50 |
+
public function adminhtmlUpdateTransactionAction($observer)
|
51 |
+
{
|
52 |
+
$transaction = $observer['transaction'];
|
53 |
+
$form = $observer['form'];
|
54 |
+
|
55 |
+
if ($transaction->canRestore()) {
|
56 |
+
$form->addButton('restore', array(
|
57 |
+
'label' => Mage::helper('affiliateplustrash')->__('Restore'),
|
58 |
+
'onclick' => 'deleteConfirm(\''
|
59 |
+
. Mage::helper('affiliateplustrash')->__('Restore deleted transaction. Are you sure?')
|
60 |
+
. '\', \''
|
61 |
+
. $form->getUrl('affiliateplustrashadmin/*/restore', array('id' => $transaction->getId()))
|
62 |
+
. '\')',
|
63 |
+
'class' => 'save'
|
64 |
+
), 0);
|
65 |
+
// update back button to deleted transaction
|
66 |
+
$form->updateButton('back', 'onclick', 'setLocation(\'' . $form->getUrl('affiliateplustrashadmin/*/deleted') . '\')');
|
67 |
+
} else if ($transaction->getData('transaction_is_can_delete')) {
|
68 |
+
$form->addButton('restore', array(
|
69 |
+
'label' => Mage::helper('adminhtml')->__('Move to Trash'),
|
70 |
+
'onclick' => 'deleteConfirm(\''
|
71 |
+
. Mage::helper('affiliateplustrash')->__('Are you sure?')
|
72 |
+
. '\', \''
|
73 |
+
. $form->getUrl('affiliateplustrashadmin/*/delete', array('id' => $transaction->getId()))
|
74 |
+
. '\')',
|
75 |
+
'class' => 'delete'
|
76 |
+
), 0);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* update mass action for Payment
|
82 |
+
*
|
83 |
+
* @param type $observer
|
84 |
+
*/
|
85 |
+
public function adminhtmlPaymentMassaction($observer)
|
86 |
+
{
|
87 |
+
$grid = $observer['grid'];
|
88 |
+
$grid->setMassactionIdField('payment_id');
|
89 |
+
$grid->getMassactionBlock()->setFormFieldName('payment');
|
90 |
+
$grid->getMassactionBlock()->addItem('delete', array(
|
91 |
+
'label' => Mage::helper('affiliateplustrash')->__('Move to Trash'),
|
92 |
+
'url' => $grid->getUrl('affiliateplustrashadmin/*/massDelete'),
|
93 |
+
'confirm' => Mage::helper('affiliateplustrash')->__('Are you sure?'),
|
94 |
+
));
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* update payment form action
|
99 |
+
*
|
100 |
+
* @param type $observer
|
101 |
+
*/
|
102 |
+
public function adminhtmlPaymentEditFormAction($observer)
|
103 |
+
{
|
104 |
+
$form = $observer['form'];
|
105 |
+
$data = $observer['data'];
|
106 |
+
if ($data->canRestore()) {
|
107 |
+
$form->removeButton('cancel');
|
108 |
+
$form->removeButton('complete');
|
109 |
+
$form->removeButton('save_and_pay_manual');
|
110 |
+
$data->setData(array());
|
111 |
+
} else {
|
112 |
+
$form->addButton('restore', array(
|
113 |
+
'label' => Mage::helper('adminhtml')->__('Move to Trash'),
|
114 |
+
'onclick' => 'deleteConfirm(\''
|
115 |
+
. Mage::helper('affiliateplustrash')->__('Are you sure?')
|
116 |
+
. '\', \''
|
117 |
+
. $form->getUrl('affiliateplustrashadmin/*/delete', array('id' => $data->getId()))
|
118 |
+
. '\')',
|
119 |
+
'class' => 'delete'
|
120 |
+
), 0);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Payment.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Override affiliate plus payment
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Payment extends Magestore_Affiliateplus_Model_Payment
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* Add delete payement method for payment Model
|
33 |
+
*
|
34 |
+
* @return Magestore_AffiliateplusTrash_Model_Payment
|
35 |
+
*/
|
36 |
+
public function deletePayment() {
|
37 |
+
if ($this->canRestore()) return $this;
|
38 |
+
if (!$this->getId()) return $this;
|
39 |
+
|
40 |
+
$this->setData('payment_is_deleted', 1)->save();
|
41 |
+
// Return commission to affiliate account
|
42 |
+
if ($this->getData('is_reduced_balance') && !$this->getData('is_refund_balance')) {
|
43 |
+
$account = $this->getAffiliateplusAccount();
|
44 |
+
if ($account && $account->getId()) {
|
45 |
+
try {
|
46 |
+
$account->setBalance($account->getBalance() + $this->getAmount() + $this->getTaxAmount())
|
47 |
+
->setTotalPaid($account->getTotalPaid() - $this->getAmount() - $this->getTaxAmount());
|
48 |
+
$commissionReceived = $this->getAmount();
|
49 |
+
if (!$this->getIsPayerFee()) {
|
50 |
+
$commissionReceived -= $this->getFee();
|
51 |
+
}
|
52 |
+
$account->setTotalCommissionReceived($account->getTotalCommissionReceived() - $commissionReceived)
|
53 |
+
->save();
|
54 |
+
} catch (Exception $e) {
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
$this->addComment(Mage::helper('affiliateplustrash')->__('Delete Withdrawal'));
|
59 |
+
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Restore deleted payment
|
65 |
+
*
|
66 |
+
* @return Magestore_AffiliateplusTrash_Model_Payment
|
67 |
+
*/
|
68 |
+
public function restorePayment() {
|
69 |
+
if (!$this->canRestore()) return $this;
|
70 |
+
if (!$this->getId()) return $this;
|
71 |
+
|
72 |
+
$this->setData('payment_is_deleted', 0)->save();
|
73 |
+
// Return commission to affiliate account
|
74 |
+
if ($this->getData('is_reduced_balance') && !$this->getData('is_refund_balance')) {
|
75 |
+
$account = $this->getAffiliateplusAccount();
|
76 |
+
if ($account && $account->getId()) {
|
77 |
+
try {
|
78 |
+
$account->setBalance($account->getBalance() - $this->getAmount() - $this->getTaxAmount())
|
79 |
+
->setTotalPaid($account->getTotalPaid() + $this->getAmount() + $this->getTaxAmount());
|
80 |
+
$commissionReceived = $this->getAmount();
|
81 |
+
if (!$this->getIsPayerFee()) {
|
82 |
+
$commissionReceived -= $this->getFee();
|
83 |
+
}
|
84 |
+
$account->setTotalCommissionReceived($account->getTotalCommissionReceived() + $commissionReceived)
|
85 |
+
->save();
|
86 |
+
} catch (Exception $e) {
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
$this->addComment(Mage::helper('affiliateplustrash')->__('Restore Withdrawal'));
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* override load function for frontend view
|
97 |
+
*
|
98 |
+
* @param type $id
|
99 |
+
* @param type $field
|
100 |
+
* @return Magestore_AffiliateplusTrash_Model_Payment
|
101 |
+
*/
|
102 |
+
public function load($id, $field=null) {
|
103 |
+
parent::load($id, $field);
|
104 |
+
if (!Mage::app()->getStore()->isAdmin() && $this->canRestore()) {
|
105 |
+
$this->setData(array());
|
106 |
+
}
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Status.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* AffiliateplusTrash Status Model
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Status extends Varien_Object
|
30 |
+
{
|
31 |
+
const STATUS_ENABLED = 1;
|
32 |
+
const STATUS_DISABLED = 2;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* get model option as array
|
36 |
+
*
|
37 |
+
* @return array
|
38 |
+
*/
|
39 |
+
static public function getOptionArray()
|
40 |
+
{
|
41 |
+
return array(
|
42 |
+
self::STATUS_ENABLED => Mage::helper('affiliateplustrash')->__('Enabled'),
|
43 |
+
self::STATUS_DISABLED => Mage::helper('affiliateplustrash')->__('Disabled')
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* get model option hash as array
|
49 |
+
*
|
50 |
+
* @return array
|
51 |
+
*/
|
52 |
+
static public function getOptionHash()
|
53 |
+
{
|
54 |
+
$options = array();
|
55 |
+
foreach (self::getOptionArray() as $value => $label) {
|
56 |
+
$options[] = array(
|
57 |
+
'value' => $value,
|
58 |
+
'label' => $label
|
59 |
+
);
|
60 |
+
}
|
61 |
+
return $options;
|
62 |
+
}
|
63 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/Model/Transaction.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Override affiliate plus transaction
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Model_Transaction extends Magestore_Affiliateplus_Model_Transaction
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* Add delete transaction method for Transaction Model
|
33 |
+
*
|
34 |
+
* @return Magestore_Affiliateplus_Model_Transaction
|
35 |
+
*/
|
36 |
+
public function deleteTransaction() {
|
37 |
+
if ($this->canRestore()) return $this;
|
38 |
+
if (!$this->getId()) return $this;
|
39 |
+
|
40 |
+
if ($this->getStatus() == '1') {
|
41 |
+
// Remove commission for affiliate account
|
42 |
+
$account = Mage::getModel('affiliateplus/account')
|
43 |
+
->setStoreId($this->getStoreId())
|
44 |
+
->setBalanceIsGlobal((Mage::getStoreConfig('affiliateplus/account/balance', $this->getStoreId()) == 'global'))
|
45 |
+
->load($this->getAccountId());
|
46 |
+
$commission = $this->getCommission() + $this->getCommissionPlus() + $this->getCommission() * $this->getPercentPlus() / 100;
|
47 |
+
Mage::dispatchEvent('affiliateplus_adminhtml_prepare_commission', array('transaction' => $this));
|
48 |
+
if ($this->getRealTotalCommission()) {
|
49 |
+
$totalCommission = $this->getRealTotalCommission();
|
50 |
+
} else {
|
51 |
+
$totalCommission = $commission;
|
52 |
+
}
|
53 |
+
if ($account->getBalance() < $totalCommission) {
|
54 |
+
throw new Exception(Mage::helper('affiliateplus')->__('Account not enough balance to delete'));
|
55 |
+
}
|
56 |
+
$account = Mage::getModel('affiliateplus/account')
|
57 |
+
->setStoreId($this->getStoreId())
|
58 |
+
->load($this->getAccountId());
|
59 |
+
$account->setBalance($account->getBalance() - $commission)
|
60 |
+
->save();
|
61 |
+
|
62 |
+
//update balance tier affiliate
|
63 |
+
Mage::dispatchEvent('affiliateplus_cancel_transaction',array('transaction' => $this));
|
64 |
+
}
|
65 |
+
$this->setData('transaction_is_deleted', 1)->save();
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Restore deleted transaction
|
71 |
+
*
|
72 |
+
* @return Magestore_Affiliateplus_Model_Transaction
|
73 |
+
*/
|
74 |
+
public function restoreTransaction() {
|
75 |
+
if (!$this->canRestore()) return $this;
|
76 |
+
if (!$this->getId()) return $this;
|
77 |
+
|
78 |
+
if ($this->getStatus() == '1') {
|
79 |
+
// Add commission for affiliate account
|
80 |
+
$account = Mage::getModel('affiliateplus/account')
|
81 |
+
->setStoreId($this->getStoreId())
|
82 |
+
->load($this->getAccountId());
|
83 |
+
$commission = $this->getCommission() + $this->getCommissionPlus() + $this->getCommission() * $this->getPercentPlus() / 100;
|
84 |
+
$account->setBalance($account->getBalance() + $commission)->save();
|
85 |
+
|
86 |
+
// update balance tier affiliate
|
87 |
+
Mage::dispatchEvent('affiliateplus_complete_transaction',array('transaction' => $this));
|
88 |
+
}
|
89 |
+
$this->setData('transaction_is_deleted', 0)->save();
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/controllers/Adminhtml/PaymentController.php
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Affiliateplus payment trash Controller
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Adminhtml_PaymentController extends Mage_Adminhtml_Controller_Action
|
30 |
+
{
|
31 |
+
protected function _initAction() {
|
32 |
+
$this->loadLayout()
|
33 |
+
->_setActiveMenu('affiliateplus/payment')
|
34 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Payments Manager'), Mage::helper('adminhtml')->__('Payment Manager'));
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function deleteAction()
|
39 |
+
{
|
40 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
41 |
+
$paymentId = $this->getRequest()->getParam('id');
|
42 |
+
if ($paymentId > 0) {
|
43 |
+
$model = Mage::getModel('affiliateplus/payment');
|
44 |
+
try {
|
45 |
+
$model->load($paymentId)
|
46 |
+
->deletePayment();
|
47 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Withdrawal was moved to trash successfully'));
|
48 |
+
} catch (Exception $e) {
|
49 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
50 |
+
return $this->_redirect('affiliateplusadmin/*/view', array('id' => $paymentId));
|
51 |
+
}
|
52 |
+
}
|
53 |
+
$this->_redirect('affiliateplusadmin/*/index');
|
54 |
+
}
|
55 |
+
|
56 |
+
public function massDeleteAction()
|
57 |
+
{
|
58 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
59 |
+
$ids = $this->getRequest()->getParam('payment');
|
60 |
+
if (!is_array($ids)) {
|
61 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select withdrawal(s)'));
|
62 |
+
} else {
|
63 |
+
$collection = Mage::getResourceModel('affiliateplus/payment_collection');
|
64 |
+
$collection->addFieldToFilter('payment_id', array('in' => $ids));
|
65 |
+
$successed = 0;
|
66 |
+
foreach ($collection as $model) {
|
67 |
+
try {
|
68 |
+
$model->deletePayment();
|
69 |
+
$successed++;
|
70 |
+
} catch (Exception $e) {
|
71 |
+
|
72 |
+
}
|
73 |
+
}
|
74 |
+
if ($successed) {
|
75 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
76 |
+
$this->__('Total %s of %s withdrawals were moved to trash successfully', $successed, count($ids))
|
77 |
+
);
|
78 |
+
} else {
|
79 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
80 |
+
$this->__('No withdrawal is moved to trash')
|
81 |
+
);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
$this->_redirect('affiliateplusadmin/*/index');
|
85 |
+
}
|
86 |
+
|
87 |
+
public function deletedAction()
|
88 |
+
{
|
89 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
90 |
+
$this->_title($this->__('Affiliateplus'))->_title($this->__('Manage Deleted Withdrawals'));
|
91 |
+
$this->_initAction()
|
92 |
+
->renderLayout();
|
93 |
+
}
|
94 |
+
|
95 |
+
public function deletedGridAction()
|
96 |
+
{
|
97 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
98 |
+
$this->loadLayout();
|
99 |
+
$this->renderLayout();
|
100 |
+
}
|
101 |
+
|
102 |
+
public function restoreAction()
|
103 |
+
{
|
104 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
105 |
+
$paymentId = $this->getRequest()->getParam('id');
|
106 |
+
if ($paymentId > 0) {
|
107 |
+
$model = Mage::getModel('affiliateplus/payment');
|
108 |
+
try {
|
109 |
+
$model->load($paymentId)
|
110 |
+
->restorePayment();
|
111 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Withdrawal was restored successfully'));
|
112 |
+
} catch (Exception $e) {
|
113 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
114 |
+
return $this->_redirect('affiliateplusadmin/*/view', array('id' => $paymentId));
|
115 |
+
}
|
116 |
+
}
|
117 |
+
$this->_redirect('*/*/deleted');
|
118 |
+
}
|
119 |
+
|
120 |
+
public function massRestoreAction()
|
121 |
+
{
|
122 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
123 |
+
$ids = $this->getRequest()->getParam('payment');
|
124 |
+
if (!is_array($ids)) {
|
125 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select withdrawal(s)'));
|
126 |
+
} else {
|
127 |
+
$collection = Mage::getResourceModel('affiliateplus/payment_collection');
|
128 |
+
$collection->setShowDeleted()->addFieldToFilter('payment_is_deleted', 1)
|
129 |
+
->addFieldToFilter('payment_id', array('in' => $ids));
|
130 |
+
$successed = 0;
|
131 |
+
foreach ($collection as $model) {
|
132 |
+
try {
|
133 |
+
$model->restorePayment();
|
134 |
+
$successed++;
|
135 |
+
} catch (Exception $e) {
|
136 |
+
|
137 |
+
}
|
138 |
+
}
|
139 |
+
if ($successed) {
|
140 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
141 |
+
$this->__('Total %s of %s withdrawals were restored successfully', $successed, count($ids))
|
142 |
+
);
|
143 |
+
} else {
|
144 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
145 |
+
$this->__('No withdrawal is restored')
|
146 |
+
);
|
147 |
+
}
|
148 |
+
}
|
149 |
+
$this->_redirect('*/*/deleted');
|
150 |
+
}
|
151 |
+
|
152 |
+
protected function _isAllowed()
|
153 |
+
{
|
154 |
+
return Mage::getSingleton('admin/session')->isAllowed('affiliateplus');
|
155 |
+
}
|
156 |
+
|
157 |
+
public function editAction() {
|
158 |
+
if (!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)) {
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
$id = $this->getRequest()->getParam('id');
|
162 |
+
$payment = Mage::getModel('affiliateplus/payment')->load($id);
|
163 |
+
|
164 |
+
$this->_title($this->__('Affiliateplus'))->_title($this->__('Manage Withdrawals'));
|
165 |
+
|
166 |
+
if ($payment && $payment->getId()) {
|
167 |
+
$this->_title($this->__($payment->getAccountName()));
|
168 |
+
}
|
169 |
+
|
170 |
+
if ($payment->getId() || $id == 0) {
|
171 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
172 |
+
|
173 |
+
if (!empty($data)) {
|
174 |
+
$payment->addData($data);
|
175 |
+
}
|
176 |
+
|
177 |
+
if ($payment->getId())
|
178 |
+
$payment->addPaymentInfo();
|
179 |
+
|
180 |
+
Mage::register('payment_data', $payment);
|
181 |
+
|
182 |
+
$this->loadLayout();
|
183 |
+
$this->_setActiveMenu('affiliateplus/payment');
|
184 |
+
|
185 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Payment Manager'), Mage::helper('adminhtml')->__('Withdrawals Manager'));
|
186 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Payment News'), Mage::helper('adminhtml')->__('Withdrawal News'));
|
187 |
+
|
188 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
189 |
+
|
190 |
+
$this->_addContent($this->getLayout()->createBlock('affiliateplustrash/adminhtml_payment_edit'))
|
191 |
+
->_addLeft($this->getLayout()->createBlock('affiliateplustrash/adminhtml_payment_edit_tabs'));
|
192 |
+
|
193 |
+
$this->renderLayout();
|
194 |
+
} else {
|
195 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('affiliateplus')->__('Item does not exist'));
|
196 |
+
$this->_redirect('*/*/');
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/controllers/Adminhtml/TransactionController.php
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Affiliateplus transaction trash Controller
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_Adminhtml_TransactionController extends Mage_Adminhtml_Controller_Action
|
30 |
+
{
|
31 |
+
protected function _initAction() {
|
32 |
+
$this->loadLayout()
|
33 |
+
->_setActiveMenu('affiliateplus/transaction')
|
34 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Transactions Manager'), Mage::helper('adminhtml')->__('Transaction Manager'));
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function deleteAction()
|
39 |
+
{
|
40 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
41 |
+
$transactionId = $this->getRequest()->getParam('id');
|
42 |
+
if ($transactionId > 0) {
|
43 |
+
$model = Mage::getModel('affiliateplus/transaction');
|
44 |
+
try {
|
45 |
+
$model->load($transactionId)
|
46 |
+
->deleteTransaction();
|
47 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Transaction was moved to trash successfully'));
|
48 |
+
} catch (Exception $e) {
|
49 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
50 |
+
return $this->_redirect('affiliateplusadmin/*/view', array('id' => $transactionId));
|
51 |
+
}
|
52 |
+
}
|
53 |
+
$this->_redirect('affiliateplusadmin/*/index');
|
54 |
+
}
|
55 |
+
|
56 |
+
public function massDeleteAction()
|
57 |
+
{
|
58 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
59 |
+
$ids = $this->getRequest()->getParam('transaction');
|
60 |
+
if (!is_array($ids)) {
|
61 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select transaction(s)'));
|
62 |
+
} else {
|
63 |
+
$collection = Mage::getResourceModel('affiliateplus/transaction_collection');
|
64 |
+
$collection->addFieldToFilter('transaction_id', array('in' => $ids));
|
65 |
+
$successed = 0;
|
66 |
+
foreach ($collection as $model) {
|
67 |
+
try {
|
68 |
+
$model->deleteTransaction();
|
69 |
+
$successed++;
|
70 |
+
} catch (Exception $e) {
|
71 |
+
|
72 |
+
}
|
73 |
+
}
|
74 |
+
if ($successed) {
|
75 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
76 |
+
$this->__('Total %s of %s transactions were moved to trash successfully', $successed, count($ids))
|
77 |
+
);
|
78 |
+
} else {
|
79 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
80 |
+
$this->__('No transaction is moved to trash')
|
81 |
+
);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
$this->_redirect('affiliateplusadmin/*/index');
|
85 |
+
}
|
86 |
+
|
87 |
+
public function deletedAction()
|
88 |
+
{
|
89 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
90 |
+
$this->_title($this->__('Affiliateplus'))->_title($this->__('Manage Deleted Transactions'));
|
91 |
+
$this->_initAction()
|
92 |
+
->renderLayout();
|
93 |
+
}
|
94 |
+
|
95 |
+
public function deletedGridAction()
|
96 |
+
{
|
97 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
98 |
+
$this->loadLayout();
|
99 |
+
$this->renderLayout();
|
100 |
+
}
|
101 |
+
|
102 |
+
public function restoreAction()
|
103 |
+
{
|
104 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
105 |
+
$transactionId = $this->getRequest()->getParam('id');
|
106 |
+
if ($transactionId > 0) {
|
107 |
+
$model = Mage::getModel('affiliateplus/transaction');
|
108 |
+
try {
|
109 |
+
$model->load($transactionId)
|
110 |
+
->restoreTransaction();
|
111 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Transaction was restored successfully'));
|
112 |
+
} catch (Exception $e) {
|
113 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
114 |
+
return $this->_redirect('affiliateplusadmin/*/view', array('id' => $transactionId));
|
115 |
+
}
|
116 |
+
}
|
117 |
+
$this->_redirect('*/*/deleted');
|
118 |
+
}
|
119 |
+
|
120 |
+
public function massRestoreAction()
|
121 |
+
{
|
122 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
123 |
+
$ids = $this->getRequest()->getParam('transaction');
|
124 |
+
if (!is_array($ids)) {
|
125 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select transaction(s)'));
|
126 |
+
} else {
|
127 |
+
$collection = Mage::getResourceModel('affiliateplus/transaction_collection');
|
128 |
+
$collection->setShowDeleted()->addFieldToFilter('transaction_is_deleted', 1)
|
129 |
+
->addFieldToFilter('transaction_id', array('in' => $ids));
|
130 |
+
$successed = 0;
|
131 |
+
foreach ($collection as $model) {
|
132 |
+
try {
|
133 |
+
$model->restoreTransaction();
|
134 |
+
$successed++;
|
135 |
+
} catch (Exception $e) {
|
136 |
+
|
137 |
+
}
|
138 |
+
}
|
139 |
+
if ($successed) {
|
140 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
141 |
+
$this->__('Total %s of %s transactions were restored successfully', $successed, count($ids))
|
142 |
+
);
|
143 |
+
} else {
|
144 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
145 |
+
$this->__('No transaction is restored')
|
146 |
+
);
|
147 |
+
}
|
148 |
+
}
|
149 |
+
$this->_redirect('*/*/deleted');
|
150 |
+
}
|
151 |
+
|
152 |
+
protected function _isAllowed()
|
153 |
+
{
|
154 |
+
return Mage::getSingleton('admin/session')->isAllowed('affiliateplus');
|
155 |
+
}
|
156 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/controllers/IndexController.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* AffiliateplusTrash Index Controller
|
24 |
+
*
|
25 |
+
* @category Magestore
|
26 |
+
* @package Magestore_AffiliateplusTrash
|
27 |
+
* @author Magestore Developer
|
28 |
+
*/
|
29 |
+
class Magestore_AffiliateplusTrash_IndexController extends Mage_Core_Controller_Front_Action
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* index action
|
33 |
+
*/
|
34 |
+
public function indexAction()
|
35 |
+
{
|
36 |
+
$this->loadLayout();
|
37 |
+
$this->renderLayout();
|
38 |
+
}
|
39 |
+
}
|
app/code/local/Magestore/AffiliateplusTrash/etc/adminhtml.xml
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magestore
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Magestore.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.magestore.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Magestore
|
18 |
+
* @package Magestore_AffiliateplusTrash
|
19 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
20 |
+
* @license http://www.magestore.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
<menu>
|
25 |
+
<affiliateplus>
|
26 |
+
<children>
|
27 |
+
<trash module="affiliateplustrash" translate="title">
|
28 |
+
<title>Trash</title>
|
29 |
+
<sort_order>300</sort_order>
|
30 |
+
<children>
|
31 |
+
<transaction module="affiliateplustrash" translate="title">
|
32 |
+
<title>Transactions</title>
|
33 |
+
<sort_order>10</sort_order>
|
34 |
+
<action>affiliateplustrashadmin/adminhtml_transaction/deleted</action>
|
35 |
+
</transaction>
|
36 |
+
<payment module="affiliateplustrash" translate="title">
|
37 |
+
<title>Withdrawals</title>
|
38 |
+
<sort_order>20</sort_order>
|
39 |
+
<action>affiliateplustrashadmin/adminhtml_payment/deleted</action>
|
40 |
+
</payment>
|
41 |
+
</children>
|
42 |
+
</trash>
|
43 |
+
</children>
|
44 |
+
</affiliateplus>
|
45 |
+
</menu>
|
46 |
+
<acl>
|
47 |
+
<resources>
|
48 |
+
<admin>
|
49 |
+
<children>
|
50 |
+
<affiliateplus>
|
51 |
+
<children>
|
52 |
+
<trash module="affiliateplustrash" translate="title">
|
53 |
+
<title>Trash</title>
|
54 |
+
<sort_order>39</sort_order>
|
55 |
+
<children>
|
56 |
+
<transaction module="affiliateplustrash" translate="title">
|
57 |
+
<title>Transactions</title>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
</transaction>
|
60 |
+
<payment module="affiliateplustrash" translate="title">
|
61 |
+
<title>Withdrawals</title>
|
62 |
+
<sort_order>20</sort_order>
|
63 |
+
</payment>
|
64 |
+
</children>
|
65 |
+
</trash>
|
66 |
+
</children>
|
67 |
+
</affiliateplus>
|
68 |
+
</children>
|
69 |
+
</admin>
|
70 |
+
</resources>
|
71 |
+
</acl>
|
72 |
+
</config>
|
app/code/local/Magestore/AffiliateplusTrash/etc/config.xml
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magestore
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Magestore.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.magestore.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Magestore
|
18 |
+
* @package Magestore_AffiliateplusTrash
|
19 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
20 |
+
* @license http://www.magestore.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
<modules>
|
25 |
+
<Magestore_AffiliateplusTrash>
|
26 |
+
<version>0.1.0</version>
|
27 |
+
</Magestore_AffiliateplusTrash>
|
28 |
+
</modules>
|
29 |
+
<frontend>
|
30 |
+
<routers>
|
31 |
+
<affiliateplustrash>
|
32 |
+
<use>standard</use>
|
33 |
+
<args>
|
34 |
+
<module>Magestore_AffiliateplusTrash</module>
|
35 |
+
<frontName>affiliateplustrash</frontName>
|
36 |
+
</args>
|
37 |
+
</affiliateplustrash>
|
38 |
+
</routers>
|
39 |
+
<translate>
|
40 |
+
<modules>
|
41 |
+
<Magestore_AffiliateplusTrash>
|
42 |
+
<files>
|
43 |
+
<default>Magestore_AffiliateplusTrash.csv</default>
|
44 |
+
</files>
|
45 |
+
</Magestore_AffiliateplusTrash>
|
46 |
+
</modules>
|
47 |
+
</translate>
|
48 |
+
</frontend>
|
49 |
+
<admin>
|
50 |
+
<routers>
|
51 |
+
<affiliateplustrashadmin>
|
52 |
+
<use>admin</use>
|
53 |
+
<args>
|
54 |
+
<module>Magestore_AffiliateplusTrash</module>
|
55 |
+
<frontName>affiliateplustrashadmin</frontName>
|
56 |
+
</args>
|
57 |
+
</affiliateplustrashadmin>
|
58 |
+
</routers>
|
59 |
+
</admin>
|
60 |
+
<adminhtml>
|
61 |
+
<layout>
|
62 |
+
<updates>
|
63 |
+
<affiliateplustrash>
|
64 |
+
<file>affiliateplustrash.xml</file>
|
65 |
+
</affiliateplustrash>
|
66 |
+
</updates>
|
67 |
+
</layout>
|
68 |
+
<translate>
|
69 |
+
<modules>
|
70 |
+
<Magestore_AffiliateplusTrash>
|
71 |
+
<files>
|
72 |
+
<default>Magestore_AffiliateplusTrash.csv</default>
|
73 |
+
</files>
|
74 |
+
</Magestore_AffiliateplusTrash>
|
75 |
+
</modules>
|
76 |
+
</translate>
|
77 |
+
<events>
|
78 |
+
<affiliateplus_adminhtml_add_massaction_transaction_grid>
|
79 |
+
<observers>
|
80 |
+
<affiliateplustrash_observers>
|
81 |
+
<class>affiliateplustrash/observer</class>
|
82 |
+
<method>adminhtmlAddMassactionTransactionGrid</method>
|
83 |
+
</affiliateplustrash_observers>
|
84 |
+
</observers>
|
85 |
+
</affiliateplus_adminhtml_add_massaction_transaction_grid>
|
86 |
+
<affiliateplus_adminhtml_update_transaction_action>
|
87 |
+
<observers>
|
88 |
+
<affiliateplustrash_observers>
|
89 |
+
<class>affiliateplustrash/observer</class>
|
90 |
+
<method>adminhtmlUpdateTransactionAction</method>
|
91 |
+
</affiliateplustrash_observers>
|
92 |
+
</observers>
|
93 |
+
</affiliateplus_adminhtml_update_transaction_action>
|
94 |
+
|
95 |
+
<affiliateplus_adminhtml_payment_massaction>
|
96 |
+
<observers>
|
97 |
+
<affiliateplustrash_observers>
|
98 |
+
<class>affiliateplustrash/observer</class>
|
99 |
+
<method>adminhtmlPaymentMassaction</method>
|
100 |
+
</affiliateplustrash_observers>
|
101 |
+
</observers>
|
102 |
+
</affiliateplus_adminhtml_payment_massaction>
|
103 |
+
<affiliateplus_adminhtml_payment_edit_form_action>
|
104 |
+
<observers>
|
105 |
+
<affiliateplustrash_observers>
|
106 |
+
<class>affiliateplustrash/observer</class>
|
107 |
+
<method>adminhtmlPaymentEditFormAction</method>
|
108 |
+
</affiliateplustrash_observers>
|
109 |
+
</observers>
|
110 |
+
</affiliateplus_adminhtml_payment_edit_form_action>
|
111 |
+
</events>
|
112 |
+
</adminhtml>
|
113 |
+
<global>
|
114 |
+
<models>
|
115 |
+
<affiliateplus>
|
116 |
+
<rewrite>
|
117 |
+
<transaction>Magestore_AffiliateplusTrash_Model_Transaction</transaction>
|
118 |
+
<payment>Magestore_AffiliateplusTrash_Model_Payment</payment>
|
119 |
+
</rewrite>
|
120 |
+
</affiliateplus>
|
121 |
+
<affiliateplustrash>
|
122 |
+
<class>Magestore_AffiliateplusTrash_Model</class>
|
123 |
+
<resourceModel>affiliateplustrash_mysql4</resourceModel>
|
124 |
+
</affiliateplustrash>
|
125 |
+
<affiliateplustrash_mysql4>
|
126 |
+
<class>Magestore_AffiliateplusTrash_Model_Mysql4</class>
|
127 |
+
</affiliateplustrash_mysql4>
|
128 |
+
<affiliateplus_mysql4>
|
129 |
+
<rewrite>
|
130 |
+
<transaction_collection>Magestore_AffiliateplusTrash_Model_Mysql4_Transaction_Collection</transaction_collection>
|
131 |
+
<payment_collection>Magestore_AffiliateplusTrash_Model_Mysql4_Payment_Collection</payment_collection>
|
132 |
+
</rewrite>
|
133 |
+
</affiliateplus_mysql4>
|
134 |
+
<affiliateplusstatistic_mysql4>
|
135 |
+
<rewrite>
|
136 |
+
<sales_collection>Magestore_AffiliateplusTrash_Model_Mysql4_Sales_Collection</sales_collection>
|
137 |
+
</rewrite>
|
138 |
+
</affiliateplusstatistic_mysql4>
|
139 |
+
</models>
|
140 |
+
<resources>
|
141 |
+
<affiliateplustrash_setup>
|
142 |
+
<setup>
|
143 |
+
<module>Magestore_AffiliateplusTrash</module>
|
144 |
+
</setup>
|
145 |
+
<connection>
|
146 |
+
<use>core_setup</use>
|
147 |
+
</connection>
|
148 |
+
</affiliateplustrash_setup>
|
149 |
+
<affiliateplustrash_write>
|
150 |
+
<connection>
|
151 |
+
<use>core_write</use>
|
152 |
+
</connection>
|
153 |
+
</affiliateplustrash_write>
|
154 |
+
<affiliateplustrash_read>
|
155 |
+
<connection>
|
156 |
+
<use>core_read</use>
|
157 |
+
</connection>
|
158 |
+
</affiliateplustrash_read>
|
159 |
+
</resources>
|
160 |
+
<blocks>
|
161 |
+
<affiliateplustrash>
|
162 |
+
<class>Magestore_AffiliateplusTrash_Block</class>
|
163 |
+
</affiliateplustrash>
|
164 |
+
</blocks>
|
165 |
+
<helpers>
|
166 |
+
<affiliateplustrash>
|
167 |
+
<class>Magestore_AffiliateplusTrash_Helper</class>
|
168 |
+
</affiliateplustrash>
|
169 |
+
</helpers>
|
170 |
+
</global>
|
171 |
+
</config>
|
app/code/local/Magestore/AffiliateplusTrash/etc/system.xml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magestore
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Magestore.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.magestore.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Magestore
|
18 |
+
* @package Magestore_AffiliateplusTrash
|
19 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
20 |
+
* @license http://www.magestore.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
</config>
|
app/code/local/Magestore/AffiliateplusTrash/sql/affiliateplustrash_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magestore
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Magestore.com license that is
|
8 |
+
* available through the world-wide-web at this URL:
|
9 |
+
* http://www.magestore.com/license-agreement.html
|
10 |
+
*
|
11 |
+
* DISCLAIMER
|
12 |
+
*
|
13 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
14 |
+
* version in the future.
|
15 |
+
*
|
16 |
+
* @category Magestore
|
17 |
+
* @package Magestore_AffiliateplusTrash
|
18 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
19 |
+
* @license http://www.magestore.com/license-agreement.html
|
20 |
+
*/
|
21 |
+
|
22 |
+
/** @var $installer Mage_Core_Model_Resource_Setup */
|
23 |
+
$installer = $this;
|
24 |
+
|
25 |
+
$installer->startSetup();
|
26 |
+
|
27 |
+
// Add field is deleted for transaction
|
28 |
+
$installer->getConnection()->addColumn($this->getTable('affiliateplus_transaction'), 'transaction_is_deleted', "tinyint(1) NOT NULL default '0'");
|
29 |
+
|
30 |
+
// Add field is deleted for withdrawal
|
31 |
+
$installer->getConnection()->addColumn($this->getTable('affiliateplus_payment'), 'payment_is_deleted', "tinyint(1) NOT NULL default '0'");
|
32 |
+
|
33 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/affiliateplustrash.xml
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magestore
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Magestore.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.magestore.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Magestore
|
18 |
+
* @package Magestore_AffiliateplusTrash
|
19 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
20 |
+
* @license http://www.magestore.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
-->
|
23 |
+
<layout version="0.1.0">
|
24 |
+
<affiliateplustrashadmin_adminhtml_transaction_deleted>
|
25 |
+
<reference name="content">
|
26 |
+
<block type="affiliateplustrash/adminhtml_transaction_deleted" name="transaction" />
|
27 |
+
</reference>
|
28 |
+
</affiliateplustrashadmin_adminhtml_transaction_deleted>
|
29 |
+
<affiliateplustrashadmin_adminhtml_transaction_deletedgrid>
|
30 |
+
<block type="core/text_list" name="root" output="toHtml">
|
31 |
+
<block type="affiliateplustrash/adminhtml_transaction_deleted_grid" name="transaction" />
|
32 |
+
</block>
|
33 |
+
</affiliateplustrashadmin_adminhtml_transaction_deletedgrid>
|
34 |
+
|
35 |
+
<affiliateplustrashadmin_adminhtml_payment_deleted>
|
36 |
+
<reference name="content">
|
37 |
+
<block type="affiliateplustrash/adminhtml_payment_deleted" name="payment" />
|
38 |
+
</reference>
|
39 |
+
</affiliateplustrashadmin_adminhtml_payment_deleted>
|
40 |
+
<affiliateplustrashadmin_adminhtml_payment_deletedgrid>
|
41 |
+
<block type="core/text_list" name="root" output="toHtml">
|
42 |
+
<block type="affiliateplustrash/adminhtml_payment_deleted_grid" name="payment" />
|
43 |
+
</block>
|
44 |
+
</affiliateplustrashadmin_adminhtml_payment_deletedgrid>
|
45 |
+
</layout>
|
app/etc/modules/Magestore_AffiliateplusTrash.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magestore
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Magestore.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.magestore.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Magestore
|
18 |
+
* @package Magestore_AffiliateplusTrash
|
19 |
+
* @copyright Copyright (c) 2012 Magestore (http://www.magestore.com/)
|
20 |
+
* @license http://www.magestore.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
<modules>
|
25 |
+
<Magestore_AffiliateplusTrash>
|
26 |
+
<active>true</active>
|
27 |
+
<codePool>local</codePool>
|
28 |
+
<aliasName>Affiliate Plus Trash</aliasName>
|
29 |
+
<depends>
|
30 |
+
<Magestore_Affiliateplus />
|
31 |
+
</depends>
|
32 |
+
</Magestore_AffiliateplusTrash>
|
33 |
+
</modules>
|
34 |
+
</config>
|
app/locale/en_US/Magestore_AffiliateplusTrash.csv
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Account not enough balance to delete","Account not enough balance to delete"
|
2 |
+
"Action","Action"
|
3 |
+
"Affiliate Account","Affiliate Account"
|
4 |
+
"Affiliate Email","Affiliate Email"
|
5 |
+
"Affiliateplus","Affiliateplus"
|
6 |
+
"Amount","Amount"
|
7 |
+
"Are you sure?","Are you sure?"
|
8 |
+
"Balance","Balance"
|
9 |
+
"CSV","CSV"
|
10 |
+
"Canceled","Canceled"
|
11 |
+
"Commission","Commission"
|
12 |
+
"Completed","Completed"
|
13 |
+
"Customer Email","Customer Email"
|
14 |
+
"Delete Withdrawal","Delete Withdrawal"
|
15 |
+
"Deleted Transaction Manager","Deleted Transaction Manager"
|
16 |
+
"Deleted Withdrawal Manager","Deleted Withdrawal Manager"
|
17 |
+
"Disabled","Disabled"
|
18 |
+
"Discount","Discount"
|
19 |
+
"Enabled","Enabled"
|
20 |
+
"Fee","Fee"
|
21 |
+
"ID","ID"
|
22 |
+
"Including %s tax","Including %s tax"
|
23 |
+
"Including fee","Including fee"
|
24 |
+
"Item does not exist","Item does not exist"
|
25 |
+
"Manage Deleted Transactions","Manage Deleted Transactions"
|
26 |
+
"Manage Deleted Withdrawals","Manage Deleted Withdrawals"
|
27 |
+
"Manage Withdrawals","Manage Withdrawals"
|
28 |
+
"Move to Trash","Move to Trash"
|
29 |
+
"No transaction is moved to trash","No transaction is moved to trash"
|
30 |
+
"No transaction is restored","No transaction is restored"
|
31 |
+
"No withdrawal is moved to trash","No withdrawal is moved to trash"
|
32 |
+
"No withdrawal is restored","No withdrawal is restored"
|
33 |
+
"Not including fee","Not including fee"
|
34 |
+
"Order","Order"
|
35 |
+
"Pay for Order","Pay for Order"
|
36 |
+
"Payment Manager","Payment Manager"
|
37 |
+
"Payment Method","Payment Method"
|
38 |
+
"Payment Method Information","Payment Method Information"
|
39 |
+
"Payment News","Payment News"
|
40 |
+
"Payments Manager","Payments Manager"
|
41 |
+
"Paypal Email","Paypal Email"
|
42 |
+
"Pending","Pending"
|
43 |
+
"Processing","Processing"
|
44 |
+
"Product Name","Product Name"
|
45 |
+
"Refunded","Refunded"
|
46 |
+
"Requested time","Requested time"
|
47 |
+
"Restore","Restore"
|
48 |
+
"Restore Withdrawal","Restore Withdrawal"
|
49 |
+
"Restore deleted transaction. Are you sure?","Restore deleted transaction. Are you sure?"
|
50 |
+
"Status","Status"
|
51 |
+
"Status History","Status History"
|
52 |
+
"Store view","Store view"
|
53 |
+
"Tax","Tax"
|
54 |
+
"Time","Time"
|
55 |
+
"Total %s of %s transactions were moved to trash successfully","Total %s of %s transactions were moved to trash successfully"
|
56 |
+
"Total %s of %s transactions were restored successfully","Total %s of %s transactions were restored successfully"
|
57 |
+
"Total %s of %s withdrawals were moved to trash successfully","Total %s of %s withdrawals were moved to trash successfully"
|
58 |
+
"Total %s of %s withdrawals were restored successfully","Total %s of %s withdrawals were restored successfully"
|
59 |
+
"Total Amount","Total Amount"
|
60 |
+
"Transaction ID","Transaction ID"
|
61 |
+
"Transaction Manager","Transaction Manager"
|
62 |
+
"Transaction was moved to trash successfully","Transaction was moved to trash successfully"
|
63 |
+
"Transaction was restored successfully","Transaction was restored successfully"
|
64 |
+
"Transactions","Transactions"
|
65 |
+
"Transactions Manager","Transactions Manager"
|
66 |
+
"Trash","Trash"
|
67 |
+
"View","View"
|
68 |
+
"View Affiliate Account Detail","View Affiliate Account Detail"
|
69 |
+
"View Order","View Order"
|
70 |
+
"View Withdrawal for ","View Withdrawal for "
|
71 |
+
"Waiting","Waiting"
|
72 |
+
"Withdrawal Information","Withdrawal Information"
|
73 |
+
"Withdrawal Method","Withdrawal Method"
|
74 |
+
"Withdrawal News","Withdrawal News"
|
75 |
+
"Withdrawal information","Withdrawal information"
|
76 |
+
"Withdrawal was moved to trash successfully","Withdrawal was moved to trash successfully"
|
77 |
+
"Withdrawal was restored successfully","Withdrawal was restored successfully"
|
78 |
+
"Withdrawals","Withdrawals"
|
79 |
+
"Withdrawals Manager","Withdrawals Manager"
|
80 |
+
"XML","XML"
|
81 |
+
"You can change this email on the acount edit page","You can change this email on the acount edit page"
|
package.xml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Affiliateplus_Trash</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Allow moving to trash / restoring affiliate transaction, withdrawal quickly.</summary>
|
10 |
+
<description><p>When your business grows, more and more transactions and withdrawals of your affiliates will build up over time. To manage all of them simultaneously is obviously not an easy task and you may want to remove unnecessary ones. But how to take transactions and withdrawals back some other times when you need them for review or when they are removed just by mistakes? With <strong>Affiliate Trash plugin</strong>, all of those procedures will be conducted smoothly. Only manipulated in backend, it creates great convenience for you with the capabilities to delete or restore both transactions and withdrawals when necessary.</p>
|
11 |
+

|
12 |
+
<h3>Outstanding Features for Admin</h3>
|
13 |
+
<ul>
|
14 |
+
<li>Delete/ restore transactions in both Transaction Manager page and View Transaction page</li>
|
15 |
+
<li>View transactions before and after deletion</li>
|
16 |
+
</ul>
|
17 |
+

|
18 |
+
<h3>Others</h3>
|
19 |
+
<ul>
|
20 |
+
<li>Support multiple stores &amp; languages</li>
|
21 |
+
<li>Open source 100%</li>
|
22 |
+
<li>Easy to install and configure.</li>
|
23 |
+
<li>User-friendly interface.</li></ul>
|
24 |
+

|
25 |
+
<h3>Affiliate Trash Live Demo</h3>
|
26 |
+
<a href="http://demo-extension.magestore.com/sandbox/affiliateplus/trash/index.php/admin"><strong>SANDBOX BACKEND</strong></a> 
|
27 |
+
<br></br>
|
28 |
+
<a href="http://www.magestore.com/affiliateplus/affiliate-trash.html"><h3>Visit Affiliate Trash Product Page</h3></a>
|
29 |
+
</description>
|
30 |
+
<notes>Allow moving to trash / restoring affiliate transaction, withdrawal quickly.</notes>
|
31 |
+
<authors><author><name>Magestore</name><user>Magestore</user><email>info@magestore.com</email></author></authors>
|
32 |
+
<date>2014-11-28</date>
|
33 |
+
<time>08:36:29</time>
|
34 |
+
<contents><target name="magelocal"><dir name="Magestore"><dir name="AffiliateplusTrash"><dir name="Block"><dir name="Adminhtml"><dir name="Payment"><dir name="Deleted"><file name="Grid.php" hash="ea17d6b65246acf4e32700a8ec4e8b17"/></dir><file name="Deleted.php" hash="37ee5cb7c07a21eec163694cd75fb829"/><dir name="Edit"><file name="Form.php" hash="3edb07f93019900078c37026ff383142"/><dir name="Tab"><file name="Form.php" hash="a4a0111fe5f6794788785db64f255c08"/><file name="History.php" hash="a3fc8551effd884e534ec512715b65ff"/><file name="vssver2.scc" hash="eb07a20775ecd25fcecaa27bb0229641"/></dir><file name="Tabs.php" hash="c4f9f54be52c1a9ed62671193f4be9c3"/><file name="vssver2.scc" hash="21c81fc2399298b4c49a97e434275798"/></dir><file name="Edit.php" hash="16e8d5b9e6abf8ca82d8f639e0d5fafa"/></dir><dir name="Transaction"><dir name="Deleted"><file name="Grid.php" hash="69b57ef802e32f1052e429d1d4f5bfbd"/></dir><file name="Deleted.php" hash="9f382fec62bc7778c4f500b649903a45"/></dir></dir><file name="Affiliateplustrash.php" hash="3ddaf2d2e68578bfca60c64a4b1bce67"/></dir><dir name="Helper"><file name="Data.php" hash="d7ba961dbad1372f52bc71d48175d5a1"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Payment"><file name="Collection.php" hash="4b030ec5cbb2e14ad862967264b8415e"/></dir><dir name="Sales"><file name="Collection.php" hash="dbec3921a31668d7189b33517e1ef91f"/></dir><dir name="Transaction"><file name="Collection.php" hash="556c3603c64f1d8c3dfd1bbf7727a613"/></dir></dir><file name="Observer.php" hash="2ac40c4d57ebc2387395281720bb9acc"/><file name="Payment.php" hash="448799fb8112e96d55ca1e9eefef485b"/><file name="Status.php" hash="192b475fb2613662dfbc58cee17ca4bc"/><file name="Transaction.php" hash="707ef1b7d9370c62b459fe8d15157ecf"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PaymentController.php" hash="66cd51a12dbe9a5c1039da355ffa6f2d"/><file name="TransactionController.php" hash="1dc2982f07dac5c826f7f79bbb801108"/></dir><file name="IndexController.php" hash="6c638b2a9d79db88c70dd2fa98e04c93"/></dir><dir name="etc"><file name="adminhtml.xml" hash="51be2f0a3e8607e0a85b31c8969d8424"/><file name="config.xml" hash="025af02d1bc7cad21b5301a6178d1530"/><file name="system.xml" hash="a6b428d5b43a4e96e8fd52177f63820a"/></dir><dir name="sql"><dir name="affiliateplustrash_setup"><file name="mysql4-install-0.1.0.php" hash="7140419702aba365007eb660b9a05862"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="affiliateplustrash.xml" hash="821fb21f0358d84902c1f7ffa86ab905"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magestore_AffiliateplusTrash.xml" hash="08630ecac7a0b5300d15c01fbe266531"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Magestore_AffiliateplusTrash.csv" hash="51f026e26fb144b02e7b5197cf625e7f"/></dir></dir></target></contents>
|
35 |
+
<compatible/>
|
36 |
+
<dependencies><required><php><min>0.5.1</min><max>6.0.0</max></php></required></dependencies>
|
37 |
+
</package>
|