Share_Refund - Version 1.0.0

Version Notes

Initial

Download this release

Release Info

Developer Share a Refund
Extension Share_Refund
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Share/Refund/Block/Adminhtml/App.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard admin block
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Block_Adminhtml_App extends Mage_Adminhtml_Block_Widget_Grid_Container
25
+ {
26
+ /**
27
+ * constructor
28
+ *
29
+ * @access public
30
+ * @return void
31
+ * @author Ultimate Module Creator
32
+ */
33
+ public function __construct()
34
+ {
35
+ $this->_controller = 'adminhtml_app';
36
+ $this->_blockGroup = 'share_refund';
37
+ parent::__construct();
38
+ $this->_headerText = Mage::helper('share_refund')->__('Dashboard');
39
+ $this->_updateButton('add', 'label', Mage::helper('share_refund')->__('Add Dashboard'));
40
+
41
+ }
42
+ }
app/code/community/Share/Refund/Block/Adminhtml/App/Edit.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard admin edit form
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Block_Adminhtml_App_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
25
+ {
26
+ /**
27
+ * constructor
28
+ *
29
+ * @access public
30
+ * @return void
31
+ * @author Ultimate Module Creator
32
+ */
33
+ public function __construct()
34
+ {
35
+ parent::__construct();
36
+ $this->_blockGroup = 'share_refund';
37
+ $this->_controller = 'adminhtml_app';
38
+ $this->_updateButton(
39
+ 'save',
40
+ 'label',
41
+ Mage::helper('share_refund')->__('Save Dashboard')
42
+ );
43
+ $this->_updateButton(
44
+ 'delete',
45
+ 'label',
46
+ Mage::helper('share_refund')->__('Delete Dashboard')
47
+ );
48
+ $this->_addButton(
49
+ 'saveandcontinue',
50
+ array(
51
+ 'label' => Mage::helper('share_refund')->__('Save And Continue Edit'),
52
+ 'onclick' => 'saveAndContinueEdit()',
53
+ 'class' => 'save',
54
+ ),
55
+ -100
56
+ );
57
+ $this->_formScripts[] = "
58
+ function saveAndContinueEdit() {
59
+ editForm.submit($('edit_form').action+'back/edit/');
60
+ }
61
+ ";
62
+ }
63
+
64
+ /**
65
+ * get the edit form header
66
+ *
67
+ * @access public
68
+ * @return string
69
+ * @author Ultimate Module Creator
70
+ */
71
+ public function getHeaderText()
72
+ {
73
+ if (Mage::registry('current_app') && Mage::registry('current_app')->getId()) {
74
+ return Mage::helper('share_refund')->__(
75
+ "Edit Dashboard '%s'",
76
+ $this->escapeHtml(Mage::registry('current_app')->getName())
77
+ );
78
+ } else {
79
+ return Mage::helper('share_refund')->__('Add Dashboard');
80
+ }
81
+ }
82
+ }
app/code/community/Share/Refund/Block/Adminhtml/App/Edit/Form.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard edit form
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Block_Adminhtml_App_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
25
+ {
26
+ /**
27
+ * prepare form
28
+ *
29
+ * @access protected
30
+ * @return Share_Refund_Block_Adminhtml_App_Edit_Form
31
+ * @author Ultimate Module Creator
32
+ */
33
+ protected function _prepareForm()
34
+ {
35
+ $form = new Varien_Data_Form(
36
+ array(
37
+ 'id' => 'edit_form',
38
+ 'action' => $this->getUrl(
39
+ '*/*/save',
40
+ array(
41
+ 'id' => $this->getRequest()->getParam('id')
42
+ )
43
+ ),
44
+ 'method' => 'post',
45
+ 'enctype' => 'multipart/form-data'
46
+ )
47
+ );
48
+ $form->setUseContainer(true);
49
+ $this->setForm($form);
50
+ return parent::_prepareForm();
51
+ }
52
+ }
app/code/community/Share/Refund/Block/Adminhtml/App/Edit/Tab/Form.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard edit form tab
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Block_Adminhtml_App_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
25
+ {
26
+ /**
27
+ * prepare the form
28
+ *
29
+ * @access protected
30
+ * @return Share_Refund_Block_Adminhtml_App_Edit_Tab_Form
31
+ * @author Ultimate Module Creator
32
+ */
33
+ protected function _prepareForm()
34
+ {
35
+ $form = new Varien_Data_Form();
36
+ $form->setHtmlIdPrefix('app_');
37
+ $form->setFieldNameSuffix('app');
38
+ $this->setForm($form);
39
+ $fieldset = $form->addFieldset(
40
+ 'app_form',
41
+ array('legend' => Mage::helper('share_refund')->__('Dashboard'))
42
+ );
43
+
44
+ $fieldset->addField(
45
+ 'name',
46
+ 'text',
47
+ array(
48
+ 'label' => Mage::helper('share_refund')->__('Name'),
49
+ 'name' => 'name',
50
+ 'required' => true,
51
+ 'class' => 'required-entry',
52
+
53
+ )
54
+ );
55
+ $fieldset->addField(
56
+ 'status',
57
+ 'select',
58
+ array(
59
+ 'label' => Mage::helper('share_refund')->__('Status'),
60
+ 'name' => 'status',
61
+ 'values' => array(
62
+ array(
63
+ 'value' => 1,
64
+ 'label' => Mage::helper('share_refund')->__('Enabled'),
65
+ ),
66
+ array(
67
+ 'value' => 0,
68
+ 'label' => Mage::helper('share_refund')->__('Disabled'),
69
+ ),
70
+ ),
71
+ )
72
+ );
73
+ $formValues = Mage::registry('current_app')->getDefaultValues();
74
+ if (!is_array($formValues)) {
75
+ $formValues = array();
76
+ }
77
+ if (Mage::getSingleton('adminhtml/session')->getAppData()) {
78
+ $formValues = array_merge($formValues, Mage::getSingleton('adminhtml/session')->getAppData());
79
+ Mage::getSingleton('adminhtml/session')->setAppData(null);
80
+ } elseif (Mage::registry('current_app')) {
81
+ $formValues = array_merge($formValues, Mage::registry('current_app')->getData());
82
+ }
83
+ $form->setValues($formValues);
84
+ return parent::_prepareForm();
85
+ }
86
+ }
app/code/community/Share/Refund/Block/Adminhtml/App/Edit/Tabs.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard admin edit tabs
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Block_Adminhtml_App_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
25
+ {
26
+ /**
27
+ * Initialize Tabs
28
+ *
29
+ * @access public
30
+ * @author Ultimate Module Creator
31
+ */
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('app_tabs');
36
+ $this->setDestElementId('edit_form');
37
+ $this->setTitle(Mage::helper('share_refund')->__('Dashboard'));
38
+ }
39
+
40
+ /**
41
+ * before render html
42
+ *
43
+ * @access protected
44
+ * @return Share_Refund_Block_Adminhtml_App_Edit_Tabs
45
+ * @author Ultimate Module Creator
46
+ */
47
+ protected function _beforeToHtml()
48
+ {
49
+ $this->addTab(
50
+ 'form_app',
51
+ array(
52
+ 'label' => Mage::helper('share_refund')->__('Dashboard'),
53
+ 'title' => Mage::helper('share_refund')->__('Dashboard'),
54
+ 'content' => $this->getLayout()->createBlock(
55
+ 'share_refund/adminhtml_app_edit_tab_form'
56
+ )
57
+ ->toHtml(),
58
+ )
59
+ );
60
+ return parent::_beforeToHtml();
61
+ }
62
+
63
+ /**
64
+ * Retrieve dashboard entity
65
+ *
66
+ * @access public
67
+ * @return Share_Refund_Model_App
68
+ * @author Ultimate Module Creator
69
+ */
70
+ public function getApp()
71
+ {
72
+ return Mage::registry('current_app');
73
+ }
74
+ }
app/code/community/Share/Refund/Block/Adminhtml/App/Grid.php ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard admin grid block
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Block_Adminhtml_App_Grid extends Mage_Adminhtml_Block_Widget_Grid
25
+ {
26
+ /**
27
+ * constructor
28
+ *
29
+ * @access public
30
+ * @author Ultimate Module Creator
31
+ */
32
+ public function __construct()
33
+ {
34
+ parent::__construct();
35
+ $this->setId('appGrid');
36
+ $this->setDefaultSort('entity_id');
37
+ $this->setDefaultDir('ASC');
38
+ $this->setSaveParametersInSession(true);
39
+ $this->setUseAjax(true);
40
+ }
41
+
42
+ /**
43
+ * prepare collection
44
+ *
45
+ * @access protected
46
+ * @return Share_Refund_Block_Adminhtml_App_Grid
47
+ * @author Ultimate Module Creator
48
+ */
49
+ protected function _prepareCollection()
50
+ {
51
+ $collection = Mage::getModel('share_refund/app')
52
+ ->getCollection();
53
+
54
+ $this->setCollection($collection);
55
+ return parent::_prepareCollection();
56
+ }
57
+
58
+ /**
59
+ * prepare grid collection
60
+ *
61
+ * @access protected
62
+ * @return Share_Refund_Block_Adminhtml_App_Grid
63
+ * @author Ultimate Module Creator
64
+ */
65
+ protected function _prepareColumns()
66
+ {
67
+ $this->addColumn(
68
+ 'entity_id',
69
+ array(
70
+ 'header' => Mage::helper('share_refund')->__('Id'),
71
+ 'index' => 'entity_id',
72
+ 'type' => 'number'
73
+ )
74
+ );
75
+ $this->addColumn(
76
+ 'name',
77
+ array(
78
+ 'header' => Mage::helper('share_refund')->__('Name'),
79
+ 'align' => 'left',
80
+ 'index' => 'name',
81
+ )
82
+ );
83
+
84
+ $this->addColumn(
85
+ 'status',
86
+ array(
87
+ 'header' => Mage::helper('share_refund')->__('Status'),
88
+ 'index' => 'status',
89
+ 'type' => 'options',
90
+ 'options' => array(
91
+ '1' => Mage::helper('share_refund')->__('Enabled'),
92
+ '0' => Mage::helper('share_refund')->__('Disabled'),
93
+ )
94
+ )
95
+ );
96
+ $this->addColumn(
97
+ 'action',
98
+ array(
99
+ 'header' => Mage::helper('share_refund')->__('Action'),
100
+ 'width' => '100',
101
+ 'type' => 'action',
102
+ 'getter' => 'getId',
103
+ 'actions' => array(
104
+ array(
105
+ 'caption' => Mage::helper('share_refund')->__('Edit'),
106
+ 'url' => array('base'=> '*/*/edit'),
107
+ 'field' => 'id'
108
+ )
109
+ ),
110
+ 'filter' => false,
111
+ 'is_system' => true,
112
+ 'sortable' => false,
113
+ )
114
+ );
115
+ $this->addExportType('*/*/exportCsv', Mage::helper('share_refund')->__('CSV'));
116
+ $this->addExportType('*/*/exportExcel', Mage::helper('share_refund')->__('Excel'));
117
+ $this->addExportType('*/*/exportXml', Mage::helper('share_refund')->__('XML'));
118
+ return parent::_prepareColumns();
119
+ }
120
+
121
+ /**
122
+ * prepare mass action
123
+ *
124
+ * @access protected
125
+ * @return Share_Refund_Block_Adminhtml_App_Grid
126
+ * @author Ultimate Module Creator
127
+ */
128
+ protected function _prepareMassaction()
129
+ {
130
+ $this->setMassactionIdField('entity_id');
131
+ $this->getMassactionBlock()->setFormFieldName('app');
132
+ $this->getMassactionBlock()->addItem(
133
+ 'delete',
134
+ array(
135
+ 'label'=> Mage::helper('share_refund')->__('Delete'),
136
+ 'url' => $this->getUrl('*/*/massDelete'),
137
+ 'confirm' => Mage::helper('share_refund')->__('Are you sure?')
138
+ )
139
+ );
140
+ $this->getMassactionBlock()->addItem(
141
+ 'status',
142
+ array(
143
+ 'label' => Mage::helper('share_refund')->__('Change status'),
144
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
145
+ 'additional' => array(
146
+ 'status' => array(
147
+ 'name' => 'status',
148
+ 'type' => 'select',
149
+ 'class' => 'required-entry',
150
+ 'label' => Mage::helper('share_refund')->__('Status'),
151
+ 'values' => array(
152
+ '1' => Mage::helper('share_refund')->__('Enabled'),
153
+ '0' => Mage::helper('share_refund')->__('Disabled'),
154
+ )
155
+ )
156
+ )
157
+ )
158
+ );
159
+ return $this;
160
+ }
161
+
162
+ /**
163
+ * get the row url
164
+ *
165
+ * @access public
166
+ * @param Share_Refund_Model_App
167
+ * @return string
168
+ * @author Ultimate Module Creator
169
+ */
170
+ public function getRowUrl($row)
171
+ {
172
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
173
+ }
174
+
175
+ /**
176
+ * get the grid url
177
+ *
178
+ * @access public
179
+ * @return string
180
+ * @author Ultimate Module Creator
181
+ */
182
+ public function getGridUrl()
183
+ {
184
+ return $this->getUrl('*/*/grid', array('_current'=>true));
185
+ }
186
+
187
+ /**
188
+ * after collection load
189
+ *
190
+ * @access protected
191
+ * @return Share_Refund_Block_Adminhtml_App_Grid
192
+ * @author Ultimate Module Creator
193
+ */
194
+ protected function _afterLoadCollection()
195
+ {
196
+ $this->getCollection()->walk('afterLoad');
197
+ parent::_afterLoadCollection();
198
+ }
199
+ }
app/code/community/Share/Refund/Controller/Adminhtml/Refund.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * module base admin controller
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Controller_Adminhtml_Refund extends Mage_Adminhtml_Controller_Action
25
+ {
26
+ /**
27
+ * upload file and get the uploaded name
28
+ *
29
+ * @access public
30
+ * @param string $input
31
+ * @param string $destinationFolder
32
+ * @param array $data
33
+ * @return string
34
+ * @author Ultimate Module Creator
35
+ */
36
+ protected function _uploadAndGetName($input, $destinationFolder, $data)
37
+ {
38
+ try {
39
+ if (isset($data[$input]['delete'])) {
40
+ return '';
41
+ } else {
42
+ $uploader = new Varien_File_Uploader($input);
43
+ $uploader->setAllowRenameFiles(true);
44
+ $uploader->setFilesDispersion(true);
45
+ $uploader->setAllowCreateFolders(true);
46
+ $result = $uploader->save($destinationFolder);
47
+ return $result['file'];
48
+ }
49
+ } catch (Exception $e) {
50
+ if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY) {
51
+ throw $e;
52
+ } else {
53
+ if (isset($data[$input]['value'])) {
54
+ return $data[$input]['value'];
55
+ }
56
+ }
57
+ }
58
+ return '';
59
+ }
60
+ }
app/code/community/Share/Refund/Helper/Data.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Refund default helper
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Helper_Data extends Mage_Core_Helper_Abstract
25
+ {
26
+ /**
27
+ * convert array to options
28
+ *
29
+ * @access public
30
+ * @param $options
31
+ * @return array
32
+ * @author Ultimate Module Creator
33
+ */
34
+ public function convertOptions($options)
35
+ {
36
+ $converted = array();
37
+ foreach ($options as $option) {
38
+ if (isset($option['value']) && !is_array($option['value']) &&
39
+ isset($option['label']) && !is_array($option['label'])) {
40
+ $converted[$option['value']] = $option['label'];
41
+ }
42
+ }
43
+ return $converted;
44
+ }
45
+ }
app/code/community/Share/Refund/Model/App.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard model
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Model_App extends Mage_Core_Model_Abstract
25
+ {
26
+ /**
27
+ * Entity code.
28
+ * Can be used as part of method name for entity processing
29
+ */
30
+ const ENTITY = 'share_refund_app';
31
+ const CACHE_TAG = 'share_refund_app';
32
+
33
+ /**
34
+ * Prefix of model events names
35
+ *
36
+ * @var string
37
+ */
38
+ protected $_eventPrefix = 'share_refund_app';
39
+
40
+ /**
41
+ * Parameter name in event
42
+ *
43
+ * @var string
44
+ */
45
+ protected $_eventObject = 'app';
46
+
47
+ /**
48
+ * constructor
49
+ *
50
+ * @access public
51
+ * @return void
52
+ * @author Ultimate Module Creator
53
+ */
54
+ public function _construct()
55
+ {
56
+ parent::_construct();
57
+ $this->_init('share_refund/app');
58
+ }
59
+
60
+ /**
61
+ * before save dashboard
62
+ *
63
+ * @access protected
64
+ * @return Share_Refund_Model_App
65
+ * @author Ultimate Module Creator
66
+ */
67
+ protected function _beforeSave()
68
+ {
69
+ parent::_beforeSave();
70
+ $now = Mage::getSingleton('core/date')->gmtDate();
71
+ if ($this->isObjectNew()) {
72
+ $this->setCreatedAt($now);
73
+ }
74
+ $this->setUpdatedAt($now);
75
+ return $this;
76
+ }
77
+
78
+ /**
79
+ * save dashboard relation
80
+ *
81
+ * @access public
82
+ * @return Share_Refund_Model_App
83
+ * @author Ultimate Module Creator
84
+ */
85
+ protected function _afterSave()
86
+ {
87
+ return parent::_afterSave();
88
+ }
89
+
90
+ /**
91
+ * get default values
92
+ *
93
+ * @access public
94
+ * @return array
95
+ * @author Ultimate Module Creator
96
+ */
97
+ public function getDefaultValues()
98
+ {
99
+ $values = array();
100
+ $values['status'] = 1;
101
+ return $values;
102
+ }
103
+
104
+ }
app/code/community/Share/Refund/Model/Resource/App.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard resource model
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Model_Resource_App extends Mage_Core_Model_Resource_Db_Abstract
25
+ {
26
+
27
+ /**
28
+ * constructor
29
+ *
30
+ * @access public
31
+ * @author Ultimate Module Creator
32
+ */
33
+ public function _construct()
34
+ {
35
+ $this->_init('share_refund/app', 'entity_id');
36
+ }
37
+ }
app/code/community/Share/Refund/Model/Resource/App/Collection.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard collection resource model
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Model_Resource_App_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
25
+ {
26
+ protected $_joinedFields = array();
27
+
28
+ /**
29
+ * constructor
30
+ *
31
+ * @access public
32
+ * @return void
33
+ * @author Ultimate Module Creator
34
+ */
35
+ protected function _construct()
36
+ {
37
+ parent::_construct();
38
+ $this->_init('share_refund/app');
39
+ }
40
+
41
+ /**
42
+ * get dashboard as array
43
+ *
44
+ * @access protected
45
+ * @param string $valueField
46
+ * @param string $labelField
47
+ * @param array $additional
48
+ * @return array
49
+ * @author Ultimate Module Creator
50
+ */
51
+ protected function _toOptionArray($valueField='entity_id', $labelField='name', $additional=array())
52
+ {
53
+ return parent::_toOptionArray($valueField, $labelField, $additional);
54
+ }
55
+
56
+ /**
57
+ * get options hash
58
+ *
59
+ * @access protected
60
+ * @param string $valueField
61
+ * @param string $labelField
62
+ * @return array
63
+ * @author Ultimate Module Creator
64
+ */
65
+ protected function _toOptionHash($valueField='entity_id', $labelField='name')
66
+ {
67
+ return parent::_toOptionHash($valueField, $labelField);
68
+ }
69
+
70
+ /**
71
+ * Get SQL for get record count.
72
+ * Extra GROUP BY strip added.
73
+ *
74
+ * @access public
75
+ * @return Varien_Db_Select
76
+ * @author Ultimate Module Creator
77
+ */
78
+ public function getSelectCountSql()
79
+ {
80
+ $countSelect = parent::getSelectCountSql();
81
+ $countSelect->reset(Zend_Db_Select::GROUP);
82
+ return $countSelect;
83
+ }
84
+ }
app/code/community/Share/Refund/Model/Resource/Setup.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Refund setup
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
25
+ {
26
+ }
app/code/community/Share/Refund/controllers/Adminhtml/Refund/AppController.php ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Dashboard admin controller
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Share_Refund_Adminhtml_Refund_AppController extends Share_Refund_Controller_Adminhtml_Refund
25
+ {
26
+ /**
27
+ * init the dashboard
28
+ *
29
+ * @access protected
30
+ * @return Share_Refund_Model_App
31
+ */
32
+ protected function _initApp()
33
+ {
34
+ $appId = (int) $this->getRequest()->getParam('id');
35
+ $app = Mage::getModel('share_refund/app');
36
+ if ($appId) {
37
+ $app->load($appId);
38
+ }
39
+ Mage::register('current_app', $app);
40
+ return $app;
41
+ }
42
+
43
+ /**
44
+ * default action
45
+ *
46
+ * @access public
47
+ * @return void
48
+ * @author Ultimate Module Creator
49
+ */
50
+ public function indexAction()
51
+ {
52
+ $this->loadLayout();
53
+ $this->_title(Mage::helper('share_refund')->__('Share a Refund'));
54
+ $this->renderLayout();
55
+ }
56
+
57
+ /**
58
+ * help action
59
+ *
60
+ * @access public
61
+ * @return void
62
+ * @author Ultimate Module Creator
63
+ */
64
+ public function helpAction()
65
+ {
66
+ $this->loadLayout();
67
+ $this->_title(Mage::helper('share_refund')->__('Help'));
68
+ $this->renderLayout();
69
+ }
70
+
71
+ /**
72
+ * grid action
73
+ *
74
+ * @access public
75
+ * @return void
76
+ * @author Ultimate Module Creator
77
+ */
78
+ public function gridAction()
79
+ {
80
+ $this->loadLayout()->renderLayout();
81
+ }
82
+
83
+ /**
84
+ * edit dashboard - action
85
+ *
86
+ * @access public
87
+ * @return void
88
+ * @author Ultimate Module Creator
89
+ */
90
+ public function editAction()
91
+ {
92
+ $appId = $this->getRequest()->getParam('id');
93
+ $app = $this->_initApp();
94
+ if ($appId && !$app->getId()) {
95
+ $this->_getSession()->addError(
96
+ Mage::helper('share_refund')->__('This dashboard no longer exists.')
97
+ );
98
+ $this->_redirect('*/*/');
99
+ return;
100
+ }
101
+ $data = Mage::getSingleton('adminhtml/session')->getAppData(true);
102
+ if (!empty($data)) {
103
+ $app->setData($data);
104
+ }
105
+ Mage::register('app_data', $app);
106
+ $this->loadLayout();
107
+ $this->_title(Mage::helper('share_refund')->__('Share a Refund'))
108
+ ->_title(Mage::helper('share_refund')->__('Dashboard'));
109
+ if ($app->getId()) {
110
+ $this->_title($app->getName());
111
+ } else {
112
+ $this->_title(Mage::helper('share_refund')->__('Add dashboard'));
113
+ }
114
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
115
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
116
+ }
117
+ $this->renderLayout();
118
+ }
119
+
120
+ /**
121
+ * new dashboard action
122
+ *
123
+ * @access public
124
+ * @return void
125
+ * @author Ultimate Module Creator
126
+ */
127
+ public function newAction()
128
+ {
129
+ $this->_forward('edit');
130
+ }
131
+
132
+ /**
133
+ * save dashboard - action
134
+ *
135
+ * @access public
136
+ * @return void
137
+ * @author Ultimate Module Creator
138
+ */
139
+ public function saveAction()
140
+ {
141
+ if ($data = $this->getRequest()->getPost('app')) {
142
+ try {
143
+ $app = $this->_initApp();
144
+ $app->addData($data);
145
+ $app->save();
146
+ Mage::getSingleton('adminhtml/session')->addSuccess(
147
+ Mage::helper('share_refund')->__('Dashboard was successfully saved')
148
+ );
149
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
150
+ if ($this->getRequest()->getParam('back')) {
151
+ $this->_redirect('*/*/edit', array('id' => $app->getId()));
152
+ return;
153
+ }
154
+ $this->_redirect('*/*/');
155
+ return;
156
+ } catch (Mage_Core_Exception $e) {
157
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
158
+ Mage::getSingleton('adminhtml/session')->setAppData($data);
159
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
160
+ return;
161
+ } catch (Exception $e) {
162
+ Mage::logException($e);
163
+ Mage::getSingleton('adminhtml/session')->addError(
164
+ Mage::helper('share_refund')->__('There was a problem saving the dashboard.')
165
+ );
166
+ Mage::getSingleton('adminhtml/session')->setAppData($data);
167
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
168
+ return;
169
+ }
170
+ }
171
+ Mage::getSingleton('adminhtml/session')->addError(
172
+ Mage::helper('share_refund')->__('Unable to find dashboard to save.')
173
+ );
174
+ $this->_redirect('*/*/');
175
+ }
176
+
177
+ /**
178
+ * delete dashboard - action
179
+ *
180
+ * @access public
181
+ * @return void
182
+ * @author Ultimate Module Creator
183
+ */
184
+ public function deleteAction()
185
+ {
186
+ if ( $this->getRequest()->getParam('id') > 0) {
187
+ try {
188
+ $app = Mage::getModel('share_refund/app');
189
+ $app->setId($this->getRequest()->getParam('id'))->delete();
190
+ Mage::getSingleton('adminhtml/session')->addSuccess(
191
+ Mage::helper('share_refund')->__('Dashboard was successfully deleted.')
192
+ );
193
+ $this->_redirect('*/*/');
194
+ return;
195
+ } catch (Mage_Core_Exception $e) {
196
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
197
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
198
+ } catch (Exception $e) {
199
+ Mage::getSingleton('adminhtml/session')->addError(
200
+ Mage::helper('share_refund')->__('There was an error deleting dashboard.')
201
+ );
202
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
203
+ Mage::logException($e);
204
+ return;
205
+ }
206
+ }
207
+ Mage::getSingleton('adminhtml/session')->addError(
208
+ Mage::helper('share_refund')->__('Could not find dashboard to delete.')
209
+ );
210
+ $this->_redirect('*/*/');
211
+ }
212
+
213
+ /**
214
+ * mass delete dashboard - action
215
+ *
216
+ * @access public
217
+ * @return void
218
+ * @author Ultimate Module Creator
219
+ */
220
+ public function massDeleteAction()
221
+ {
222
+ $appIds = $this->getRequest()->getParam('app');
223
+ if (!is_array($appIds)) {
224
+ Mage::getSingleton('adminhtml/session')->addError(
225
+ Mage::helper('share_refund')->__('Please select dashboard to delete.')
226
+ );
227
+ } else {
228
+ try {
229
+ foreach ($appIds as $appId) {
230
+ $app = Mage::getModel('share_refund/app');
231
+ $app->setId($appId)->delete();
232
+ }
233
+ Mage::getSingleton('adminhtml/session')->addSuccess(
234
+ Mage::helper('share_refund')->__('Total of %d dashboard were successfully deleted.', count($appIds))
235
+ );
236
+ } catch (Mage_Core_Exception $e) {
237
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
238
+ } catch (Exception $e) {
239
+ Mage::getSingleton('adminhtml/session')->addError(
240
+ Mage::helper('share_refund')->__('There was an error deleting dashboard.')
241
+ );
242
+ Mage::logException($e);
243
+ }
244
+ }
245
+ $this->_redirect('*/*/index');
246
+ }
247
+
248
+ /**
249
+ * mass status change - action
250
+ *
251
+ * @access public
252
+ * @return void
253
+ * @author Ultimate Module Creator
254
+ */
255
+ public function massStatusAction()
256
+ {
257
+ $appIds = $this->getRequest()->getParam('app');
258
+ if (!is_array($appIds)) {
259
+ Mage::getSingleton('adminhtml/session')->addError(
260
+ Mage::helper('share_refund')->__('Please select dashboard.')
261
+ );
262
+ } else {
263
+ try {
264
+ foreach ($appIds as $appId) {
265
+ $app = Mage::getSingleton('share_refund/app')->load($appId)
266
+ ->setStatus($this->getRequest()->getParam('status'))
267
+ ->setIsMassupdate(true)
268
+ ->save();
269
+ }
270
+ $this->_getSession()->addSuccess(
271
+ $this->__('Total of %d dashboard were successfully updated.', count($appIds))
272
+ );
273
+ } catch (Mage_Core_Exception $e) {
274
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
275
+ } catch (Exception $e) {
276
+ Mage::getSingleton('adminhtml/session')->addError(
277
+ Mage::helper('share_refund')->__('There was an error updating dashboard.')
278
+ );
279
+ Mage::logException($e);
280
+ }
281
+ }
282
+ $this->_redirect('*/*/index');
283
+ }
284
+
285
+ /**
286
+ * export as csv - action
287
+ *
288
+ * @access public
289
+ * @return void
290
+ * @author Ultimate Module Creator
291
+ */
292
+ public function exportCsvAction()
293
+ {
294
+ $fileName = 'app.csv';
295
+ $content = $this->getLayout()->createBlock('share_refund/adminhtml_app_grid')
296
+ ->getCsv();
297
+ $this->_prepareDownloadResponse($fileName, $content);
298
+ }
299
+
300
+ /**
301
+ * export as MsExcel - action
302
+ *
303
+ * @access public
304
+ * @return void
305
+ * @author Ultimate Module Creator
306
+ */
307
+ public function exportExcelAction()
308
+ {
309
+ $fileName = 'app.xls';
310
+ $content = $this->getLayout()->createBlock('share_refund/adminhtml_app_grid')
311
+ ->getExcelFile();
312
+ $this->_prepareDownloadResponse($fileName, $content);
313
+ }
314
+
315
+ /**
316
+ * export as xml - action
317
+ *
318
+ * @access public
319
+ * @return void
320
+ * @author Ultimate Module Creator
321
+ */
322
+ public function exportXmlAction()
323
+ {
324
+ $fileName = 'app.xml';
325
+ $content = $this->getLayout()->createBlock('share_refund/adminhtml_app_grid')
326
+ ->getXml();
327
+ $this->_prepareDownloadResponse($fileName, $content);
328
+ }
329
+
330
+ /**
331
+ * Check if admin has permissions to visit related pages
332
+ *
333
+ * @access protected
334
+ * @return boolean
335
+ * @author Ultimate Module Creator
336
+ */
337
+ protected function _isAllowed()
338
+ {
339
+ return Mage::getSingleton('admin/session')->isAllowed('share_refund/app');
340
+ }
341
+ }
app/code/community/Share/Refund/etc/adminhtml.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Share_Refund extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Share
14
+ * @package Share_Refund
15
+ * @copyright Copyright (c) 2015
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <acl>
21
+ <resources>
22
+ <admin>
23
+ <children>
24
+ <system>
25
+ <children>
26
+ <config>
27
+ <children>
28
+ <share_refund translate="title" module="share_refund">
29
+ <title>Refund</title>
30
+ </share_refund>
31
+ </children>
32
+ </config>
33
+ </children>
34
+ </system>
35
+ <share_refund translate="title" module="share_refund">
36
+ <title>Share a Refund</title>
37
+ <children>
38
+ <app translate="title" module="share_refund">
39
+ <title>Dashboard</title>
40
+ <sort_order>0</sort_order>
41
+ </app>
42
+ <help translate="title" module="share_refund">
43
+ <title>Help</title>
44
+ <sort_order>1</sort_order>
45
+ </help>
46
+ </children>
47
+ </share_refund>
48
+ </children>
49
+ </admin>
50
+ </resources>
51
+ </acl>
52
+ <menu>
53
+ <share_refund translate="title" module="share_refund">
54
+ <title>Share a Refund</title>
55
+ <sort_order>195</sort_order>
56
+ <children>
57
+ <app translate="title" module="share_refund">
58
+ <title>Dashboard</title>
59
+ <action>adminhtml/refund_app</action>
60
+ <sort_order>0</sort_order>
61
+ </app>
62
+ <help translate="title" module="share_refund">
63
+ <title>Help</title>
64
+ <action>adminhtml/refund_app/help</action>
65
+ <sort_order>1</sort_order>
66
+ </help>
67
+ </children>
68
+ </share_refund>
69
+ </menu>
70
+ </config>
app/code/community/Share/Refund/etc/config.xml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Share_Refund extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Share
14
+ * @package Share_Refund
15
+ * @copyright Copyright (c) 2015
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Share_Refund>
22
+ <version>1.0.0</version>
23
+ </Share_Refund>
24
+ </modules>
25
+ <global>
26
+ <resources>
27
+ <share_refund_setup>
28
+ <setup>
29
+ <module>Share_Refund</module>
30
+ <class>Share_Refund_Model_Resource_Setup</class>
31
+ </setup>
32
+ </share_refund_setup>
33
+ </resources>
34
+ <blocks>
35
+ <share_refund>
36
+ <class>Share_Refund_Block</class>
37
+ </share_refund>
38
+ </blocks>
39
+ <helpers>
40
+ <share_refund>
41
+ <class>Share_Refund_Helper</class>
42
+ </share_refund>
43
+ </helpers>
44
+ <models>
45
+ <share_refund>
46
+ <class>Share_Refund_Model</class>
47
+ <resourceModel>share_refund_resource</resourceModel>
48
+ </share_refund>
49
+ <share_refund_resource>
50
+ <class>Share_Refund_Model_Resource</class>
51
+ <entities>
52
+ <app>
53
+ <table>share_refund_app</table>
54
+ </app>
55
+ </entities>
56
+ </share_refund_resource>
57
+ </models>
58
+ </global>
59
+ <adminhtml>
60
+ <layout>
61
+ <updates>
62
+ <share_refund>
63
+ <file>share_refund.xml</file>
64
+ </share_refund>
65
+ </updates>
66
+ </layout>
67
+ <translate>
68
+ <modules>
69
+ <Share_Refund>
70
+ <files>
71
+ <default>Share_Refund.csv</default>
72
+ </files>
73
+ </Share_Refund>
74
+ </modules>
75
+ </translate>
76
+ </adminhtml>
77
+ <admin>
78
+ <routers>
79
+ <adminhtml>
80
+ <args>
81
+ <modules>
82
+ <Share_Refund before="Mage_Adminhtml">Share_Refund_Adminhtml</Share_Refund>
83
+ </modules>
84
+ </args>
85
+ </adminhtml>
86
+ </routers>
87
+ </admin>
88
+ </config>
app/code/community/Share/Refund/sql/share_refund_setup/install-1.0.0.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Share_Refund extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Share
13
+ * @package Share_Refund
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Refund module install script
19
+ *
20
+ * @category Share
21
+ * @package Share_Refund
22
+ * @author Ultimate Module Creator
23
+ */
24
+ $this->startSetup();
25
+ $table = $this->getConnection()
26
+ ->newTable($this->getTable('share_refund/app'))
27
+ ->addColumn(
28
+ 'entity_id',
29
+ Varien_Db_Ddl_Table::TYPE_INTEGER,
30
+ null,
31
+ array(
32
+ 'identity' => true,
33
+ 'nullable' => false,
34
+ 'primary' => true,
35
+ ),
36
+ 'Dashboard ID'
37
+ )
38
+ ->addColumn(
39
+ 'name',
40
+ Varien_Db_Ddl_Table::TYPE_TEXT, 255,
41
+ array(
42
+ 'nullable' => false,
43
+ ),
44
+ 'Name'
45
+ )
46
+ ->addColumn(
47
+ 'status',
48
+ Varien_Db_Ddl_Table::TYPE_SMALLINT, null,
49
+ array(),
50
+ 'Enabled'
51
+ )
52
+ ->addColumn(
53
+ 'updated_at',
54
+ Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
55
+ null,
56
+ array(),
57
+ 'Dashboard Modification Time'
58
+ )
59
+ ->addColumn(
60
+ 'created_at',
61
+ Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
62
+ null,
63
+ array(),
64
+ 'Dashboard Creation Time'
65
+ )
66
+ ->setComment('Dashboard Table');
67
+ $this->getConnection()->createTable($table);
68
+ $this->endSetup();
app/design/adminhtml/default/default/layout/share_refund.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Share_Refund extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Share
14
+ * @package Share_Refund
15
+ * @copyright Copyright (c) 2015
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <layout>
20
+ <adminhtml_refund_app_index>
21
+ <reference name="menu">
22
+ <action method="setActive">
23
+ <menupath>share_refund/app</menupath>
24
+ </action>
25
+ </reference>
26
+ <reference name="content">
27
+ <block type="adminhtml/template" name="sharearefund" template="sharearefund/index.phtml" />
28
+ </reference>
29
+ </adminhtml_refund_app_index>
30
+ <adminhtml_refund_app_help>
31
+ <reference name="menu">
32
+ <action method="setActive">
33
+ <menupath>share_refund/help</menupath>
34
+ </action>
35
+ </reference>
36
+ <reference name="content">
37
+ <block type="adminhtml/template" name="sharearefund" template="sharearefund/help.phtml" />
38
+ </reference>
39
+ </adminhtml_refund_app_help>
40
+
41
+ </layout>
app/design/adminhtml/default/default/template/sharearefund/help.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <iframe src="https://www.sharearefund.com/help" width="100%" style="border:0;height:3000px;" onload="" frameborder="0" >
2
+ <p>Your browser does not support iframes. <a href="https://www.sharearefund.com/help" target="_blank">Click here to continue.</a></p>
3
+ </iframe>
4
+ <style>
5
+ .middle{padding:0;}
6
+ </style>
app/design/adminhtml/default/default/template/sharearefund/index.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $user = Mage::getSingleton('admin/session');
3
+
4
+ $user_id = $user->getUser()->getUserId();
5
+ $email = $user->getUser()->getEmail();
6
+ $name = $user->getUser()->getFirstname() . ' ' . $user->getUser()->getLastname();
7
+ $base_url = Mage::getBaseUrl();
8
+
9
+ $url = 'http://app.sharearefund.com/magento/oauth?email='.$email . '&name=' . $name . '&url=' . $base_url . '&user_id=' . $user_id;
10
+ ?>
11
+
12
+ <iframe src="<?php echo $url; ?>" width="100%" style="border:0;height: 100em;" onload="" frameborder="0" >
13
+ <p>Your browser does not support iframes. <a href="http://app.sharearefund.com" target="_blank">Click here to continue.</a></p>
14
+ </iframe>
15
+ <style>
16
+ .middle{padding:0;}
17
+ </style>
app/etc/modules/Share_Refund.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Share_Refund extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/mit-license.php
12
+ *
13
+ * @category Share
14
+ * @package Share_Refund
15
+ * @copyright Copyright (c) 2015
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Share_Refund>
22
+ <active>true</active>
23
+ <codePool>community</codePool>
24
+ <depends>
25
+ <Mage_Core />
26
+ </depends>
27
+ </Share_Refund>
28
+ </modules>
29
+ </config>
package.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Share_Refund</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/mit-license.php">MIT License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Share a Refund finds the late packages, processes the refund claims and delivers the refund credits back.</summary>
10
+ <description>&lt;p&gt;Share a Refund is here for businesses of all sizes. Shipping just a few packages a week or several thousand a day, this cost cutting app will lower your shipping expenses from FedEx and UPS. The best part, there's no additional work to you or anyone on your team. Simply signup and watch us bring in the savings. Any package that is delivered 1 minute late is eligible for a full refund from FedEx and UPS. But finding the late shipments is difficult, and filing refund claims takes time and must be done quickly. Share a Refund manages all tasks required to reclaim the money you are already spending. We make it easy for you to save money on shipping!&lt;/p&gt;&#xD;
11
+ &#xD;
12
+ &lt;h3&gt;Why choose Share a Refund:&lt;/h3&gt;&#xD;
13
+ &lt;p&gt;&#x25CF; Completely Risk-free service&lt;br /&gt;&#xD;
14
+ &#x25CF; No changes to your existing operation&lt;br /&gt;&#xD;
15
+ &#x25CF; No work is required from you&lt;br /&gt;&#xD;
16
+ &#x25CF; Clear and easy reporting&lt;br /&gt;&#xD;
17
+ &#x25CF; Cancel at anytime&lt;br /&gt;&#xD;
18
+ &lt;/p&gt;&#xD;
19
+ &#xD;
20
+ &lt;h3&gt;Our Process:&lt;/h3&gt;&lt;br /&gt;&#xD;
21
+ &lt;p&gt;1. We analyze your invoices from Fedex and UPS.&lt;br /&gt;&#xD;
22
+ 2. We determine which shipments are eligible for refund.&lt;br /&gt;&#xD;
23
+ 3. We file refund claims on your behalf.&lt;br /&gt;&#xD;
24
+ 4. We track the claims delivered back to your shipping accounts.&lt;br /&gt;&#xD;
25
+ 5. We report weekly on all activities related to your shipping accounts.&lt;br /&gt;&#xD;
26
+ &lt;/p&gt;&#xD;
27
+ &#xD;
28
+ &lt;h3&gt;How we keep the lights on&lt;/h3&gt;&lt;br /&gt;&#xD;
29
+ &lt;p&gt;Share a Refund collects 50% of the savings delivered. There are no upfront fees, and no ongoing fees. We continually analyze your shipping accounts for free, and report on any refunds delivered weekly. This is a performance-based service. To put it simply, if we deliver $20 in savings in a given week, then we invoice and collect payment from a credit card on file for $10, or half of the total savings delivered. If there are no savings delivered, then you pay nothing.&lt;/p&gt;&#xD;
30
+ &#xD;
31
+ &lt;h3&gt;Multiple shipping accounts&lt;/h3&gt;&lt;br /&gt;&#xD;
32
+ &lt;p /&gt;With Share a Refund, you can manage multiple FedEx and UPS accounts. There's no limit on the number of shipping accounts that we manage or the number of shipments that are auditing. &lt;p /&gt;&#xD;
33
+ &#xD;
34
+ &lt;h3&gt;No software to install&lt;/h3&gt;&#xD;
35
+ &#xD;
36
+ &lt;p&gt;Share a Refund is a web-based solution that is hosted in the cloud, meaning that you'll never have to worry about installing software, managing upgrades or backing up your data.&lt;/p&gt;&#xD;
37
+ &#xD;
38
+ &lt;h3&gt;Non-US based customers&lt;/h3&gt;&#xD;
39
+ &#xD;
40
+ &lt;p&gt;Share a Refund was built with you in mind, this application is for you. Please note that there are limitations on the terms of service provided to you from UPS and FedEx. That said, we will let you know of any limitations in our auditing abilities based on your country of residence. &lt;/p&gt;&#xD;
41
+ &#xD;
42
+ &lt;p /&gt;Sign up for an account today and get started auditing your accounts with FedEx and UPS.&lt;p /&gt;</description>
43
+ <notes>Initial</notes>
44
+ <authors><author><name>Share a Refund</name><user>share-a-refund</user><email>it@sharearefund.com</email></author></authors>
45
+ <date>2016-01-06</date>
46
+ <time>14:54:02</time>
47
+ <contents><target name="magecommunity"><dir name="Share"><dir name="Refund"><dir name="Block"><dir name="Adminhtml"><dir name="App"><dir name="Edit"><file name="Form.php" hash="e30d36bae7b1b478d12bf52a12afbee3"/><dir name="Tab"><file name="Form.php" hash="02f914000122f63edd17655b1bf4dae9"/></dir><file name="Tabs.php" hash="e329004ae75d3f97eaccd10a8a1d5b86"/></dir><file name="Edit.php" hash="d95bd9cb0d1e1a82bdbb3e535db6c6c2"/><file name="Grid.php" hash="daba9d1de40364ff25806f2dfd8ea40c"/></dir><file name="App.php" hash="40267f9fe5bd196ca1ac05f6e68557fa"/></dir></dir><dir name="Controller"><dir name="Adminhtml"><file name="Refund.php" hash="e4639d8cded1cca3ce0391b353e8b522"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4006aeb195448ef3f84ef56c81d2694a"/></dir><dir name="Model"><file name="App.php" hash="185b77b71f8d39cb0a9849e93e13206e"/><dir name="Resource"><dir name="App"><file name="Collection.php" hash="10ffc475ff4cdff771b261390809251e"/></dir><file name="App.php" hash="6ff237c8cbe8e0863163dee0c4865216"/><file name="Setup.php" hash="46e82958fcf5a7daeb5c2e0ec1bf73fc"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Refund"><file name="AppController.php" hash="b1f7f8c42e9a61b48cdc0fec114adca5"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="aa5ca789b5b67c78cef4c88d9d3101c0"/><file name="config.xml" hash="1b4a416751aab9281f0375fdb473d852"/></dir><dir name="sql"><dir name="share_refund_setup"><file name="install-1.0.0.php" hash="28d64bce94fd7e14eb0b9dd74c89fd0e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="share_refund.xml" hash="b0aba4361c40dd2cbadf7e5755b619f9"/></dir><dir name="template"><dir name="sharearefund"><file name="help.phtml" hash="c3efdabd4cc595a9a68156d39ffdad16"/><file name="index.phtml" hash="ac7463b9f5005f4afe3cec3bdf00592d"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Share_Refund.xml" hash="8193964ccc35ca7f3441b5b125db2f9c"/></dir></target></contents>
48
+ <compatible/>
49
+ <dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
50
+ </package>