DigitalPianism_ReportsViewer - Version 0.1.1

Version Notes

- Improve the module in order to remove useless files and make the module lighter in terms of number of files

Download this release

Release Info

Developer Digital Pianism
Extension DigitalPianism_ReportsViewer
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/community/DigitalPianism/ReportsViewer/Block/Adminhtml/Reportsviewer.php CHANGED
@@ -3,27 +3,18 @@
3
  /**
4
  * Class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer
5
  */
6
- class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer extends Mage_Adminhtml_Block_Template
7
  {
8
  /**
9
- * Block's template
10
- *
11
- * @var string
12
  */
13
- protected $_template = 'digitalpianism/reportsviewer/list.phtml';
14
-
15
- protected function _prepareLayout()
16
- {
17
- parent::_prepareLayout();
18
-
19
- $this->setChild('reportsviewerGrid',
20
- $this->getLayout()->createBlock('reportsviewer/adminhtml_reportsviewer_grid')
21
- );
22
- }
23
-
24
- public function getGridHtml()
25
  {
26
- return $this->getChildHtml('reportsviewerGrid');
 
 
 
 
27
  }
28
 
29
  }
3
  /**
4
  * Class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer
5
  */
6
+ class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer extends Mage_Adminhtml_Block_Widget_Grid_Container
7
  {
8
  /**
9
+ * Constructor
 
 
10
  */
11
+ public function __construct()
 
 
 
 
 
 
 
 
 
 
 
12
  {
13
+ $this->_controller = 'adminhtml_reportsviewer';
14
+ $this->_blockGroup = 'reportsviewer';
15
+ $this->_headerText = Mage::helper('reportsviewer')->__('Reports Viewer');
16
+ parent::__construct();
17
+ $this->_removeButton('add');
18
  }
19
 
20
  }
app/code/community/DigitalPianism/ReportsViewer/Block/Adminhtml/Reportsviewer/{View.php → Edit.php} RENAMED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /**
4
- * Class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_View
5
  * This is the view page parent block
6
  */
7
- class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_View extends Mage_Adminhtml_Block_Widget_Form_Container
8
  {
9
  /**
10
  * Constructor for the Edit page
@@ -15,24 +15,11 @@ class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_View extends Ma
15
  $this->_objectId = 'id';
16
  $this->_blockGroup = 'reportsviewer';
17
  $this->_controller = 'adminhtml_reportsviewer';
18
- $this->_mode = 'view';
19
  $this->_updateButton('delete', 'label', Mage::helper('reportsviewer')->__('Delete Report File'));
20
  // Remove the save button as we do not deal with editable data
21
  $this->_removeButton('save');
22
  }
23
 
24
- /**
25
- * @return mixed
26
- */
27
- protected function _prepareLayout()
28
- {
29
- if ($this->_blockGroup && $this->_controller && $this->_mode) {
30
- // Here we set the form block
31
- $this->setChild('form', $this->getLayout()->createBlock('reportsviewer/adminhtml_reportsviewer_view_form'));
32
- }
33
- return parent::_prepareLayout();
34
- }
35
-
36
  /**
37
  * Getter for the header text
38
  */
1
  <?php
2
 
3
  /**
4
+ * Class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_Edit
5
  * This is the view page parent block
6
  */
7
+ class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
8
  {
9
  /**
10
  * Constructor for the Edit page
15
  $this->_objectId = 'id';
16
  $this->_blockGroup = 'reportsviewer';
17
  $this->_controller = 'adminhtml_reportsviewer';
 
18
  $this->_updateButton('delete', 'label', Mage::helper('reportsviewer')->__('Delete Report File'));
19
  // Remove the save button as we do not deal with editable data
20
  $this->_removeButton('save');
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Getter for the header text
25
  */
app/code/community/DigitalPianism/ReportsViewer/Block/Adminhtml/Reportsviewer/{View → Edit}/Form.php RENAMED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /**
4
- * Class DigitalPianism_ReportsViewer_Block_Adminhtml_Reportsviewer_View_Form
5
  * This is the form block to view the report data
6
  */
7
- class DigitalPianism_ReportsViewer_Block_Adminhtml_Reportsviewer_View_Form extends Mage_Adminhtml_Block_Widget_Form
8
  {
9
  /**
10
  * Prepare the form of the edit reportsviewer page
1
  <?php
2
 
3
  /**
4
+ * Class DigitalPianism_ReportsViewer_Block_Adminhtml_Reportsviewer_Edit_Form
5
  * This is the form block to view the report data
6
  */
7
+ class DigitalPianism_ReportsViewer_Block_Adminhtml_Reportsviewer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
8
  {
9
  /**
10
  * Prepare the form of the edit reportsviewer page
app/code/community/DigitalPianism/ReportsViewer/Block/Adminhtml/Reportsviewer/Grid.php CHANGED
@@ -9,11 +9,12 @@ class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_Grid extends Ma
9
  /**
10
  * Constructor the grid
11
  */
12
- public function _construct()
13
  {
14
- $this->setSaveParametersInSession(true);
15
  $this->setId('reportsviewerGrid');
16
  $this->setDefaultSort('added','DESC');
 
17
  }
18
 
19
  /**
@@ -119,7 +120,7 @@ class DigitalPianism_Reportsviewer_Block_Adminhtml_Reportsviewer_Grid extends Ma
119
  */
120
  public function getRowUrl($row)
121
  {
122
- return $this->getUrl('*/*/view', array('id' => $row->getData('report_id')));
123
  }
124
 
125
  }
9
  /**
10
  * Constructor the grid
11
  */
12
+ public function __construct()
13
  {
14
+ parent::__construct();
15
  $this->setId('reportsviewerGrid');
16
  $this->setDefaultSort('added','DESC');
17
+ $this->setSaveParametersInSession(true);
18
  }
19
 
20
  /**
120
  */
121
  public function getRowUrl($row)
122
  {
123
+ return $this->getUrl('*/*/edit', array('id' => $row->getData('report_id')));
124
  }
125
 
126
  }
app/code/community/DigitalPianism/ReportsViewer/Block/Adminhtml/Template/Grid/Renderer/Action.php CHANGED
@@ -18,7 +18,7 @@ class DigitalPianism_ReportsViewer_Block_Adminhtml_Template_Grid_Renderer_Action
18
  // for href actions
19
  $actions[] = array(
20
  '@' => array(
21
- 'href' => $this->getUrl("*/*/view", array('id' => $row->getData('report_id')))
22
  ),
23
  '#' => Mage::helper('reportsviewer')->__('View Details')
24
  );
18
  // for href actions
19
  $actions[] = array(
20
  '@' => array(
21
+ 'href' => $this->getUrl("*/*/edit", array('id' => $row->getData('report_id')))
22
  ),
23
  '#' => Mage::helper('reportsviewer')->__('View Details')
24
  );
app/code/community/DigitalPianism/ReportsViewer/controllers/Adminhtml/ReportsviewerController.php CHANGED
@@ -113,7 +113,7 @@ class DigitalPianism_ReportsViewer_Adminhtml_ReportsviewerController extends Mag
113
  /**
114
  * This is the action used to view the details of a report
115
  */
116
- public function viewAction()
117
  {
118
  // We first retrieve the report ID
119
  $id = $this->getRequest()->getParam('id');
@@ -132,7 +132,7 @@ class DigitalPianism_ReportsViewer_Adminhtml_ReportsviewerController extends Mag
132
 
133
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
134
 
135
- $this->_addContent($this->getLayout()->createBlock('reportsviewer/adminhtml_reportsviewer_view'));
136
 
137
  $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
138
 
113
  /**
114
  * This is the action used to view the details of a report
115
  */
116
+ public function editAction()
117
  {
118
  // We first retrieve the report ID
119
  $id = $this->getRequest()->getParam('id');
132
 
133
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
134
 
135
+ $this->_addContent($this->getLayout()->createBlock('reportsviewer/adminhtml_reportsviewer_edit'));
136
 
137
  $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
138
 
app/code/community/DigitalPianism/ReportsViewer/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <DigitalPianism_ReportsViewer>
5
- <version>0.1.0</version>
6
  </DigitalPianism_ReportsViewer>
7
  </modules>
8
 
@@ -19,17 +19,6 @@
19
  </routers>
20
  </admin>
21
 
22
- <adminhtml>
23
- <layout>
24
- <updates>
25
- <!-- Backend layout update -->
26
- <reportsviewer module="DigitalPianism_ReportsViewer">
27
- <file>digitalpianism/reportsviewer.xml</file>
28
- </reportsviewer>
29
- </updates>
30
- </layout>
31
- </adminhtml>
32
-
33
  <global>
34
  <models>
35
  <!-- Model declaration -->
2
  <config>
3
  <modules>
4
  <DigitalPianism_ReportsViewer>
5
+ <version>0.1.1</version>
6
  </DigitalPianism_ReportsViewer>
7
  </modules>
8
 
19
  </routers>
20
  </admin>
21
 
 
 
 
 
 
 
 
 
 
 
 
22
  <global>
23
  <models>
24
  <!-- Model declaration -->
app/design/adminhtml/default/default/layout/digitalpianism/reportsviewer.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
- <!-- View handle -->
4
- <reportsviewer_admin_adminhtml_reportsviewer_view>
5
- <update handle="editor" />
6
- </reportsviewer_admin_adminhtml_reportsviewer_view>
7
- </layout>
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/digitalpianism/reportsviewer/list.phtml DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- /**
3
- * This is the grid template that displays the list of reports
4
- */
5
- ?>
6
- <div class="content-header">
7
- <table cellspacing="0">
8
- <tr>
9
- <td><h3 class="icon-head head-reportsviewer"><?php echo Mage::helper('reportsviewer')->__('Reports Viewer') ?></h3></td>
10
- </tr>
11
- </table>
12
- </div>
13
- <?php echo $this->getGridHtml() ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>DigitalPianism_ReportsViewer</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -32,11 +32,11 @@
32
  &lt;p&gt;The only data not included in the grid is the trace.&lt;/p&gt;&#xD;
33
  &lt;p&gt;So when you click the "view details" link or if you click directly on the row, you will get access to a page that displays all the data of the grid PLUS the trace of the report.&lt;/p&gt;&#xD;
34
  &lt;p&gt;From this page, you can also delete a report.&lt;/p&gt;</description>
35
- <notes>- Improve the module by using a custom collection to be able to filter, sort and change the limit of the grid.</notes>
36
  <authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
37
- <date>2015-09-17</date>
38
- <time>10:33:45</time>
39
- <contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="ReportsViewer"><dir name="Block"><dir name="Adminhtml"><dir name="Reportsviewer"><file name="Grid.php" hash="e9655334d95023c571172a26a504ca77"/><dir name="View"><file name="Form.php" hash="a8ababaf7401b1c294685eb483327c72"/></dir><file name="View.php" hash="c234f392f8c3d030d27740ba8036715e"/></dir><file name="Reportsviewer.php" hash="dafd160401e4ccd6b3a724199b53cc31"/><dir name="Template"><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="ab39437238ad1c8e22f8dd3746865679"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f935bdafe07317db7f3ca3e29f5daabd"/></dir><dir name="Model"><file name="Report.php" hash="6a127d94d02c50463dc3836d7faf2628"/><dir name="Reports"><file name="Collection.php" hash="f331931709f211467faf7351221f00c8"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ReportsviewerController.php" hash="29769722164e5fe17a0448a57068fdda"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b460c9d10c922c26c1bbf121933992a5"/><file name="config.xml" hash="df4cabc3fd37a939dacda036bf3b5fb2"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_ReportsViewer.xml" hash="bc4370b8f8905113dcf26afbbbd062c6"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="digitalpianism"><file name="reportsviewer.xml" hash="79f624cf29d2c203ff48a1634f081ceb"/></dir></dir><dir name="template"><dir name="digitalpianism"><dir name="reportsviewer"><file name="list.phtml" hash="5fab98e4c9239730200be43f40a49ca1"/></dir></dir></dir></dir></dir></dir></target></contents>
40
  <compatible/>
41
  <dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
42
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>DigitalPianism_ReportsViewer</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
32
  &lt;p&gt;The only data not included in the grid is the trace.&lt;/p&gt;&#xD;
33
  &lt;p&gt;So when you click the "view details" link or if you click directly on the row, you will get access to a page that displays all the data of the grid PLUS the trace of the report.&lt;/p&gt;&#xD;
34
  &lt;p&gt;From this page, you can also delete a report.&lt;/p&gt;</description>
35
+ <notes>- Improve the module in order to remove useless files and make the module lighter in terms of number of files</notes>
36
  <authors><author><name>Digital Pianism</name><user>digitalpianism</user><email>contact@digital-pianism.com</email></author></authors>
37
+ <date>2015-10-06</date>
38
+ <time>15:13:22</time>
39
+ <contents><target name="magecommunity"><dir name="DigitalPianism"><dir name="ReportsViewer"><dir name="Block"><dir name="Adminhtml"><dir name="Reportsviewer"><dir name="Edit"><file name="Form.php" hash="bc942115a68e06b8d55070acebe1ae30"/></dir><file name="Edit.php" hash="f663f46b866cab890d5e65bf518b9cd6"/><file name="Grid.php" hash="171701c72a3e79be881a3da5cd329330"/></dir><file name="Reportsviewer.php" hash="435ba2d5670972469abf33bf4a56c18b"/><dir name="Template"><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="9b199863366e23c861f8db6c678da774"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f935bdafe07317db7f3ca3e29f5daabd"/></dir><dir name="Model"><file name="Report.php" hash="6a127d94d02c50463dc3836d7faf2628"/><dir name="Reports"><file name="Collection.php" hash="f331931709f211467faf7351221f00c8"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ReportsviewerController.php" hash="1e80c6df64e895030eb8ab3ef3d1ef2c"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b460c9d10c922c26c1bbf121933992a5"/><file name="config.xml" hash="54049e98e6c9701dff37eab72a015fa0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DigitalPianism_ReportsViewer.xml" hash="bc4370b8f8905113dcf26afbbbd062c6"/></dir></target></contents>
40
  <compatible/>
41
  <dependencies><required><php><min>4.1.0</min><max>6.0.0</max></php></required></dependencies>
42
  </package>