Jayje - Version 1.00.19

Version Notes

* Jayje_Rma extension
*
* @category Return Merchant Authorization Magento - wakensys
* @package Jayje_Rma
* @copyright Copyright (c) 2013
* @license http://opensource.org/licenses/mit-license.php MIT License
* @category Jayje
* @package Jayje_Rma
* @author wakensys
* @developper s.ratheepan@gmail.com

Download this release

Release Info

Developer wakensys
Extension Jayje
Version 1.00.19
Comparing to
See all releases


Code changes from version 1.00.18 to 1.00.19

Files changed (43) hide show
  1. app/code/community/jayje/Rma/Block/Adminhtml/Rma.php +14 -0
  2. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit.php +20 -3
  3. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Form.php +13 -0
  4. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tab/Comments.php +12 -1
  5. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tab/Form.php +15 -2
  6. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tab/Order.php +13 -0
  7. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tabs.php +13 -0
  8. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Grid.php +15 -0
  9. app/code/community/jayje/Rma/Block/Adminhtml/Rma/Info.php +13 -0
  10. app/code/community/jayje/Rma/Block/Adminhtml/Rstatus.php +27 -0
  11. app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit.php +45 -0
  12. app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit/Form.php +29 -0
  13. app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit/Tab/Form.php +84 -0
  14. app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit/Tabs.php +33 -0
  15. app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Grid.php +148 -0
  16. app/code/community/jayje/Rma/Block/Ajax.php +13 -0
  17. app/code/community/jayje/Rma/Block/Rma.php +27 -36
  18. app/code/community/jayje/Rma/Controller/Adminhtml/Rma.php +44 -0
  19. app/code/community/jayje/Rma/Helper/Data.php +13 -0
  20. app/code/community/jayje/Rma/Model/Mysql4/Rma.php +13 -0
  21. app/code/community/jayje/Rma/Model/Mysql4/Rma/Collection.php +13 -0
  22. app/code/community/jayje/Rma/Model/Mysql4/Rstatus.php +24 -0
  23. app/code/community/jayje/Rma/Model/Mysql4/Rstatus/Collection.php +24 -0
  24. app/code/community/jayje/Rma/Model/Rma.php +46 -1
  25. app/code/community/jayje/Rma/Model/Rstatus.php +67 -0
  26. app/code/community/jayje/Rma/Model/Status.php +13 -0
  27. app/code/community/jayje/Rma/controllers/Adminhtml/RmaController.php +69 -34
  28. app/code/community/jayje/Rma/controllers/Adminhtml/RstatusController.php +194 -0
  29. app/code/community/jayje/Rma/controllers/IndexController.php +20 -7
  30. app/code/community/jayje/Rma/etc/config.xml +22 -13
  31. app/code/community/jayje/Rma/etc/system.xml +4 -13
  32. app/code/community/jayje/Rma/sql/Rma_setup/mysql4-install-0.1.0.php +41 -3
  33. app/design/adminhtml/default/default/layout/rma.xml +25 -2
  34. app/design/adminhtml/default/default/template/rma/comments.phtml +16 -1
  35. app/design/adminhtml/default/default/template/rma/info.phtml +15 -1
  36. app/design/frontend/default/default/template/rma/oitems.phtml +0 -66
  37. app/design/frontend/default/default/template/rma/request.phtml +31 -19
  38. app/design/frontend/default/default/template/rma/ritem.php +0 -91
  39. app/design/frontend/default/default/template/rma/ritem.phtml +15 -2
  40. app/design/frontend/default/default/template/rma/rma.phtml +14 -0
  41. app/design/frontend/default/default/template/rma/view.phtml +16 -2
  42. app/etc/modules/Jayje_Rma.xml +9 -36
  43. package.xml +19 -8
app/code/community/jayje/Rma/Block/Adminhtml/Rma.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Jayje_Rma_Block_Adminhtml_Rma extends Mage_Adminhtml_Block_Widget_Grid_Container
3
  {
4
  public function __construct()
@@ -8,6 +21,7 @@ class Jayje_Rma_Block_Adminhtml_Rma extends Mage_Adminhtml_Block_Widget_Grid_Con
8
  $this->_headerText = Mage::helper('rma')->__('RMA Manager');
9
  // $this->_addButtonLabel = Mage::helper('rma')->__('Add RMA');
10
  parent::__construct();
 
11
  }
12
  public function getOrderInfo($id='')
13
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
  class Jayje_Rma_Block_Adminhtml_Rma extends Mage_Adminhtml_Block_Widget_Grid_Container
16
  {
17
  public function __construct()
21
  $this->_headerText = Mage::helper('rma')->__('RMA Manager');
22
  // $this->_addButtonLabel = Mage::helper('rma')->__('Add RMA');
23
  parent::__construct();
24
+ $this->removeButton('add');
25
  }
26
  public function getOrderInfo($id='')
27
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Block_Adminhtml_Rma_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
  {
@@ -34,10 +47,14 @@ class Jayje_Rma_Block_Adminhtml_Rma_Edit extends Mage_Adminhtml_Block_Widget_For
34
  ";
35
  }
36
 
37
- public function getHeaderText()
38
- {
39
  if( Mage::registry('rma_data') && Mage::registry('rma_data')->getId() ) {
40
- return Mage::helper('rma')->__("Edit RMA '%s'", $this->htmlEscape(Mage::registry('rma_data')->getTitle()));
 
 
 
 
 
41
  } else {
42
  return Mage::helper('rma')->__('Add RMA');
43
  }
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Block_Adminhtml_Rma_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
17
  {
47
  ";
48
  }
49
 
50
+ public function getHeaderText(){
 
51
  if( Mage::registry('rma_data') && Mage::registry('rma_data')->getId() ) {
52
+ $status = Mage::registry('rma_data')->getStatus();
53
+ $status = Mage::getModel('rma/rstatus')->getStatusById($status);
54
+ return Mage::helper('rma')->__("Edit RMA, Status -'%s' ",
55
+ $this->htmlEscape($status));
56
+
57
+
58
  } else {
59
  return Mage::helper('rma')->__('Add RMA');
60
  }
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Form.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
17
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tab/Comments.php CHANGED
@@ -1,5 +1,16 @@
1
  <?php
2
-
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Comments extends Mage_Adminhtml_Block_Widget_Grid
5
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
 
15
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Comments extends Mage_Adminhtml_Block_Widget_Grid
16
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tab/Form.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
  {
@@ -62,7 +75,7 @@ class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Form extends Mage_Adminhtml_Block_W
62
  $fieldset->addField('status', 'select', array(
63
  'label' => Mage::helper('rma')->__('Status'),
64
  'name' => 'status',
65
- 'values' => Jayje_Rma_Block_Adminhtml_Rma::getStatusCombo(),
66
  ));
67
 
68
  $fieldset->addField('reason', 'label', array(
@@ -77,7 +90,7 @@ class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Form extends Mage_Adminhtml_Block_W
77
  $fieldset->addField('return_type', 'select', array(
78
  'label' => Mage::helper('rma')->__('Return Type'),
79
  'name' => 'return_type',
80
- 'values' => Jayje_Rma_Block_Adminhtml_Rma::getRTypeCombo(),
81
  ));
82
 
83
  $fieldset->addField('comments', 'textarea', array(
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
17
  {
75
  $fieldset->addField('status', 'select', array(
76
  'label' => Mage::helper('rma')->__('Status'),
77
  'name' => 'status',
78
+ 'values' => Mage::getModel('rma/rstatus')->getAllStatusArray('rma_status'),
79
  ));
80
 
81
  $fieldset->addField('reason', 'label', array(
90
  $fieldset->addField('return_type', 'select', array(
91
  'label' => Mage::helper('rma')->__('Return Type'),
92
  'name' => 'return_type',
93
+ 'values' => Mage::getModel('rma/rstatus')->getAllStatusArray('rma_returntype'),
94
  ));
95
 
96
  $fieldset->addField('comments', 'textarea', array(
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tab/Order.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Order extends Mage_Adminhtml_Block_Widget_Grid
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tab_Order extends Mage_Adminhtml_Block_Widget_Grid
17
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Edit/Tabs.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Block_Adminhtml_Rma_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
17
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Grid.php CHANGED
@@ -5,6 +5,7 @@ class Jayje_Rma_Block_Adminhtml_Rma_Grid extends Mage_Adminhtml_Block_Widget_Gri
5
  public function __construct()
6
  {
7
  parent::__construct();
 
8
  $this->setId('rmaGrid');
9
  $this->setDefaultSort('rma_id');
10
  $this->setDefaultDir('DESC');
@@ -55,12 +56,16 @@ class Jayje_Rma_Block_Adminhtml_Rma_Grid extends Mage_Adminhtml_Block_Widget_Gri
55
  'header' => Mage::helper('rma')->__('Status'),
56
  'align' =>'left',
57
  'index' => 'status',
 
 
58
  ));
59
 
60
  $this->addColumn('return_type', array(
61
  'header' => Mage::helper('rma')->__('Return Type'),
62
  'align' =>'left',
63
  'index' => 'return_type',
 
 
64
  ));
65
 
66
 
@@ -107,10 +112,20 @@ class Jayje_Rma_Block_Adminhtml_Rma_Grid extends Mage_Adminhtml_Block_Widget_Gri
107
  ));
108
 
109
  $this->addExportType('*/*/exportCsv', Mage::helper('rma')->__('CSV'));
 
110
  $this->addExportType('*/*/exportXml', Mage::helper('rma')->__('XML'));
 
111
 
112
  return parent::_prepareColumns();
113
  }
 
 
 
 
 
 
 
 
114
 
115
  protected function _prepareMassaction()
116
  {
5
  public function __construct()
6
  {
7
  parent::__construct();
8
+
9
  $this->setId('rmaGrid');
10
  $this->setDefaultSort('rma_id');
11
  $this->setDefaultDir('DESC');
56
  'header' => Mage::helper('rma')->__('Status'),
57
  'align' =>'left',
58
  'index' => 'status',
59
+ 'type' => 'options',
60
+ 'options' => $this->getAllStatus('rma_status')
61
  ));
62
 
63
  $this->addColumn('return_type', array(
64
  'header' => Mage::helper('rma')->__('Return Type'),
65
  'align' =>'left',
66
  'index' => 'return_type',
67
+ 'type' => 'options',
68
+ 'options' => $this->getAllStatus('rma_returntype')
69
  ));
70
 
71
 
112
  ));
113
 
114
  $this->addExportType('*/*/exportCsv', Mage::helper('rma')->__('CSV'));
115
+ $this->addExportType('*/*/exportExcel', Mage::helper('rma')->__('Excel'));
116
  $this->addExportType('*/*/exportXml', Mage::helper('rma')->__('XML'));
117
+
118
 
119
  return parent::_prepareColumns();
120
  }
121
+
122
+ protected function getAllStatus($status=''){
123
+ $result = Mage::getModel('rma/rstatus')->getAllStatus($status);
124
+ foreach($result as $row){
125
+ $arr[$row['label']] = $row['label'];
126
+ }
127
+ return $arr;
128
+ }
129
 
130
  protected function _prepareMassaction()
131
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rma/Info.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Block_Adminhtml_Rma_Info extends Mage_Adminhtml_Block_Widget
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Block_Adminhtml_Rma_Info extends Mage_Adminhtml_Block_Widget
17
  {
app/code/community/jayje/Rma/Block/Adminhtml/Rstatus.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Block_Adminhtml_Rstatus extends Mage_Adminhtml_Block_Widget_Grid_Container{
16
+
17
+
18
+ public function __construct(){
19
+
20
+
21
+ $this->_controller = 'adminhtml_rstatus';
22
+ $this->_blockGroup = 'rma';
23
+ $this->_headerText = Mage::helper('rma')->__('Manage RMA Status and Return Type');
24
+ $this->_addButtonLabel = Mage::helper('rma')->__('Add New');
25
+ parent::__construct();
26
+ }
27
+ }
app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Block_Adminhtml_Rstatus_Edit extends Mage_Adminhtml_Block_Widget_Form_Container{
16
+
17
+
18
+ public function __construct(){
19
+ parent::__construct();
20
+ $this->_blockGroup = 'rma';
21
+ $this->_controller = 'adminhtml_rstatus';
22
+ $this->_updateButton('save', 'label', Mage::helper('rma')->__('Save Rstatus'));
23
+ $this->_updateButton('delete', 'label', Mage::helper('rma')->__('Delete Rstatus'));
24
+ $this->_addButton('saveandcontinue', array(
25
+ 'label' => Mage::helper('rma')->__('Save And Continue Edit'),
26
+ 'onclick' => 'saveAndContinueEdit()',
27
+ 'class' => 'save',
28
+ ), -100);
29
+ $this->_formScripts[] = "
30
+ function saveAndContinueEdit(){
31
+ editForm.submit($('edit_form').action+'back/edit/');
32
+ }
33
+ ";
34
+ }
35
+
36
+
37
+ public function getHeaderText(){
38
+ if( Mage::registry('rstatus_data') && Mage::registry('rstatus_data')->getId() ) {
39
+ return Mage::helper('rma')->__("Edit Rstatus '%s'", $this->htmlEscape(Mage::registry('rstatus_data')->getLabel()));
40
+ }
41
+ else {
42
+ return Mage::helper('rma')->__('Add Rstatus');
43
+ }
44
+ }
45
+ }
app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit/Form.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Block_Adminhtml_Rstatus_Edit_Form extends Mage_Adminhtml_Block_Widget_Form{
16
+
17
+ protected function _prepareForm(){
18
+ $form = new Varien_Data_Form(array(
19
+ 'id' => 'edit_form',
20
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
21
+ 'method' => 'post',
22
+ 'enctype' => 'multipart/form-data'
23
+ )
24
+ );
25
+ $form->setUseContainer(true);
26
+ $this->setForm($form);
27
+ return parent::_prepareForm();
28
+ }
29
+ }
app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit/Tab/Form.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Block_Adminhtml_Rstatus_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form{
16
+
17
+ protected function _prepareForm(){
18
+ $form = new Varien_Data_Form();
19
+ $form->setFieldNameSuffix('rstatus');
20
+ $this->setForm($form);
21
+ $fieldset = $form->addFieldset('rstatus_form',
22
+ array('legend'=>Mage::helper('rma')->__('RMA Status')));
23
+
24
+ $fieldset->addField('type', 'select', array(
25
+ 'label' => Mage::helper('rma')->__('Type'),
26
+ 'name' => 'type',
27
+ 'required' => true,
28
+ 'class' => 'required-entry',
29
+ 'values'=> array(
30
+ array(
31
+ 'value' => '',
32
+ 'label' => Mage::helper('rma')->__('Select Here'),
33
+ ),
34
+ array(
35
+ 'value' => 'rma_status',
36
+ 'label' => Mage::helper('rma')->__('Rma Status'),
37
+ ),
38
+ array(
39
+ 'value' => 'rma_returntype',
40
+ 'label' => Mage::helper('rma')->__('Rma Return type'),
41
+ ),
42
+ ),
43
+ ));
44
+
45
+ $fieldset->addField('label', 'text', array(
46
+ 'label' => Mage::helper('rma')->__('Label'),
47
+ 'name' => 'label',
48
+ 'note' => $this->__('Status name'),
49
+ 'required' => true,
50
+ 'class' => 'required-entry',
51
+
52
+ ));
53
+
54
+ $fieldset->addField('code', 'text', array(
55
+ 'label' => Mage::helper('rma')->__('Value'),
56
+ 'name' => 'code',
57
+ 'required' => true,
58
+ 'class' => 'required-entry',
59
+ ));
60
+
61
+ $fieldset->addField('status', 'select', array(
62
+ 'label' => Mage::helper('rma')->__('Status'),
63
+ 'name' => 'status',
64
+ 'values'=> array(
65
+ array(
66
+ 'value' => 1,
67
+ 'label' => Mage::helper('rma')->__('Enabled'),
68
+ ),
69
+ array(
70
+ 'value' => 0,
71
+ 'label' => Mage::helper('rma')->__('Disabled'),
72
+ ),
73
+ ),
74
+ ));
75
+ if (Mage::getSingleton('adminhtml/session')->getRstatusData()){
76
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getRstatusData());
77
+ Mage::getSingleton('adminhtml/session')->setRstatusData(null);
78
+ }
79
+ elseif (Mage::registry('current_rstatus')){
80
+ $form->setValues(Mage::registry('current_rstatus')->getData());
81
+ }
82
+ return parent::_prepareForm();
83
+ }
84
+ }
app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Edit/Tabs.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
+ class Jayje_Rma_Block_Adminhtml_Rstatus_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs{
17
+ public function __construct(){
18
+ parent::__construct();
19
+ $this->setId('rstatus_tabs');
20
+ $this->setDestElementId('edit_form');
21
+ $this->setTitle(Mage::helper('rma')->__('Rstatus'));
22
+ }
23
+
24
+
25
+ protected function _beforeToHtml(){
26
+ $this->addTab('form_section', array(
27
+ 'label' => Mage::helper('rma')->__('Rstatus'),
28
+ 'title' => Mage::helper('rma')->__('Rstatus'),
29
+ 'content' => $this->getLayout()->createBlock('rma/adminhtml_rstatus_edit_tab_form')->toHtml(),
30
+ ));
31
+ return parent::_beforeToHtml();
32
+ }
33
+ }
app/code/community/jayje/Rma/Block/Adminhtml/Rstatus/Grid.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Block_Adminhtml_Rstatus_Grid extends Mage_Adminhtml_Block_Widget_Grid{
16
+
17
+
18
+ public function __construct(){
19
+ parent::__construct();
20
+ $this->setId('rstatusGrid');
21
+ $this->setDefaultSort('entity_id');
22
+ $this->setDefaultDir('ASC');
23
+ $this->setSaveParametersInSession(true);
24
+ $this->setUseAjax(true);
25
+ }
26
+
27
+
28
+ protected function _prepareCollection(){
29
+ $collection = Mage::getModel('rma/rstatus')->getCollection();
30
+ $this->setCollection($collection);
31
+ return parent::_prepareCollection();
32
+ }
33
+
34
+
35
+ protected function _prepareColumns(){
36
+ $this->addColumn('entity_id', array(
37
+ 'header' => Mage::helper('rma')->__('Id'),
38
+ 'index' => 'entity_id',
39
+ 'type' => 'number'
40
+ ));
41
+
42
+ $this->addColumn('type', array(
43
+ 'header'=> Mage::helper('rma')->__('Type'),
44
+ 'index' => 'type',
45
+ 'type' => 'options',
46
+ 'options' => array(
47
+ 'rma_status' => 'Rma Status',
48
+ 'rma_returntype' => 'Rma Return Type',),
49
+
50
+ ));
51
+
52
+ $this->addColumn('code', array(
53
+ 'header'=> Mage::helper('rma')->__('Code'),
54
+ 'index' => 'code',
55
+ 'type' => 'text',
56
+
57
+ ));
58
+
59
+ $this->addColumn('label', array(
60
+ 'header'=> Mage::helper('rma')->__('Label'),
61
+ 'index' => 'label',
62
+ 'type' => 'label',
63
+
64
+ ));
65
+
66
+ $this->addColumn('status', array(
67
+ 'header' => Mage::helper('rma')->__('Status'),
68
+ 'index' => 'status',
69
+ 'type' => 'options',
70
+ 'options' => array(
71
+ '1' => Mage::helper('rma')->__('Enabled'),
72
+ '0' => Mage::helper('rma')->__('Disabled'),
73
+ )
74
+ ));
75
+ $this->addColumn('created_at', array(
76
+ 'header' => Mage::helper('rma')->__('Created at'),
77
+ 'index' => 'created_at',
78
+ 'width' => '120px',
79
+ 'type' => 'datetime',
80
+ ));
81
+
82
+ $this->addColumn('updated_at', array(
83
+ 'header' => Mage::helper('rma')->__('Updated at'),
84
+ 'index' => 'updated_at',
85
+ 'width' => '120px',
86
+ 'type' => 'datetime',
87
+ ));
88
+ $this->addColumn('action',
89
+ array(
90
+ 'header'=> Mage::helper('rma')->__('Action'),
91
+ 'width' => '100',
92
+ 'type' => 'action',
93
+ 'getter'=> 'getId',
94
+ 'actions' => array(
95
+ array(
96
+ 'caption' => Mage::helper('rma')->__('Edit'),
97
+ 'url' => array('base'=> '*/*/edit'),
98
+ 'field' => 'id'
99
+ )
100
+ ),
101
+ 'filter'=> false,
102
+ 'is_system' => true,
103
+ 'sortable' => false,
104
+ ));
105
+ $this->addExportType('*/*/exportCsv', Mage::helper('rma')->__('CSV'));
106
+ $this->addExportType('*/*/exportExcel', Mage::helper('rma')->__('Excel'));
107
+ $this->addExportType('*/*/exportXml', Mage::helper('rma')->__('XML'));
108
+ return parent::_prepareColumns();
109
+ }
110
+
111
+
112
+ protected function _prepareMassaction(){
113
+ $this->setMassactionIdField('entity_id');
114
+ $this->getMassactionBlock()->setFormFieldName('rstatus');
115
+ $this->getMassactionBlock()->addItem('delete', array(
116
+ 'label'=> Mage::helper('rma')->__('Delete'),
117
+ 'url' => $this->getUrl('*/*/massDelete'),
118
+ 'confirm' => Mage::helper('rma')->__('Are you sure?')
119
+ ));
120
+ $this->getMassactionBlock()->addItem('status', array(
121
+ 'label'=> Mage::helper('rma')->__('Change status'),
122
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
123
+ 'additional' => array(
124
+ 'status' => array(
125
+ 'name' => 'status',
126
+ 'type' => 'select',
127
+ 'class' => 'required-entry',
128
+ 'label' => Mage::helper('rma')->__('Status'),
129
+ 'values' => array(
130
+ '1' => Mage::helper('rma')->__('Enabled'),
131
+ '0' => Mage::helper('rma')->__('Disabled'),
132
+ )
133
+ )
134
+ )
135
+ ));
136
+ return $this;
137
+ }
138
+
139
+
140
+ public function getRowUrl($row){
141
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
142
+ }
143
+
144
+
145
+ public function getGridUrl(){
146
+ return $this->getUrl('*/*/grid', array('_current'=>true));
147
+ }
148
+ }
app/code/community/jayje/Rma/Block/Ajax.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Jayje_Rma_Block_Ajax extends Mage_Core_Block_Template
3
  {
4
  public function _prepareLayout()
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
  class Jayje_Rma_Block_Ajax extends Mage_Core_Block_Template
16
  {
17
  public function _prepareLayout()
app/code/community/jayje/Rma/Block/Rma.php CHANGED
@@ -1,13 +1,25 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Jayje_Rma_Block_Rma extends Mage_Core_Block_Template
3
  {
4
- public function _prepareLayout()
5
  {
6
- return parent::_prepareLayout();
7
  }
8
 
9
- public function getRma()
10
- {
11
  if (!$this->hasData('rma')) {
12
  $this->setData('rma', Mage::registry('rma'));
13
  }
@@ -15,44 +27,24 @@ class Jayje_Rma_Block_Rma extends Mage_Core_Block_Template
15
 
16
  }
17
 
18
-
19
-
20
  public function getOrder(){
21
- $db = Mage::getSingleton('core/resource')->getConnection('core_read');
22
- $customerid =Mage::helper('customer')->getCustomer()->getData('entity_id') ;
23
- $que = "SELECT entity_id, increment_id, grand_total, store_currency_code FROM `sales_flat_order` where customer_id='$customerid'
24
- ORDER BY increment_id DESC LIMIT 0,30";
25
- $result = $db->query($que);
26
  while( $resultn = $result->fetch(PDO::FETCH_ASSOC)){
27
- extract($resultn);
28
-
29
- echo '<option value="'.$entity_id.'">'.$increment_id.' - '.$store_currency_code.' '.$grand_total.'</option>';
30
- }
31
  //return $result;
32
  }
33
 
34
- function getRmaList(){
35
- $db = Mage::getSingleton('core/resource')->getConnection('core_read');
36
- $customerid =Mage::helper('customer')->getCustomer()->getData('entity_id') ;
37
- $que = "SELECT * FROM `rma` WHERE `customer_id` = '$customerid'
38
- ORDER BY rma_id DESC LIMIT 0 , 30";
39
- $result = $db->query($que);
40
-
41
  return $result;
42
  }
43
 
44
  public function getRmaDetails(){
45
-
46
-
47
- $listid = Mage::registry('list');
48
- $db = Mage::getSingleton('core/resource')->getConnection('core_read');
49
- $customerid =Mage::helper('customer')->getCustomer()->getData('entity_id') ;
50
- $que = "SELECT * FROM `rma` WHERE `customer_id` = '$customerid' AND rma_id= '$listid'
51
- ORDER BY rma_id DESC LIMIT 0 , 1";
52
- $result = $db->query($que);
53
- $resultn = $result->fetch(PDO::FETCH_ASSOC);
54
- return $resultn;
55
  }
 
56
  public function getRmaProducts(){
57
  return Mage::getSingleton('rma/rma')->getRmaProducts();
58
  }
@@ -63,11 +55,10 @@ class Jayje_Rma_Block_Rma extends Mage_Core_Block_Template
63
 
64
 
65
  public function getRType(){
66
- $satus = Mage::getStoreConfig('jayje_section/jayje_group/jayje_status',Mage::app()->getStore());
67
- $return_type = Mage::getStoreConfig('jayje_section/jayje_group/jayje_type',Mage::app()->getStore());
68
- $return_types = explode(",",$return_type);
69
  foreach($return_types as $return_type){
70
- echo '<option value="'.$return_type.'">'.$return_type.'</option>';
71
  }
72
 
73
  }
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
  class Jayje_Rma_Block_Rma extends Mage_Core_Block_Template
16
  {
17
+ public function _prepareLayout()
18
  {
19
+ return parent::_prepareLayout();
20
  }
21
 
22
+ public function getRma(){
 
23
  if (!$this->hasData('rma')) {
24
  $this->setData('rma', Mage::registry('rma'));
25
  }
27
 
28
  }
29
 
 
 
30
  public function getOrder(){
31
+ $result = Mage::getSingleton('rma/rma')->getOrder();
 
 
 
 
32
  while( $resultn = $result->fetch(PDO::FETCH_ASSOC)){
33
+ extract($resultn);
34
+ echo '<option value="'.$entity_id.'">'.$increment_id.' - '.$store_currency_code.' '.$grand_total.'</option>';
35
+ }
 
36
  //return $result;
37
  }
38
 
39
+ public function getRmaList(){
40
+ $result = Mage::getSingleton('rma/rma')->getRmaList();
 
 
 
 
 
41
  return $result;
42
  }
43
 
44
  public function getRmaDetails(){
45
+ return Mage::getSingleton('rma/rma')->getRmaInfo();
 
 
 
 
 
 
 
 
 
46
  }
47
+
48
  public function getRmaProducts(){
49
  return Mage::getSingleton('rma/rma')->getRmaProducts();
50
  }
55
 
56
 
57
  public function getRType(){
58
+
59
+ $return_types = Mage::getModel('rma/rstatus')->getAllStatusArray('rma_returntype');
 
60
  foreach($return_types as $return_type){
61
+ echo '<option value="'.$return_type['code'].'">'.$return_type['label'].'</option>';
62
  }
63
 
64
  }
app/code/community/jayje/Rma/Controller/Adminhtml/Rma.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
+ class jayje_Rma_Controller_Adminhtml_Rma extends Mage_Adminhtml_Controller_Action{
17
+
18
+ protected function _uploadAndGetName($input, $destinationFolder, $data){
19
+ try{
20
+ if (isset($data[$input]['delete'])){
21
+ return '';
22
+ }
23
+ else{
24
+ $uploader = new Varien_File_Uploader($input);
25
+ $uploader->setAllowRenameFiles(true);
26
+ $uploader->setFilesDispersion(true);
27
+ $uploader->setAllowCreateFolders(true);
28
+ $result = $uploader->save($destinationFolder);
29
+ return $result['file'];
30
+ }
31
+ }
32
+ catch (Exception $e){
33
+ if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY){
34
+ throw $e;
35
+ }
36
+ else{
37
+ if (isset($data[$input]['value'])){
38
+ return $data[$input]['value'];
39
+ }
40
+ }
41
+ }
42
+ return '';
43
+ }
44
+ }
app/code/community/jayje/Rma/Helper/Data.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Helper_Data extends Mage_Core_Helper_Abstract
17
  {
app/code/community/jayje/Rma/Model/Mysql4/Rma.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Model_Mysql4_Rma extends Mage_Core_Model_Mysql4_Abstract
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Model_Mysql4_Rma extends Mage_Core_Model_Mysql4_Abstract
17
  {
app/code/community/jayje/Rma/Model/Mysql4/Rma/Collection.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Model_Mysql4_Rma_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Model_Mysql4_Rma_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
17
  {
app/code/community/jayje/Rma/Model/Mysql4/Rstatus.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
+ class Jayje_Rma_Model_Mysql4_Rstatus extends Mage_Core_Model_Mysql4_Abstract{
17
+
18
+ public function _construct(){
19
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
20
+ $this->_init('rma/rstatus', 'entity_id');
21
+ }
22
+
23
+
24
+ }
app/code/community/jayje/Rma/Model/Mysql4/Rstatus/Collection.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
+ class Jayje_Rma_Model_Mysql4_Rstatus_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
17
+ {
18
+
19
+
20
+ public function _construct(){
21
+ parent::_construct();
22
+ $this->_init('rma/rstatus');
23
+ }
24
+ }
app/code/community/jayje/Rma/Model/Rma.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Model_Rma extends Mage_Core_Model_Abstract
4
  {
@@ -8,6 +21,7 @@ class Jayje_Rma_Model_Rma extends Mage_Core_Model_Abstract
8
  $this->_init('rma/rma');
9
  }
10
 
 
11
  public function getRmaProducts(){
12
  $listid = Mage::registry('list');
13
  $db = Mage::getSingleton('core/resource')->getConnection('core_read');
@@ -27,5 +41,36 @@ class Jayje_Rma_Model_Rma extends Mage_Core_Model_Abstract
27
  $result = $db->query($que);
28
  return $result;
29
  }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
 
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Model_Rma extends Mage_Core_Model_Abstract
17
  {
21
  $this->_init('rma/rma');
22
  }
23
 
24
+
25
  public function getRmaProducts(){
26
  $listid = Mage::registry('list');
27
  $db = Mage::getSingleton('core/resource')->getConnection('core_read');
41
  $result = $db->query($que);
42
  return $result;
43
  }
44
+
45
+ public function getRmaList(){
46
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
47
+ $customerid =Mage::helper('customer')->getCustomer()->getData('entity_id') ;
48
+ $que = "SELECT * FROM `rma` WHERE `customer_id` = '$customerid'
49
+ ORDER BY rma_id DESC LIMIT 0 , 30";
50
+ $result = $db->query($que);
51
+
52
+ return $result;
53
+ }
54
+
55
+ public function getOrder(){
56
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
57
+ $customerid =Mage::helper('customer')->getCustomer()->getData('entity_id') ;
58
+ $que = "SELECT entity_id, increment_id, grand_total, store_currency_code FROM `sales_flat_order`
59
+ WHERE customer_id='$customerid'
60
+ ORDER BY increment_id DESC LIMIT 0,30";
61
+ return $result = $db->query($que);
62
+ }
63
+
64
+ public function getRmaInfo(){
65
+ $listid = Mage::registry('list');
66
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
67
+ $customerid =Mage::helper('customer')->getCustomer()->getData('entity_id') ;
68
+ $que = "SELECT * FROM `rma` WHERE `customer_id` = '$customerid' AND rma_id= '$listid'
69
+ ORDER BY rma_id DESC LIMIT 0 , 1";
70
+ $result = $db->query($que);
71
+ $resultn = $result->fetch(PDO::FETCH_ASSOC);
72
+ return $resultn;
73
+ }
74
+
75
 
76
+ }
app/code/community/jayje/Rma/Model/Rstatus.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Model_Rstatus extends Mage_Core_Model_Abstract{
16
+ const CACHE_TAG = 'rma_rstatus';
17
+
18
+
19
+ public function getAllStatusArray($type='rma_status'){
20
+ $sql = "SELECT label, code FROM `rstatus` where type='$type' and status='1'";
21
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
22
+ $result = $db->fetchAll($sql);
23
+ foreach($result as $row){
24
+ $bestForArray = array("label" => $row['label'],"value" => $row['code']);
25
+ $arr[]=$bestForArray;
26
+ }
27
+
28
+ return $arr;
29
+ }
30
+
31
+
32
+ public function getAllStatus($type='rma_status'){
33
+ $sql = "SELECT label, code FROM `rstatus` where type='$type' and status='1'";
34
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
35
+ $result = $db->fetchAll($sql);
36
+ return $result;
37
+ }
38
+
39
+
40
+
41
+ public function getStatusById($rsid){
42
+ $sql = "SELECT label FROM `rstatus` where code='$rsid'";
43
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
44
+ $result = $db->fetchOne($sql);
45
+ return $result;
46
+ }
47
+
48
+
49
+ public function _construct(){
50
+ parent::_construct();
51
+ $this->_init('rma/rstatus');
52
+ }
53
+
54
+
55
+ protected function _beforeSave(){
56
+ parent::_beforeSave();
57
+ $now = Mage::getSingleton('core/date')->gmtDate();
58
+ if ($this->isObjectNew()){
59
+ $this->setCreatedAt($now);
60
+ }
61
+ $this->setUpdatedAt($now);
62
+ return $this;
63
+ }
64
+ protected function _afterSave() {
65
+ return parent::_afterSave();
66
+ }
67
+ }
app/code/community/jayje/Rma/Model/Status.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Model_Status extends Varien_Object
4
  {
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Model_Status extends Varien_Object
17
  {
app/code/community/jayje/Rma/controllers/Adminhtml/RmaController.php CHANGED
@@ -1,13 +1,25 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class Jayje_Rma_Adminhtml_RmaController extends Mage_Adminhtml_Controller_action
4
  {
5
 
6
  protected function _initAction() {
7
  $this->loadLayout()
8
- ->_setActiveMenu('rma/items')
9
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
-
11
  return $this;
12
  }
13
 
@@ -65,40 +77,44 @@ class Jayje_Rma_Adminhtml_RmaController extends Mage_Adminhtml_Controller_action
65
  public function saveAction() {
66
  if ($data = $this->getRequest()->getPost()) {
67
 
68
- if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
69
- try {
70
- /* Starting upload */
71
- $uploader = new Varien_File_Uploader('filename');
72
- $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
73
- $uploader->setAllowRenameFiles(false);
74
- $uploader->setFilesDispersion(false);
75
- $path = Mage::getBaseDir('media') . DS ;
76
- $uploader->save($path, $_FILES['filename']['name'] );
77
-
78
- } catch (Exception $e) {
79
-
80
- }
81
 
82
  //this way the name is saved in DB
83
- $data['filename'] = $_FILES['filename']['name'];
84
- }
85
 
86
- $models = Mage::getModel('rma/rma')->load($this->getRequest()->getParam('id'));
87
- $laststatus = $models['status'];
88
- $newstatus = $data['status'];
89
- $model = Mage::getModel('rma/rma');
90
- $model->setData($data)
91
- ->setId($this->getRequest()->getParam('id'));
92
-
93
- try {
94
- if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
95
- $model->setCreatedTime(now())
96
- ->setUpdateTime(now());
97
- } else {
98
- $model->setUpdateTime(now());
99
- }
100
-
101
- $model->save();
 
 
 
 
102
  if($model->getId() !=''){
103
  $rmaid = $model->getId();
104
  $update_time = date("Y-m-d g:i:s");
@@ -210,4 +226,23 @@ class Jayje_Rma_Adminhtml_RmaController extends Mage_Adminhtml_Controller_action
210
  }
211
  $this->_redirect('*/*/index');
212
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  }
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  class Jayje_Rma_Adminhtml_RmaController extends Mage_Adminhtml_Controller_action
17
  {
18
 
19
  protected function _initAction() {
20
  $this->loadLayout()
21
+ ->_setActiveMenu('rma/items')
22
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
 
23
  return $this;
24
  }
25
 
77
  public function saveAction() {
78
  if ($data = $this->getRequest()->getPost()) {
79
 
80
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
81
+ try {
82
+ /* Starting upload */
83
+ $uploader = new Varien_File_Uploader('filename');
84
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
85
+ $uploader->setAllowRenameFiles(false);
86
+ $uploader->setFilesDispersion(false);
87
+ $path = Mage::getBaseDir('media') . DS ;
88
+ $uploader->save($path, $_FILES['filename']['name'] );
89
+
90
+ } catch (Exception $e) {
91
+
92
+ }
93
 
94
  //this way the name is saved in DB
95
+ $data['filename'] = $_FILES['filename']['name'];
96
+ }
97
 
98
+ $models = Mage::getModel('rma/rma')->load($this->getRequest()->getParam('id'));
99
+ $laststatus = $models['status'];
100
+ $newstatus = $data['status'];
101
+ $model = Mage::getModel('rma/rma');
102
+ $model->setData($data)
103
+ ->setId($this->getRequest()->getParam('id'));
104
+
105
+ try {
106
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
107
+ $model->setCreatedTime(now())
108
+ ->setUpdateTime(now());
109
+ } else {
110
+ $model->setUpdateTime(now());
111
+ }
112
+
113
+ if($newstatus != $laststatus){
114
+ $model->setStatus($newstatus);
115
+ }
116
+
117
+ $model->save();
118
  if($model->getId() !=''){
119
  $rmaid = $model->getId();
120
  $update_time = date("Y-m-d g:i:s");
226
  }
227
  $this->_redirect('*/*/index');
228
  }
229
+
230
+ public function exportCsvAction(){
231
+ $fileName = 'rma_request.csv';
232
+ $content = $this->getLayout()->createBlock('rma/adminhtml_rma_grid')->getCsv();
233
+ $this->_prepareDownloadResponse($fileName, $content);
234
+ }
235
+
236
+ public function exportExcelAction(){
237
+ $fileName = 'rma_request.xls';
238
+ $content = $this->getLayout()->createBlock('rma/adminhtml_rma_grid')->getExcelFile();
239
+ $this->_prepareDownloadResponse($fileName, $content);
240
+ }
241
+
242
+ public function exportXmlAction(){
243
+ $fileName = 'rma_request.xml';
244
+ $content = $this->getLayout()->createBlock('rma/adminhtml_rma_grid')->getXml();
245
+ $this->_prepareDownloadResponse($fileName, $content);
246
+ }
247
+
248
  }
app/code/community/jayje/Rma/controllers/Adminhtml/RstatusController.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ class Jayje_Rma_Adminhtml_RstatusController extends Jayje_Rma_Controller_Adminhtml_Rma{
16
+
17
+
18
+ protected function _initAction() {
19
+ $this->loadLayout()
20
+ ->_setActiveMenu('rma/rstatus')
21
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Status Manager'), Mage::helper('adminhtml')->__('Item Manager'));
22
+
23
+ return $this;
24
+ }
25
+
26
+
27
+ protected function _initRstatus(){
28
+ $rstatusId = (int) $this->getRequest()->getParam('id');
29
+ $rstatus = Mage::getModel('rma/rstatus');
30
+ if ($rstatusId) {
31
+ $rstatus->load($rstatusId);
32
+ }
33
+ Mage::register('current_rstatus', $rstatus);
34
+ return $rstatus;
35
+ }
36
+
37
+ public function indexAction() {
38
+ $this->_initAction()
39
+ ->renderLayout();
40
+ }
41
+
42
+
43
+ public function gridAction() {
44
+ $this->loadLayout()->renderLayout();
45
+ }
46
+
47
+ public function editAction() {
48
+ $rstatusId = $this->getRequest()->getParam('id');
49
+ $rstatus = $this->_initRstatus();
50
+ if ($rstatusId && !$rstatus->getId()) {
51
+ $this->_getSession()->addError(Mage::helper('rma')->__('This rstatus no longer exists.'));
52
+ $this->_redirect('*/*/');
53
+ return;
54
+ }
55
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
56
+ if (!empty($data)) {
57
+ $rstatus->setData($data);
58
+ }
59
+ Mage::register('rstatus_data', $rstatus);
60
+ $this->loadLayout();
61
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
62
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
63
+ }
64
+ $this->renderLayout();
65
+ }
66
+
67
+ public function newAction() {
68
+ $this->_forward('edit');
69
+ }
70
+
71
+ public function saveAction() {
72
+ if ($data = $this->getRequest()->getPost('rstatus')) {
73
+ try {
74
+ $rstatus = $this->_initRstatus();
75
+ $rstatus->setCode('');
76
+ $rstatus->setType('');
77
+ $rstatus->addData($data);
78
+
79
+ $rstatus->save();
80
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('rma')->__('Rstatus was successfully saved'));
81
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
82
+ if ($this->getRequest()->getParam('back')) {
83
+ $this->_redirect('*/*/edit', array('id' => $rstatus->getId()));
84
+ return;
85
+ }
86
+ $this->_redirect('*/*/');
87
+ return;
88
+ }
89
+ catch (Mage_Core_Exception $e){
90
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
91
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
92
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
93
+ return;
94
+ }
95
+ catch (Exception $e) {
96
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('There was a problem saving the rstatus.'));
97
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
98
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
99
+ return;
100
+ }
101
+ }
102
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('Unable to find rstatus to save.'));
103
+ $this->_redirect('*/*/');
104
+ }
105
+
106
+ public function deleteAction() {
107
+ if( $this->getRequest()->getParam('id') > 0) {
108
+ try {
109
+ $rstatus = Mage::getModel('rma/rstatus');
110
+ $rstatus->setId($this->getRequest()->getParam('id'))->delete();
111
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('rma')->__('Rstatus was successfully deleted.'));
112
+ $this->_redirect('*/*/');
113
+ return;
114
+ }
115
+ catch (Mage_Core_Exception $e){
116
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
117
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
118
+ }
119
+ catch (Exception $e) {
120
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('There was an error deleteing rstatus.'));
121
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
122
+ return;
123
+ }
124
+ }
125
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('Could not find rstatus to delete.'));
126
+ $this->_redirect('*/*/');
127
+ }
128
+
129
+ public function massDeleteAction() {
130
+ $rstatusIds = $this->getRequest()->getParam('rstatus');
131
+ if(!is_array($rstatusIds)) {
132
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('Please select rstatus to delete.'));
133
+ }
134
+ else {
135
+ try {
136
+ foreach ($rstatusIds as $rstatusId) {
137
+ $rstatus = Mage::getModel('rma/rstatus');
138
+ $rstatus->setId($rstatusId)->delete();
139
+ }
140
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('rma')->__('Total of %d rstatus were successfully deleted.', count($rstatusIds)));
141
+ }
142
+ catch (Mage_Core_Exception $e){
143
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
144
+ }
145
+ catch (Exception $e) {
146
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('There was an error deleteing rstatus.'));
147
+ }
148
+ }
149
+ $this->_redirect('*/*/index');
150
+ }
151
+
152
+ public function massStatusAction(){
153
+ $rstatusIds = $this->getRequest()->getParam('rstatus');
154
+ if(!is_array($rstatusIds)) {
155
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('Please select rstatus.'));
156
+ }
157
+ else {
158
+ try {
159
+ foreach ($rstatusIds as $rstatusId) {
160
+ $rstatus = Mage::getSingleton('rma/rstatus')->load($rstatusId)
161
+ ->setStatus($this->getRequest()->getParam('status'))
162
+ ->setIsMassupdate(true)
163
+ ->save();
164
+ }
165
+ $this->_getSession()->addSuccess($this->__('Total of %d rstatus were successfully updated.', count($rstatusIds)));
166
+ }
167
+ catch (Mage_Core_Exception $e){
168
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
169
+ }
170
+ catch (Exception $e) {
171
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('rma')->__('There was an error updating rstatus.'));
172
+ }
173
+ }
174
+ $this->_redirect('*/*/index');
175
+ }
176
+
177
+ public function exportCsvAction(){
178
+ $fileName = 'rstatus.csv';
179
+ $content = $this->getLayout()->createBlock('rma/adminhtml_rstatus_grid')->getCsv();
180
+ $this->_prepareDownloadResponse($fileName, $content);
181
+ }
182
+
183
+ public function exportExcelAction(){
184
+ $fileName = 'rstatus.xls';
185
+ $content = $this->getLayout()->createBlock('rma/adminhtml_rstatus_grid')->getExcelFile();
186
+ $this->_prepareDownloadResponse($fileName, $content);
187
+ }
188
+
189
+ public function exportXmlAction(){
190
+ $fileName = 'rstatus.xml';
191
+ $content = $this->getLayout()->createBlock('rma/adminhtml_rstatus_grid')->getXml();
192
+ $this->_prepareDownloadResponse($fileName, $content);
193
+ }
194
+ }
app/code/community/jayje/Rma/controllers/IndexController.php CHANGED
@@ -1,14 +1,27 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Jayje_Rma_IndexController extends Mage_Core_Controller_Front_Action
3
  {
4
  public function indexAction()
5
  {
6
- $this->loadLayout();
7
- $session = Mage::getSingleton('customer/session');
8
- if(!$session->isLoggedIn()) {
9
- $this->_redirect('customer/account/login/');
10
- }
11
- $this->renderLayout();
12
  }
13
 
14
  public function requestAction()
@@ -22,7 +35,7 @@ class Jayje_Rma_IndexController extends Mage_Core_Controller_Front_Action
22
  }
23
  public function orderAction()
24
  {
25
- echo 'panni';
26
  $this->getResponse()->setBody($this->getLayout()->createBlock('rma/ajax')->toHtml());
27
 
28
  }
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
  class Jayje_Rma_IndexController extends Mage_Core_Controller_Front_Action
16
  {
17
  public function indexAction()
18
  {
19
+ $this->loadLayout();
20
+ $session = Mage::getSingleton('customer/session');
21
+ if(!$session->isLoggedIn()) {
22
+ $this->_redirect('customer/account/login/');
23
+ }
24
+ $this->renderLayout();
25
  }
26
 
27
  public function requestAction()
35
  }
36
  public function orderAction()
37
  {
38
+
39
  $this->getResponse()->setBody($this->getLayout()->createBlock('rma/ajax')->toHtml());
40
 
41
  }
app/code/community/jayje/Rma/etc/config.xml CHANGED
@@ -35,19 +35,25 @@
35
  </routers>
36
  </admin>
37
  <adminhtml>
38
- <menu>
39
- <rma module="rma">
40
- <title>RMA</title>
41
- <sort_order>71</sort_order>
42
- <children>
43
- <items module="rma">
44
- <title>Manage RMA</title>
45
- <sort_order>0</sort_order>
46
- <action>rma/adminhtml_rma</action>
47
- </items>
48
- </children>
49
- </rma>
50
- </menu>
 
 
 
 
 
 
51
  <acl>
52
  <resources>
53
  <all>
@@ -83,6 +89,9 @@
83
  <rma>
84
  <table>rma</table>
85
  </rma>
 
 
 
86
  </entities>
87
  </rma_mysql4>
88
  </models>
35
  </routers>
36
  </admin>
37
  <adminhtml>
38
+ <menu>
39
+ <rma module="rma">
40
+ <title>RMA</title>
41
+ <sort_order>71</sort_order>
42
+ <children>
43
+
44
+ <items module="rma">
45
+ <title>Manage RMA</title>
46
+ <sort_order>0</sort_order>
47
+ <action>rma/adminhtml_rma</action>
48
+ </items>
49
+ <rstatus module="rma">
50
+ <title>RMA Status and Return Type</title>
51
+ <sort_order>10</sort_order>
52
+ <action>rma/adminhtml_rstatus</action>
53
+ </rstatus>
54
+ </children>
55
+ </rma>
56
+ </menu>
57
  <acl>
58
  <resources>
59
  <all>
89
  <rma>
90
  <table>rma</table>
91
  </rma>
92
+ <rstatus>
93
+ <table>rstatus</table>
94
+ </rstatus>
95
  </entities>
96
  </rma_mysql4>
97
  </models>
app/code/community/jayje/Rma/etc/system.xml CHANGED
@@ -43,24 +43,15 @@
43
  <show_in_store>1</show_in_store>
44
  <source_model>adminhtml/system_config_source_yesno</source_model>
45
  </jayje_mail>
46
- <jayje_status translate="label">
47
- <label>RMA Status: </label>
48
- <comment>return type eg- Pending, Approved...(separated by comma)</comment>
49
- <frontend_type>textarea</frontend_type>
50
- <sort_order>25</sort_order>
51
- <show_in_default>1</show_in_default>
52
- <show_in_website>1</show_in_website>
53
- <show_in_store>1</show_in_store>
54
- </jayje_status>
55
- <jayje_type translate="label">
56
- <label>RMA Return type: </label>
57
- <comment>return type eg- Refund, Replacement...(separated by comma)</comment>
58
  <frontend_type>textarea</frontend_type>
59
  <sort_order>20</sort_order>
60
  <show_in_default>1</show_in_default>
61
  <show_in_website>1</show_in_website>
62
  <show_in_store>1</show_in_store>
63
- </jayje_type>
64
  </fields>
65
  </jayje_group>
66
  </groups>
43
  <show_in_store>1</show_in_store>
44
  <source_model>adminhtml/system_config_source_yesno</source_model>
45
  </jayje_mail>
46
+ <jayje_emailtemp translate="label">
47
+ <label>RMA Email Template: </label>
48
+ <comment>under development</comment>
 
 
 
 
 
 
 
 
 
49
  <frontend_type>textarea</frontend_type>
50
  <sort_order>20</sort_order>
51
  <show_in_default>1</show_in_default>
52
  <show_in_website>1</show_in_website>
53
  <show_in_store>1</show_in_store>
54
+ </jayje_emailtemp>
55
  </fields>
56
  </jayje_group>
57
  </groups>
app/code/community/jayje/Rma/sql/Rma_setup/mysql4-install-0.1.0.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  $installer = $this;
4
 
@@ -26,8 +39,8 @@ CREATE TABLE {$this->getTable('rma')} (
26
  PRIMARY KEY (`rma_id`)
27
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
28
 
29
- CREATE TABLE {$this->getTable('rma_comments')} (
30
- `id` int(11) NOT NULL AUTO_INCREMENT,
31
  `rmaid` int(11) NOT NULL,
32
  `stype` varchar(30) NOT NULL,
33
  `comments` text NOT NULL,
@@ -37,7 +50,7 @@ CREATE TABLE {$this->getTable('rma_comments')} (
37
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
38
 
39
 
40
- CREATE TABLE {$this->getTable('rma_products')} (
41
  `rpid` int(11) NOT NULL AUTO_INCREMENT,
42
  `rmaid` int(11) NOT NULL,
43
  `order_id` int(11) NOT NULL,
@@ -47,6 +60,31 @@ CREATE TABLE {$this->getTable('rma_products')} (
47
  `total` float NOT NULL,
48
  PRIMARY KEY (`rpid`)
49
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  ");
51
 
 
52
  $installer->endSetup();
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
  $installer = $this;
17
 
39
  PRIMARY KEY (`rma_id`)
40
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
41
 
42
+ CREATE TABLE IF NOT EXISTS `rma_comments` (
43
+ `id` int(11) NOT NULL AUTO_INCREMENT,
44
  `rmaid` int(11) NOT NULL,
45
  `stype` varchar(30) NOT NULL,
46
  `comments` text NOT NULL,
50
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
51
 
52
 
53
+ CREATE TABLE IF NOT EXISTS `rma_products` (
54
  `rpid` int(11) NOT NULL AUTO_INCREMENT,
55
  `rmaid` int(11) NOT NULL,
56
  `order_id` int(11) NOT NULL,
60
  `total` float NOT NULL,
61
  PRIMARY KEY (`rpid`)
62
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;
63
+
64
+
65
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('rma/rstatus')}` (
66
+ `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
67
+ `type` varchar(30) NOT NULL,
68
+ `label` varchar(255) NOT NULL DEFAULT '',
69
+ `status` tinyint(1) DEFAULT '1',
70
+ `code` varchar(30) NOT NULL,
71
+ `created_at` datetime DEFAULT NULL,
72
+ `updated_at` datetime DEFAULT NULL,
73
+ PRIMARY KEY (`entity_id`)
74
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2350 ;
75
+
76
+ INSERT INTO `rstatus` (`entity_id`, `type`, `label`, `status`, `code`, `created_at`, `updated_at`) VALUES
77
+ (2341, 'rma_returntype', 'Refund', 1, 'Refund', '2013-01-09 00:00:00', '2013-01-04 13:08:33'),
78
+ (2342, 'rma_status', 'Approved', 1, 'Approved', '2013-01-04 08:54:47', '2013-01-04 13:09:51'),
79
+ (2343, 'rma_returntype', 'Return', 1, 'return', '2013-01-04 08:59:27', '2013-01-07 06:49:31'),
80
+ (2344, 'rma_status', 'Failed', 1, 'failed', '2013-01-04 09:15:28', '2013-01-04 12:59:18'),
81
+ (2345, 'rma_status', 'Cancel', 1, 'Cancel', NULL, '2013-01-04 13:11:04'),
82
+ (2346, 'rma_status', 'Pending', 1, 'Pending', '2013-01-04 13:01:35', '2013-01-04 13:01:35'),
83
+ (2347, 'rma_status', 'Processing', 1, 'Processing', '2013-01-04 13:02:11', '2013-01-04 13:02:11'),
84
+ (2348, 'rma_returntype', 'Repair', 1, 'Repair', '2013-01-04 13:09:03', '2013-01-07 07:35:37'),
85
+ (2349, 'rma_returntype', 'Replacement', 1, 'Replacement', '2013-01-07 10:31:48', '2013-01-07 10:31:48');
86
+
87
  ");
88
 
89
+
90
  $installer->endSetup();
app/design/adminhtml/default/default/layout/rma.xml CHANGED
@@ -5,13 +5,11 @@
5
  <block type="rma/adminhtml_rma" name="rma" />
6
  </reference>
7
  </rma_adminhtml_rma_index>
8
-
9
  <rma_adminhtml_rma_info>
10
  <reference name="content">
11
  <block type="rma/adminhtml_rma_info" template="rma/info.phtml" name="sales.report.refreshstatistics" />
12
  </reference>
13
  </rma_adminhtml_rma_info>
14
-
15
  <rma_adminhtml_rma_new>
16
  <reference name="content">
17
  <block type="rma/adminhtml_rma_new" template="rma/infod.phtml" name="sales.report.refreshstatistics" />
@@ -23,4 +21,29 @@
23
  <block type="rma/adminhtml_edit" template="rma/info.phtml" name="sales.report.refreshstatistics" />
24
  </reference>
25
  </rma_adminhtml_rma_edit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  </layout>
5
  <block type="rma/adminhtml_rma" name="rma" />
6
  </reference>
7
  </rma_adminhtml_rma_index>
 
8
  <rma_adminhtml_rma_info>
9
  <reference name="content">
10
  <block type="rma/adminhtml_rma_info" template="rma/info.phtml" name="sales.report.refreshstatistics" />
11
  </reference>
12
  </rma_adminhtml_rma_info>
 
13
  <rma_adminhtml_rma_new>
14
  <reference name="content">
15
  <block type="rma/adminhtml_rma_new" template="rma/infod.phtml" name="sales.report.refreshstatistics" />
21
  <block type="rma/adminhtml_edit" template="rma/info.phtml" name="sales.report.refreshstatistics" />
22
  </reference>
23
  </rma_adminhtml_rma_edit>
24
+ <rma_adminhtml_rstatus_index>
25
+ <reference name="content">
26
+ <block type="rma/adminhtml_rstatus" name="rstatus_grid" />
27
+ </reference>
28
+ </rma_adminhtml_rstatus_index>
29
+ <rma_adminhtml_rstatus_grid>
30
+ <block type="core/text_list" name="root" output="toHtml">
31
+ <block type="rma/adminhtml_rstatus_grid" name="rstatus_grid"/>
32
+ </block>
33
+ </rma_adminhtml_rstatus_grid>
34
+ <!-- Rstatus add/edit action -->
35
+ <rma_adminhtml_rstatus_edit>
36
+ <update handle="editor"/>
37
+ <reference name="menu">
38
+ <action method="setActive">
39
+ <menupath>rma/rstatus</menupath>
40
+ </action>
41
+ </reference>
42
+ <reference name="content">
43
+ <block type="rma/adminhtml_rstatus_edit" name="rstatus_edit"></block>
44
+ </reference>
45
+ <reference name="left">
46
+ <block type="rma/adminhtml_rstatus_edit_tabs" name="rstatus_tabs"></block>
47
+ </reference>
48
+ </rma_adminhtml_rstatus_edit>
49
  </layout>
app/design/adminhtml/default/default/template/rma/comments.phtml CHANGED
@@ -1,4 +1,19 @@
1
- <?php $id = $this->getRequest()->getParam('id');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $result = $this->getRmaComments() ;
3
  while($resultn = $result->fetch(PDO::FETCH_ASSOC)){
4
  extract($resultn); ?>
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
+ $id = $this->getRequest()->getParam('id');
17
  $result = $this->getRmaComments() ;
18
  while($resultn = $result->fetch(PDO::FETCH_ASSOC)){
19
  extract($resultn); ?>
app/design/adminhtml/default/default/template/rma/info.phtml CHANGED
@@ -1,5 +1,19 @@
1
  <?php
2
- $id = $this->getRequest()->getParam('id');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  if($id != ''){
4
  $ids = Jayje_Rma_Block_Adminhtml_Rma::getOrderInfo($id);
5
  $_order = Mage::getModel('sales/order')->load($ids[0]); ?>
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
+ $id = $this->getRequest()->getParam('id');
17
  if($id != ''){
18
  $ids = Jayje_Rma_Block_Adminhtml_Rma::getOrderInfo($id);
19
  $_order = Mage::getModel('sales/order')->load($ids[0]); ?>
app/design/frontend/default/default/template/rma/oitems.phtml DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @author MESMERiZE
5
- * @copyright 2012
6
- */
7
-
8
-
9
- $order_id = $_GET['oid'];
10
- require("app/Mage.php");
11
- umask(0);
12
- Mage::app();
13
- $increment_id = Mage::getModel('sales/order')->load(12)->getData();
14
- //print_r($increment_id);
15
- ?>
16
-
17
- <div class="entry-edit">
18
- <div class="entry-edit-head">
19
- <h4 class="icon-head head-products">Items RMA Requested for</h4>
20
- </div>
21
- </div><div class="grid np">
22
- <div class="hor-scroll">
23
- <table cellspacing="0" class="data order-tables" width="90%">
24
- <thead>
25
- <tr class="headings">
26
- <th><strong>Product</strong></th><th><strong>Price</strong></th><th><strong>Qty</strong></th><th><strong>Return <br />Qty</strong></th>
27
- </tr>
28
- </thead>
29
- <tbody class="even">
30
- <?php
31
-
32
- $items = Mage::getModel('sales/order')->load($order_id)->getAllItems();
33
- foreach ($items as $itemId => $item)
34
- {
35
- ?>
36
- <tr class="border">
37
- <td>
38
- <div id="order_item_33" class="item-container">
39
- <div class="item-text">
40
- <h5 class="title"><span id="order_item_33_title"><?php echo $item->getName() ?></span></h5>
41
- </div>
42
- </div>
43
- </td>
44
- <td>
45
- <span class="price-excl-tax">
46
- <span class="price"><?php echo $item->getPrice() ?></span>
47
- </span>
48
- </td><td><strong><?php echo round($item->getQtyOrdered()) ?></strong></td>
49
- <td>
50
- <input type="hidden" id="o<?php echo $item->getProductId() ?>" size="2" name="" value="<?php echo $item->getQtyOrdered() ?>" />
51
- <input type="text" id="rma<?php echo $item->getProductId() ?>" size="2" name="qty_<?php echo $itemId; ?>" value="1" autocomplete="off" onkeyup="return checkQty(<?php echo $item->getProductId() ?>)" />
52
-
53
-
54
- <input type="hidden" size="2" name="pid_<?php echo $itemId; ?>" value="<?php echo $item->getProductId() ?>" /></td>
55
- <input type="hidden" size="2" name="price_<?php echo $itemId; ?>" value="<?php echo $item->getPrice() ?>" /></td>
56
- </tr>
57
- <?php } ?><tr><td> <input type="hidden" size="2" name="maxpid" value="<?php echo $itemId ?>" /></td>
58
- </td></tr>
59
- </tbody>
60
- </table>
61
- </div>
62
- </div>
63
-
64
-
65
-
66
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/rma/request.phtml CHANGED
@@ -1,26 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-1.4.2.js"></script>
2
  <script>
3
  function getnp(){
4
  var order_id = document.getElementById("order_id").value;
5
- $("div#jfjfjf").html('<br><br><br><div align="center" style="margin-left: -50px;">Loading...');
6
- $.ajax({
7
- type: "GET",
8
-
9
- // url: '<?php echo Mage::getUrl('rma/index/order') ?>',
10
- url: '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);; ?>/oproducts.php',
11
- url: '<?php echo Mage::getUrl('rma/index/order') ?>',
12
- data: "oid="+ order_id , // appears as $_GET['id'] @ ur backend side
13
- success: function(data) {
14
- // data is ur summary
15
- $('#jfjfjf').html(data);
16
- }
17
-
18
- });
19
- return true;
20
- }
21
-
22
-
23
-
24
  </script>
25
  <h2 class="legend translate-inline">Request For RMA</h2>
26
  <div>
1
+ <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+ ?>
16
  <script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>jquery-1.4.2.js"></script>
17
  <script>
18
  function getnp(){
19
  var order_id = document.getElementById("order_id").value;
20
+ $("div#jfjfjf").html('<br><br><br><div align="center" style="margin-left: -50px;">Loading...');
21
+ $.ajax({
22
+ type: "GET",
23
+
24
+ // url: '<?php echo Mage::getUrl('rma/index/order') ?>',
25
+ // url: '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);; ?>/oproducts.php',
26
+ url: '<?php echo Mage::getUrl('rma/index/order') ?>',
27
+ data: "oid="+ order_id , // appears as $_GET['id'] @ ur backend side
28
+ success: function(data) {
29
+ // data is ur summary
30
+ $('#jfjfjf').html(data);
31
+ }
32
+
33
+ });
34
+ return true;
35
+ }
 
 
 
36
  </script>
37
  <h2 class="legend translate-inline">Request For RMA</h2>
38
  <div>
app/design/frontend/default/default/template/rma/ritem.php DELETED
@@ -1,91 +0,0 @@
1
- rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
2
- <?php
3
- $order_id = $this->getRequest()->getParam('oid');
4
- $order_id = $_GET['oid'];
5
- require("app/Mage.php");
6
- umask(0);
7
- Mage::app();
8
- $increment_id = Mage::getModel('sales/order')->load(12)->getData();
9
- //print_r($increment_id);
10
- ?>
11
- <script>
12
- function checkQty(id){
13
- var rma_qty = document.getElementById("rma"+id).value;
14
- var o_qty = document.getElementById("o"+id).value;
15
- if(isNaN(rma_qty)){
16
- alert('not number');
17
- document.getElementById("rma"+id).value=1
18
- }else{
19
- if(o_qty >= rma_qty){
20
- // alert('Rma quantity should be less than ordered quantity');
21
- //document.getElementById("rma"+id).value=1
22
- }else{
23
- alert('Rma quantity should be less than ordered quantity');
24
- document.getElementById("rma"+id).value=1
25
- }
26
- }
27
- }
28
- </script>
29
- <div class="entry-edit">
30
- <div class="entry-edit-head">
31
- <h4 class="icon-head head-products">Items RMA Requested for</h4>
32
- </div>
33
- </div><div class="grid np">
34
- <div class="hor-scroll">
35
- <table cellspacing="0" class="data order-tables" width="90%">
36
- <thead>
37
- <tr class="headings">
38
- <th><strong>Product</strong></th><th><strong>Price</strong></th><th><strong>Qty</strong></th><th><strong>Return <br />Qty</strong></th>
39
- </tr>
40
- </thead>
41
- <tbody class="even">
42
- <?php
43
-
44
- $items = Mage::getModel('sales/order')->load($order_id)->getAllItems();
45
- foreach ($items as $itemId => $item)
46
- {
47
-
48
-
49
- echo $tf= checkRmaProduct($order_id, $item->getProductId())
50
- ?>
51
- <tr class="border">
52
- <td>
53
- <div id="order_item_33" class="item-container">
54
- <div class="item-text">
55
- <h5 class="title"><span id="order_item_33_title"><?php echo $item->getName() ?></span></h5>
56
- </div>
57
- </div>
58
- </td>
59
- <td>
60
- <span class="price-excl-tax">
61
- <span class="price"><?php echo $item->getPrice() ?></span>
62
- </span>
63
- </td><td><strong><?php echo round($item->getQtyOrdered()) ?></strong></td>
64
- <td>
65
- <input type="hidden" id="o<?php echo $item->getProductId() ?>" size="2" name="" value="<?php echo $item->getQtyOrdered() ?>" />
66
-
67
- <?php if($tf>0){ ?>
68
- Already Requested
69
- <?php }else{ ?>
70
- <input type="text" id="rma<?php echo $item->getProductId() ?>" size="2" name="qty_<?php echo $itemId; ?>" value="1" autocomplete="off" onkeyup="return checkQty(<?php echo $item->getProductId() ?>)" />
71
- <?php } ?>
72
-
73
- <input type="hidden" size="2" name="pid_<?php echo $itemId; ?>" value="<?php echo $item->getProductId() ?>" /></td>
74
- <input type="hidden" size="2" name="price_<?php echo $itemId; ?>" value="<?php echo $item->getPrice() ?>" /></td>
75
- </tr>
76
- <?php } ?><tr><td> <input type="hidden" size="2" name="maxpid" value="<?php echo $itemId ?>" /></td>
77
- </td></tr>
78
- </tbody>
79
- </table>
80
- </div><?php
81
- function checkRmaProduct($oid, $pid){
82
- $db = Mage::getSingleton('core/resource')->getConnection('core_read');
83
- $que = "SELECT product_id FROM `rma_products` WHERE `order_id` ='$oid' and `product_id` = '$pid' LIMIT 0 , 1";
84
- $result = $db->query($que);
85
- $resultn = $result->fetch(PDO::FETCH_ASSOC);
86
- extract($resultn);
87
- return $product_id;
88
-
89
- }
90
-
91
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/rma/ritem.phtml CHANGED
@@ -1,6 +1,19 @@
1
  <?php
2
- $order_id = $this->getRequest()->getParam('oid');
 
 
 
 
 
 
 
 
 
 
 
 
3
 
 
4
  $increment_id = Mage::getModel('sales/order')->load(12)->getData();
5
  //print_r($increment_id);
6
  ?>
@@ -40,7 +53,7 @@ function checkQty(id){
40
  $items = Mage::getModel('sales/order')->load($order_id)->getAllItems();
41
  foreach ($items as $itemId => $item)
42
  {
43
- echo $tf= $this->checkRmaProduct($order_id, $item->getProductId())
44
  ?>
45
  <tr class="border">
46
  <td>
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
 
16
+ $order_id = $this->getRequest()->getParam('oid');
17
  $increment_id = Mage::getModel('sales/order')->load(12)->getData();
18
  //print_r($increment_id);
19
  ?>
53
  $items = Mage::getModel('sales/order')->load($order_id)->getAllItems();
54
  foreach ($items as $itemId => $item)
55
  {
56
+ $tf= $this->checkRmaProduct($order_id, $item->getProductId())
57
  ?>
58
  <tr class="border">
59
  <td>
app/design/frontend/default/default/template/rma/rma.phtml CHANGED
@@ -1,4 +1,18 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $result= $this->getRmaList();
3
  ?>
4
  <div class="page-title title-buttons">
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
  $result= $this->getRmaList();
17
  ?>
18
  <div class="page-title title-buttons">
app/design/frontend/default/default/template/rma/view.phtml CHANGED
@@ -1,4 +1,18 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $rma = $this->getRmaDetails();
3
  ?>
4
  <div class="page-title title-buttons">
@@ -16,8 +30,8 @@
16
  ID: <?php echo $rma['rma_id']; ?>
17
  </div>
18
  <div class="box-content">
19
- Order: <a href="<?php echo Mage::helper('core/url')->getHomeUrl()."/sales/order/view/order_id/$order_id"; ?>" >#<?php echo $rma['increment_id']; ?></a>
20
- </div>
21
  <div class="box-content">
22
  Status: <?php echo $rma['status']; ?>
23
  </div>
1
  <?php
2
+ /**
3
+ * Jayje_Rma extension
4
+ *
5
+ * @category Return Merchant Authorization Magento - wakensys
6
+ * @package Jayje_Rma
7
+ * @copyright Copyright (c) 2013
8
+ * @license http://opensource.org/licenses/mit-license.php MIT License
9
+ * @category Jayje
10
+ * @package Jayje_Rma
11
+ * @author wakensys
12
+ * @developper s.ratheepan@gmail.com
13
+ */
14
+
15
+
16
  $rma = $this->getRmaDetails();
17
  ?>
18
  <div class="page-title title-buttons">
30
  ID: <?php echo $rma['rma_id']; ?>
31
  </div>
32
  <div class="box-content">
33
+ Order: <a href="<?php echo Mage::helper('core/url')->getHomeUrl()."/sales/order/view/order_id/".$rma['order_id']; ?>" >#<?php echo $rma['increment_id']; ?></a>
34
+ </div>
35
  <div class="box-content">
36
  Status: <?php echo $rma['status']; ?>
37
  </div>
app/etc/modules/Jayje_Rma.xml CHANGED
@@ -1,36 +1,9 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Magento
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0)
9
- * that is bundled with this package in the file LICENSE_AFL.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
- *
22
- * @category Mage
23
- * @package Mage_Widget
24
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
- */
27
- -->
28
- <config>
29
- <modules>
30
- <Jayje_Rma>
31
- <active>true</active>
32
- <codePool>community</codePool>
33
-
34
- </Jayje_Rma>
35
- </modules>
36
- </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Jayje_Rma>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Jayje_Rma>
8
+ </modules>
9
+ </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,29 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jayje</name>
4
- <version>1.00.18</version>
5
  <stability>stable</stability>
6
- <license>Jayje</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Return Merchant Authorization</summary>
10
- <description>Return Merchant Authorization</description>
11
- <notes>Return Merchant Authorization</notes>
 
 
 
 
 
 
 
 
 
 
 
12
  <authors><author><name>wakensys</name><user>wakensys</user><email>admin@wakensys.com</email></author><author><name>ratheepan s</name><user>ratheepan</user><email>s.ratheepan@gmail.com</email></author></authors>
13
- <date>2012-12-30</date>
14
- <time>06:13:54</time>
15
- <contents><target name="magecommunity"><dir name="jayje"><dir name="Rma"><dir name="Block"><dir name="Adminhtml"><dir name="Rma"><dir name="Edit"><file name="Form.php" hash="196f8531d8ef88443e7e920bff442542"/><dir name="Tab"><file name="Comments.php" hash="fe7ddb97471bf179aa01307ba66b93cf"/><file name="Form.php" hash="a8071f82a0537c9a6254a757f90cc48c"/><file name="Order.php" hash="83c66a24f18ca3efdfaff6fdc177f1d1"/></dir><file name="Tabs.php" hash="a8b189c45f14ed59bc0a32a285282256"/></dir><file name="Edit.php" hash="c239694953040ce27623147b42e31678"/><file name="Grid.php" hash="b9208e316a6963148a4081748793a893"/><file name="Info.php" hash="1472ae84058732c1abcb0010df2cf909"/></dir><file name="Rma.php" hash="796b752d34baf1cc7a12cfd785e61413"/></dir><file name="Ajax.php" hash="d48b9b1dae080c65a3d068de821b6c39"/><file name="Rma.php" hash="6a9f03f1bef86b924377a92dc34e2797"/></dir><dir name="Helper"><file name="Data.php" hash="1dc7076d01d55a0631f52efcae1c4fa5"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Rma"><file name="Collection.php" hash="4778a373d8d39632a0a30e5430ed7544"/></dir><file name="Rma.php" hash="a0a5300cab5552207c05ed9d57970918"/></dir><file name="Rma.php" hash="e09a0f0d5dd7f23a3bc982faf27fe5d0"/><file name="Status.php" hash="de1335652bfbb0d3b50061ab104f7c71"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="RmaController.php" hash="bee790f592f4924a7b5fe384e7758700"/></dir><file name="IndexController.php" hash="af519d1ff3a4a280d379b501a11fda95"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d1d774f537d3aaa91df1b1b3c22e5d08"/><file name="config.xml" hash="002071ae7899b012aeff498ae6afbfff"/><file name="system.xml" hash="da3d2c7327b3b5b1bf741785af4d0f3e"/></dir><dir name="sql"><dir name="Rma_setup"><file name="mysql4-install-0.1.0.php" hash="45cb74ea442ac6c10dd63fca10c71c9f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rma.xml" hash="37bf5d17c2cca450e4ada722aa44f162"/></dir><dir name="template"><dir name="rma"><file name="comments.phtml" hash="4f1b21142176608ae8cf82792a695be9"/><file name="info.phtml" hash="c302ed388fc16e9544289b3f5bdabdc0"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="rma.xml" hash="e38cc9f629b81a89f4ee1f0a2d61a18c"/></dir><dir name="template"><dir name="rma"><file name="oitems.phtml" hash="35c8c272c6dcd90742ceef5e4ea44345"/><file name="request.phtml" hash="8fc37ae9bb222a26c5fdc1f90bd1b500"/><file name="ritem.php" hash="db7cb534747549671ac07c82cece5d83"/><file name="ritem.phtml" hash="d4ca1fd480e822209586c80bae49f8c3"/><file name="rma.phtml" hash="177e1bef8e642613be7505d03107c74f"/><file name="view.phtml" hash="94c838dde1f5bf71279582d9c244e368"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Jayje_Rma.xml" hash="715e0e2f462df0ef46302d38c221a9f9"/></dir></dir></dir><dir name="js"><file name="jquery-1.4.2.js" hash="10092eee563dec2dca82b77d2cf5a1ae"/></dir><dir/></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jayje</name>
4
+ <version>1.00.19</version>
5
  <stability>stable</stability>
6
+ <license>wakensys</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Return Merchant Authorization Magento - wakensys</summary>
10
+ <description>Return Merchant Authorization Magento - wakensys - with new features</description>
11
+ <notes>&#xD;
12
+ * Jayje_Rma extension&#xD;
13
+ * &#xD;
14
+ * @category Return Merchant Authorization Magento - wakensys&#xD;
15
+ * @package Jayje_Rma&#xD;
16
+ * @copyright Copyright (c) 2013&#xD;
17
+ * @license http://opensource.org/licenses/mit-license.php MIT License&#xD;
18
+ * @category Jayje&#xD;
19
+ * @package Jayje_Rma&#xD;
20
+ * @author wakensys&#xD;
21
+ * @developper s.ratheepan@gmail.com&#xD;
22
+ </notes>
23
  <authors><author><name>wakensys</name><user>wakensys</user><email>admin@wakensys.com</email></author><author><name>ratheepan s</name><user>ratheepan</user><email>s.ratheepan@gmail.com</email></author></authors>
24
+ <date>2013-01-07</date>
25
+ <time>11:56:27</time>
26
+ <contents><target name="magecommunity"><dir name="jayje"><dir name="Rma"><dir name="Block"><dir name="Adminhtml"><dir name="Rma"><dir name="Edit"><file name="Form.php" hash="c17dda020eea0e35655c6c3d936b4e4d"/><dir name="Tab"><file name="Comments.php" hash="2c2d455204298e9275b9ea22f921af44"/><file name="Form.php" hash="f6bd7993628ffa1aaa6b25b169bedd0e"/><file name="Order.php" hash="e6b772b402751fa9064ab3a909b872d8"/></dir><file name="Tabs.php" hash="b98372c342c3283720f4c498fbe5ff96"/></dir><file name="Edit.php" hash="463d7775b5487c0cc6d0decf0fee4b5e"/><file name="Grid.php" hash="9ef44053b43fa3d579c8528f5819712c"/><file name="Info.php" hash="6b1cc7816adbaebc644bea85361641a2"/></dir><file name="Rma.php" hash="2f06c3c3193b9e9b285d4bfb0ea4e79c"/><dir name="Rstatus"><dir name="Edit"><file name="Form.php" hash="179b8c8f9a0ce4bc1f7dd77f4462929d"/><dir name="Tab"><file name="Form.php" hash="195281b00db9345f6cda629d6dd90fa7"/></dir><file name="Tabs.php" hash="f32eec6f49b792e05db98beb388f1aa5"/></dir><file name="Edit.php" hash="64cc94fd3c728ab47e46e3e0bfd406fd"/><file name="Grid.php" hash="a3a492f66c92dc5409b098d0d4878fbb"/></dir><file name="Rstatus.php" hash="fd615a7d2cd20da9d1a9a0ebdcbccf2b"/></dir><file name="Ajax.php" hash="9d6962522f37f14e3862d4237e4ad353"/><file name="Rma.php" hash="173e3ab9936717bf89f0f28ac7090a7f"/></dir><dir name="Controller"><dir name="Adminhtml"><file name="Rma.php" hash="11690815008d3afb6e8620d07bb9fd61"/></dir></dir><dir name="Helper"><file name="Data.php" hash="93aa9730afa6fba2232ede4393be8275"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Rma"><file name="Collection.php" hash="e7b5aeb3ed76ebfc81ddbc39a9d656ef"/></dir><file name="Rma.php" hash="d947b8498e305f0f40ec085e7982774c"/><dir name="Rstatus"><file name="Collection.php" hash="1bd6110583bb244668c9c70eaa34f253"/></dir><file name="Rstatus.php" hash="ac299021684b8ab9c4257b4dbfc9cafc"/></dir><file name="Rma.php" hash="ddd840e73f7a633d71c405b94e42d5bd"/><file name="Rstatus.php" hash="83f848c66cc76f6e876e887ce8657e22"/><file name="Status.php" hash="3442a2c322d2ba3dda69b34d300ff538"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="RmaController.php" hash="aaad2c078b10f0a66a9dccee20c0f87a"/><file name="RstatusController.php" hash="0cefdd66b97b922f5e44aa446c7dc9eb"/></dir><file name="IndexController.php" hash="517a04914fd257340beb5a285e025090"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d1d774f537d3aaa91df1b1b3c22e5d08"/><file name="config.xml" hash="6e3497c42f007d8ef2ccdeb1add56ddd"/><file name="system.xml" hash="0405d0b0b1109f05f732930b1044b43c"/></dir><dir name="sql"><dir name="Rma_setup"><file name="mysql4-install-0.1.0.php" hash="34c5b3735650bb465012d1cc76eef923"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="rma.xml" hash="0a4553f71ad996d10db5e15a764b0e2c"/></dir><dir name="template"><dir name="rma"><file name="comments.phtml" hash="b2a0ade4d36b658f0f6a044e5c0cefba"/><file name="info.phtml" hash="b4ea9b9a0ca3f5e4d78957f44618ad55"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="rma.xml" hash="e38cc9f629b81a89f4ee1f0a2d61a18c"/></dir><dir name="template"><dir name="rma"><file name="request.phtml" hash="58421784cf3f281144a66ac9586d7be9"/><file name="ritem.phtml" hash="84e89024c4fb27a6f5910da718b20e92"/><file name="rma.phtml" hash="1a444cce844534c5c89b85b1fb67c571"/><file name="view.phtml" hash="5c28f2f8e82cb1732c060cd8be767aa3"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><file name="jquery-1.4.2.js" hash="10092eee563dec2dca82b77d2cf5a1ae"/></dir><dir name="app"><dir name="etc"><dir name="modules"><file name="Jayje_Rma.xml" hash="6efd4aedf8b0e86df813eec41919030a"/></dir></dir></dir></target></contents>
27
  <compatible/>
28
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
29
  </package>