Payment_Reembolso - Version 0.2.2

Version Notes

CHANGES:

->U app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso/Grid.php
->U app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso/Edit/Tab/Form.php
->U app/code/local/Mage/Reembolso/Model/Mysql4/Reembolso/Collection.php
->U app/code/local/Mage/Reembolso/Model/Reembolso.php
->A app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-upgrade-0.2.1-0.2.2.php
->U app/design/frontend/default/default/template/reembolso/form.phtml

Download this release

Release Info

Developer Magento Core Team
Extension Payment_Reembolso
Version 0.2.2
Comparing to
See all releases


Code changes from version 0.2.1 to 0.2.2

app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso.php CHANGED
@@ -5,8 +5,8 @@ class Mage_Reembolso_Block_Adminhtml_Reembolso extends Mage_Adminhtml_Block_Widg
5
{
6
$this->_controller = 'adminhtml_reembolso';
7
$this->_blockGroup = 'reembolso';
8
- $this->_headerText = Mage::helper('reembolso')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('reembolso')->__('Add Item');
10
parent::__construct();
11
}
12
}
5
{
6
$this->_controller = 'adminhtml_reembolso';
7
$this->_blockGroup = 'reembolso';
8
+ $this->_headerText = Mage::helper('reembolso')->__('Reembolso');
9
+ $this->_addButtonLabel = Mage::helper('reembolso')->__('Nuevo reembolso');
10
parent::__construct();
11
}
12
}
app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso/Edit/Tab/Form.php CHANGED
@@ -16,6 +16,13 @@ class Mage_Reembolso_Block_Adminhtml_Reembolso_Edit_Tab_Form extends Mage_Adminh
16
'name' => 'title',
17
));
18
19
$fieldset->addField('above', 'text', array(
20
'label' => Mage::helper('reembolso')->__('Above'),
21
'class' => 'required-entry',
16
'name' => 'title',
17
));
18
19
+ $fieldset->addField('descript', 'text', array(
20
+ 'label' => Mage::helper('reembolso')->__('Description'),
21
+ 'class' => 'required-entry',
22
+ 'required' => true,
23
+ 'name' => 'descript',
24
+ ));
25
+
26
$fieldset->addField('above', 'text', array(
27
'label' => Mage::helper('reembolso')->__('Above'),
28
'class' => 'required-entry',
app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso/Grid.php CHANGED
@@ -33,6 +33,12 @@ class Mage_Reembolso_Block_Adminhtml_Reembolso_Grid extends Mage_Adminhtml_Block
33
'index' => 'title',
34
));
35
36
$this->addColumn('above', array(
37
'header' => Mage::helper('reembolso')->__('Above'),
38
'align' =>'left',
33
'index' => 'title',
34
));
35
36
+ $this->addColumn('descript', array(
37
+ 'header' => Mage::helper('reembolso')->__('Description'),
38
+ 'align' =>'left',
39
+ 'index' => 'descript',
40
+ ));
41
+
42
$this->addColumn('above', array(
43
'header' => Mage::helper('reembolso')->__('Above'),
44
'align' =>'left',
app/code/local/Mage/Reembolso/Block/Form.php CHANGED
@@ -2,7 +2,6 @@
2
class Mage_Reembolso_Block_Form extends Mage_Payment_Block_Form {
3
4
protected function _construct() {
5
- Mage::log('Form de reembolso');
6
parent::_construct();
7
$this->setTemplate('reembolso/form.phtml');
8
}
2
class Mage_Reembolso_Block_Form extends Mage_Payment_Block_Form {
3
4
protected function _construct() {
5
parent::_construct();
6
$this->setTemplate('reembolso/form.phtml');
7
}
app/code/local/Mage/Reembolso/Block/Info.php CHANGED
@@ -2,7 +2,6 @@
2
class Mage_Reembolso_Block_Info extends Mage_Payment_Block_Info {
3
4
protected function _construct() {
5
- Mage::log('Info de reembolso');
6
parent::_construct();
7
$this->setTemplate('reembolso/info.phtml');
8
}
2
class Mage_Reembolso_Block_Info extends Mage_Payment_Block_Info {
3
4
protected function _construct() {
5
parent::_construct();
6
$this->setTemplate('reembolso/info.phtml');
7
}
app/code/local/Mage/Reembolso/Block/Reembolso.php CHANGED
@@ -2,10 +2,6 @@
2
class Mage_Reembolso_Block_Reembolso extends Mage_Core_Block_Template
3
{
4
5
- public function _construct(){
6
- Mage::log(__FILE__);
7
- }
8
-
9
public function _prepareLayout()
10
{
11
return parent::_prepareLayout();
2
class Mage_Reembolso_Block_Reembolso extends Mage_Core_Block_Template
3
{
4
5
public function _prepareLayout()
6
{
7
return parent::_prepareLayout();
app/code/local/Mage/Reembolso/Model/Mysql4/Reembolso/Collection.php CHANGED
@@ -13,6 +13,7 @@ class Mage_Reembolso_Model_Mysql4_Reembolso_Collection extends Mage_Core_Model_M
13
->from(array('main_table'=>$this->getTable('reembolso')),array(
14
'reembolso_id',
15
'title',
16
'shipping_method',
17
'type',
18
'value',
@@ -23,7 +24,7 @@ class Mage_Reembolso_Model_Mysql4_Reembolso_Collection extends Mage_Core_Model_M
23
}
24
25
public function getShippingMethods(){
26
- $keys=array();
27
foreach(Mage::getModel('adminhtml/system_config_source_shipping_allmethods')->toOptionArray() as $key=>$method){
28
$keys[$key.'_'.$key] = $method['label'];
29
}
@@ -59,6 +60,7 @@ class Mage_Reembolso_Model_Mysql4_Reembolso_Collection extends Mage_Core_Model_M
59
60
$datos['id'] = $items[0]->getData('reembolso_id');
61
$datos['title'] = $items[0]->getData('title');
62
$datos['shipping'] = $items[0]->getData('shipping_method');
63
$datos['type'] = $items[0]->getData('type');
64
$datos['value'] = $items[0]->getData('value');
13
->from(array('main_table'=>$this->getTable('reembolso')),array(
14
'reembolso_id',
15
'title',
16
+ 'descript',
17
'shipping_method',
18
'type',
19
'value',
24
}
25
26
public function getShippingMethods(){
27
+ $keys = array();
28
foreach(Mage::getModel('adminhtml/system_config_source_shipping_allmethods')->toOptionArray() as $key=>$method){
29
$keys[$key.'_'.$key] = $method['label'];
30
}
60
61
$datos['id'] = $items[0]->getData('reembolso_id');
62
$datos['title'] = $items[0]->getData('title');
63
+ $datos['descript'] = $items[0]->getData('descript');
64
$datos['shipping'] = $items[0]->getData('shipping_method');
65
$datos['type'] = $items[0]->getData('type');
66
$datos['value'] = $items[0]->getData('value');
app/code/local/Mage/Reembolso/Model/Reembolso.php CHANGED
@@ -5,12 +5,11 @@ class Mage_Reembolso_Model_Reembolso extends Mage_Payment_Model_Method_Abstract
5
6
protected $_formBlockType = 'reembolso/form';
7
protected $_infoBlockType = 'reembolso/info';
8
-
9
public function isAvailable($quote=null){
10
$allow = true;
11
$data = $this->getShippMethod();
12
13
- Mage::log('Error: '.$data['title']);
14
if($data['error']) $allow = false;
15
return $allow;
16
}
@@ -38,6 +37,7 @@ Mage::log('Error: '.$data['title']);
38
if($data['error']){
39
$data['id'] = 0;
40
$data['title'] = Mage::helper('adminhtml')->__('Sin definir');
41
$data['shipping'] = Mage::helper('adminhtml')->__('Sin definir');
42
$data['type'] = 1;
43
$data['value'] = 0;
@@ -48,11 +48,26 @@ Mage::log('Error: '.$data['title']);
48
return $data;
49
}
50
51
public function getReembolsoTitle(){
52
// aca tomo el titulo
53
$data = $this->getShippMethod();
54
55
return $data['title'];
56
}
57
58
}
5
6
protected $_formBlockType = 'reembolso/form';
7
protected $_infoBlockType = 'reembolso/info';
8
+
9
public function isAvailable($quote=null){
10
$allow = true;
11
$data = $this->getShippMethod();
12
13
if($data['error']) $allow = false;
14
return $allow;
15
}
37
if($data['error']){
38
$data['id'] = 0;
39
$data['title'] = Mage::helper('adminhtml')->__('Sin definir');
40
+ $data['descript'] = Mage::helper('adminhtml')->__('Sin definir');
41
$data['shipping'] = Mage::helper('adminhtml')->__('Sin definir');
42
$data['type'] = 1;
43
$data['value'] = 0;
48
return $data;
49
}
50
51
+ // esta casi que ni se usa
52
public function getReembolsoTitle(){
53
// aca tomo el titulo
54
$data = $this->getShippMethod();
55
56
return $data['title'];
57
}
58
+
59
+ public function getReembolsoDescript(){
60
+ // aca tomo el titulo
61
+ $data = $this->getShippMethod();
62
+
63
+ return $data['descript'];
64
+ }
65
+
66
+ public function getTitle(){
67
+ // aca tomo el titulo
68
+ $data = $this->getShippMethod();
69
+
70
+ return $data['title'];
71
+ }
72
73
}
app/code/local/Mage/Reembolso/controllers/Adminhtml/ReembolsoController.php CHANGED
@@ -72,6 +72,7 @@ class Mage_Reembolso_Adminhtml_ReembolsoController extends Mage_Adminhtml_Contro
72
73
if ($this->getRequest()->getParam('back')) {
74
$this->_redirect('*/*/edit', array('id' => $model->getId()));
75
return;
76
}
77
$this->_redirect('*/*/');
@@ -184,4 +185,4 @@ class Mage_Reembolso_Adminhtml_ReembolsoController extends Mage_Adminhtml_Contro
184
$response->sendResponse();
185
die;
186
}
187
- }
72
73
if ($this->getRequest()->getParam('back')) {
74
$this->_redirect('*/*/edit', array('id' => $model->getId()));
75
+ Mage::log('PLease: '.$this->_redirect('*/*/edit', array('id' => $model->getId())));
76
return;
77
}
78
$this->_redirect('*/*/');
185
$response->sendResponse();
186
die;
187
}
188
+ }
app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-upgrade-0.2.1-0.2.2.php ADDED
@@ -0,0 +1,23 @@
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ DROP TABLE IF EXISTS {$this->getTable('reembolso')};
10
+ CREATE TABLE {$this->getTable('reembolso')} (
11
+ `reembolso_id` int(11) unsigned NOT NULL auto_increment,
12
+ `title` varchar(255) NOT NULL default '',
13
+ `descript` varchar(500) NOT NULL default '',
14
+ `shipping_method` varchar(255) NOT NULL default '',
15
+ `type` smallint(6) NOT NULL default '0',
16
+ `value` smallint(6) NOT NULL default '0',
17
+ `above` smallint(6) NOT NULL default '0',
18
+ PRIMARY KEY (`reembolso_id`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+ ");
22
+
23
+ $installer->endSetup();
app/design/frontend/default/default/template/reembolso/form.phtml CHANGED
@@ -8,8 +8,9 @@
8
<tr>
9
<td>
10
<?php
11
- echo $this->__('El pago ser&aacute; realizado en la direcci&oacute;n de destino a traves de ');
12
- echo $this->getMethod()->getReembolsoTitle() . ".";
13
$data = $this->getMethod()->getShippMethod();
14
echo "<br/><strong>".$this->__('Costo: ');
15
echo Mage::helper('checkout')->formatPrice($data['total_shipping'])."</strong>";
8
<tr>
9
<td>
10
<?php
11
+ //echo $this->__('El pago ser&aacute; realizado en la direcci&oacute;n de destino a traves de ');
12
+ echo $this->getMethod()->getReembolsoDescript() . ".";
13
+ //echo $this->getMethod()->getReembolsoTitle() . ".";
14
$data = $this->getMethod()->getShippMethod();
15
echo "<br/><strong>".$this->__('Costo: ');
16
echo Mage::helper('checkout')->formatPrice($data['total_shipping'])."</strong>";
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Payment_Reembolso</name>
4
- <version>0.2.1</version>
5
<stability>stable</stability>
6
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
<channel>community</channel>
@@ -11,14 +11,17 @@
11
12
EN | Refund allows users to set up refunds for all shipping methods installed in our Magento store. Refund determines the value the user must pay by using this payment method. For each refund you must enter a title, the refund shipping method, the refund type (either fixed or variable), the refund value and the amount from which the value applied to the total amount will be selected.</description>
13
<notes>&lt;b&gt;CHANGES:&lt;/b&gt;
14
- -&gt;U app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-install-0.1.0.php
15
- -&gt;A app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-install-0.2.1.php
16
- -&gt;A app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-upgrade-0.1.0-0.2.0.php
17
- -&gt;A app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-upgrade-0.2.0-0.2.1.php</notes>
18
- <authors><author><name>Sophie</name><user>auto-converted</user><email>lalyostres@gmail.com</email></author><author><name>Manuel</name><user>auto-converted</user><email>manuelcanepa@gmail.com</email></author><author><name>Gaspar Mac</name><user>auto-converted</user><email>gasparmac@gmail.com</email></author></authors>
19
- <date>2009-02-17</date>
20
- <time>09:04:10</time>
21
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="reembolso.xml" hash="c70542d55d3c5486dfe96d62d62b38c2"/></dir><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="a0299c5836ce66e8748328a918fdb1d8"/><file name="info.phtml" hash="308cfe38ecfbe667beee4618b40e6b33"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="aa973739122a483aca2ddfc6d1fd902f"/><file name="info.phtml" hash="28b00b8074bdf7cabed24d30911eb5b4"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Mage_Reembolso.csv" hash="42e01f656ee2d0223e95e10ed54b26ce"/></dir></target><target name="magelocal"><dir name="Mage"><dir name="Reembolso"><dir name="Block"><dir name="Adminhtml"><dir name="Reembolso"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="01a74473e969de469badea3afcc4d93c"/></dir><file name="Form.php" hash="a255a1faec8bd6827af597faa26ab479"/><file name="Tabs.php" hash="5cde7719cc092d44345454537eea652a"/></dir><file name="Edit.php" hash="48be62d8c1b09560fd5d876ee592b4e1"/><file name="Grid.php" hash="45e4cdff8d222d8f985f2975a064283a"/></dir><file name="Reembolso.php" hash="405131c5f3c12f61e6fde5089a030bc7"/></dir><file name="Form.php" hash="5374b819bbb8aa88127fda1122f7b2e8"/><file name="Info.php" hash="7bcb79c4df796dea63a2ac00ea991422"/><file name="Reembolso.php" hash="0db6644de2cfdc8dc7badb2cb8a84b23"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ReembolsoController.php" hash="36e1c31da302b55ae975a0aaf6c52b88"/></dir><file name="IndexController.php" hash="637815ee5aa7d6b9253ec713abfd559e"/></dir><dir name="etc"><file name="config.xml" hash="7219ef0085b511082dcbd0f2ed9896b7"/><file name="system.xml" hash="462888971106de537e8618190d352bac"/></dir><dir name="Helper"><file name="Data.php" hash="981e6afa35c5a3b2a2a93cd032dda366"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Reembolso.php" hash="094caad3d400d674dad90528eb3ef7ea"/><file name="Status.php" hash="738364aabca63cc0ab1227f372cbd1c0"/></dir><dir name="Mysql4"><dir name="Reembolso"><file name="Collection.php" hash="6be9cec7d9098472f1514bc0b3189035"/></dir><file name="Reembolso.php" hash="5e4d2cadd46fdf0e919f6402c78ed985"/></dir><file name="Quote.php" hash="49051c6e369921f1de5835b780a30da9"/><file name="Reembolso.php" hash="cca1fcd38fb94d55ec75f53646e8790c"/></dir><dir name="sql"><dir name="reembolso_setup"><file name="mysql4-install-0.1.0.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="mysql4-install-0.2.1.php" hash="66e352a38f890bce4c7173a1ce4c71e4"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="66e352a38f890bce4c7173a1ce4c71e4"/></dir></dir><file name="INFO-reembolso.txt" hash="d8d8daf56685ebca48267cb516abc198"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Reembolso.xml" hash="142e434873aea670fe99f6e83f35a44b"/></dir></target></contents>
22
<compatible/>
23
<dependencies/>
24
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Payment_Reembolso</name>
4
+ <version>0.2.2</version>
5
<stability>stable</stability>
6
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
<channel>community</channel>
11
12
EN | Refund allows users to set up refunds for all shipping methods installed in our Magento store. Refund determines the value the user must pay by using this payment method. For each refund you must enter a title, the refund shipping method, the refund type (either fixed or variable), the refund value and the amount from which the value applied to the total amount will be selected.</description>
13
<notes>&lt;b&gt;CHANGES:&lt;/b&gt;
14
+
15
+ -&gt;U app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso/Grid.php
16
+ -&gt;U app/code/local/Mage/Reembolso/Block/Adminhtml/Reembolso/Edit/Tab/Form.php
17
+ -&gt;U app/code/local/Mage/Reembolso/Model/Mysql4/Reembolso/Collection.php
18
+ -&gt;U app/code/local/Mage/Reembolso/Model/Reembolso.php
19
+ -&gt;A app/code/local/Mage/Reembolso/sql/reembolso_setup/mysql4-upgrade-0.2.1-0.2.2.php
20
+ -&gt;U app/design/frontend/default/default/template/reembolso/form.phtml</notes>
21
+ <authors><author><name>Sophie</name><user>auto-converted</user><email>lalyostres@gmail.com</email></author><author><name>Gaspar Mac</name><user>auto-converted</user><email>gasparmac@gmail.com</email></author></authors>
22
+ <date>2009-02-26</date>
23
+ <time>10:24:41</time>
24
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="reembolso.xml" hash="c70542d55d3c5486dfe96d62d62b38c2"/></dir><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="a0299c5836ce66e8748328a918fdb1d8"/><file name="info.phtml" hash="308cfe38ecfbe667beee4618b40e6b33"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="reembolso"><file name="form.phtml" hash="4a57aa7b2a37fc211d4058e836fff9e5"/><file name="info.phtml" hash="28b00b8074bdf7cabed24d30911eb5b4"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Mage_Reembolso.csv" hash="42e01f656ee2d0223e95e10ed54b26ce"/></dir></target><target name="magelocal"><dir name="Mage"><dir name="Reembolso"><dir name="Block"><dir name="Adminhtml"><dir name="Reembolso"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="73a9fcbe9e183cd9049203e828f325b0"/></dir><file name="Form.php" hash="a255a1faec8bd6827af597faa26ab479"/><file name="Tabs.php" hash="5cde7719cc092d44345454537eea652a"/></dir><file name="Edit.php" hash="48be62d8c1b09560fd5d876ee592b4e1"/><file name="Grid.php" hash="2290b35187430f08771fad011bcebc52"/></dir><file name="Reembolso.php" hash="4c1d115145a43091a8baf1acf2626795"/></dir><file name="Form.php" hash="21f1e325029d98571ec884bca2234e65"/><file name="Info.php" hash="33f48eab752f05362c553b63de5d9c42"/><file name="Reembolso.php" hash="1b73f115d184904b6b07c2274ff35e9b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ReembolsoController.php" hash="8724a1fb8ae96f1111807588386b45e2"/></dir><file name="IndexController.php" hash="637815ee5aa7d6b9253ec713abfd559e"/></dir><dir name="etc"><file name="config.xml" hash="7219ef0085b511082dcbd0f2ed9896b7"/><file name="system.xml" hash="462888971106de537e8618190d352bac"/></dir><dir name="Helper"><file name="Data.php" hash="981e6afa35c5a3b2a2a93cd032dda366"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Reembolso.php" hash="094caad3d400d674dad90528eb3ef7ea"/><file name="Status.php" hash="738364aabca63cc0ab1227f372cbd1c0"/></dir><dir name="Mysql4"><dir name="Reembolso"><file name="Collection.php" hash="0caca622db6de6629a5b956b43705820"/></dir><file name="Reembolso.php" hash="5e4d2cadd46fdf0e919f6402c78ed985"/></dir><file name="Quote.php" hash="49051c6e369921f1de5835b780a30da9"/><file name="Reembolso.php" hash="4dbbdf8944d9e6c47010dcafefa7a501"/></dir><dir name="sql"><dir name="reembolso_setup"><file name="mysql4-install-0.1.0.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="mysql4-install-0.2.1.php" hash="66e352a38f890bce4c7173a1ce4c71e4"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="66e352a38f890bce4c7173a1ce4c71e4"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="c3a18b3257c82bbe672b5240667d871b"/></dir></dir><file name="INFO-reembolso.txt" hash="d8d8daf56685ebca48267cb516abc198"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Reembolso.xml" hash="142e434873aea670fe99f6e83f35a44b"/></dir></target></contents>
25
<compatible/>
26
<dependencies/>
27
</package>