Skip to content

Commit 231fde2

Browse files
authored
Merge pull request #33 from firegento/develop
New Release
2 parents fa17ab8 + 3f81866 commit 231fde2

File tree

11 files changed

+139
-33
lines changed

11 files changed

+139
-33
lines changed

.travis.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
11
language: php
2+
sudo: false
23

34
php:
4-
- 5.3
55
- 5.4
66
- 5.5
7+
- 5.6
8+
- 7.0
79

810
env:
9-
- MAGENTO_VERSION="1.6.2.0"
10-
- MAGENTO_VERSION="1.7.0.2"
11-
- MAGENTO_VERSION="1.8.1.0"
12-
- MAGENTO_VERSION="1.9.0.1"
13-
- MAGENTO_VERSION="1.9.1.0"
11+
- MAGENTO_VERSION="magento-mirror-1.6.2.0"
12+
- MAGENTO_VERSION="magento-mirror-1.7.0.2"
13+
- MAGENTO_VERSION="magento-mirror-1.8.1.0"
14+
- MAGENTO_VERSION="magento-mirror-1.9.0.1"
15+
- MAGENTO_VERSION="magento-mirror-1.9.1.1"
16+
- MAGENTO_VERSION="magento-mirror-1.9.2.4"
17+
- MAGENTO_VERSION="magento-mirror-1.9.3.2"
1418

1519
matrix:
1620
fast_finish: true
1721
exclude:
22+
# Old Magento Versions are not officially supported to run with PHP 5.5
1823
- php: 5.5
19-
env: MAGENTO_VERSION="1.6.2.0"
24+
env: MAGENTO_VERSION="magento-mirror-1.6.2.0"
2025
- php: 5.5
21-
env: MAGENTO_VERSION="1.7.0.2"
26+
env: MAGENTO_VERSION="magento-mirror-1.7.0.2"
2227

23-
before_install:
24-
- mkdir test/
25-
- curl -sS https://getcomposer.org/installer | php
26-
- chmod +x ./composer.phar
27-
- ./composer.phar --version
28-
- ./composer.phar install --dev
28+
# Old Magento Versions are not officially supported to run with PHP 5.6
29+
- php: 5.6
30+
env: MAGENTO_VERSION="magento-mirror-1.6.2.0"
31+
- php: 5.6
32+
env: MAGENTO_VERSION="magento-mirror-1.7.0.2"
33+
- php: 5.6
34+
env: MAGENTO_VERSION="magento-mirror-1.8.1.0"
35+
- php: 5.6
36+
env: MAGENTO_VERSION="magento-mirror-1.9.0.1"
2937

30-
before_script:
31-
- CURR_DIR=$(pwd)
32-
- bin/mage-ci install test ${MAGENTO_VERSION} magento_test -c -t -r http://mage-ci.firegento.com
33-
- bin/mage-ci install-module test $CURR_DIR
34-
- git clone https://github.com/EcomDev/EcomDev_PHPUnit.git ./phpunit/
35-
- bin/mage-ci install-module $CURR_DIR/test $CURR_DIR/phpunit/
38+
# Old Magento Versions are not officially supported to run with PHP 7.0
39+
- php: 7.0
40+
env: MAGENTO_VERSION="magento-mirror-1.6.2.0"
41+
- php: 7.0
42+
env: MAGENTO_VERSION="magento-mirror-1.7.0.2"
43+
- php: 7.0
44+
env: MAGENTO_VERSION="magento-mirror-1.8.1.0"
45+
- php: 7.0
46+
env: MAGENTO_VERSION="magento-mirror-1.9.0.1"
3647

3748
script:
38-
- bin/mage-ci phpunit test
49+
- curl --retry 2 --retry-delay 5 -f -sSL https://raw.githubusercontent.com/therouv/MageTestStand/master/setup.sh | bash

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
"require": {
77
"magento-hackathon/magento-composer-installer": "*"
88
},
9-
"require-dev": {
10-
"ecomdev/mage-ci": "master-dev"
11-
},
129
"config": {
1310
"bin-dir": "bin"
1411
},
1512
"repositories": [
1613
{
1714
"type": "composer",
18-
"url": "http://packages.firegento.com"
15+
"url": "https://packages.firegento.com"
1916
}
2017
],
2118
"extra": {

src/app/code/community/FireGento/AdminMonitoring/Helper/Data.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,42 @@ class FireGento_AdminMonitoring_Helper_Data extends Mage_Core_Helper_Abstract
5050
const STATUS_SUCCESS = 1;
5151
const STATUS_FAILURE = 2;
5252

53+
/**
54+
* Retrieve status name from status id
55+
*
56+
* @param int $id Status id
57+
* @return string Status name
58+
*/
59+
public function statusIdToName($id)
60+
{
61+
switch ($id) {
62+
case self::STATUS_SUCCESS:
63+
return $this->__("Success");
64+
case self::STATUS_FAILURE:
65+
return $this->__("Fail");
66+
}
67+
}
68+
69+
/**
70+
* Retrieve action name from action id
71+
*
72+
* @param int $id Action id
73+
* @return string Action name
74+
*/
75+
public function actionIdToName($id)
76+
{
77+
switch ($id) {
78+
case self::ACTION_INSERT:
79+
return $this->__("Insert");
80+
case self::ACTION_UPDATE:
81+
return $this->__("Update");
82+
case self::ACTION_DELETE:
83+
return $this->__("Delete");
84+
case self::ACTION_LOGIN:
85+
return $this->__("Login");
86+
}
87+
}
88+
5389
/**
5490
* Checks if the given admin user id is excluded
5591
*

src/app/code/community/FireGento/AdminMonitoring/Model/History/Data.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public function getContent()
7070
}
7171
$model->load($this->_savedModel->getId());
7272

73+
Mage::dispatchEvent('firegento_adminmonitoring_enrich_model_content', ['object' => $model]);
74+
7375
return $this->_filterObligatoryFields($model->getData());
7476
}
7577

@@ -96,9 +98,11 @@ protected function _filterObligatoryFields($data)
9698
*/
9799
public function getOrigContent()
98100
{
99-
$data = $this->_savedModel->getOrigData();
101+
$data = new Varien_Object($this->_savedModel->getOrigData());
102+
103+
Mage::dispatchEvent('firegento_adminmonitoring_enrich_model_orig_content', ['data_object' => $data, 'model_object' => $this->_savedModel]);
100104

101-
return $this->_filterObligatoryFields($data);
105+
return $this->_filterObligatoryFields($data->getData());
102106
}
103107

104108
/**
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
class FireGento_AdminMonitoring_Model_Observer_Enrich_Content {
4+
5+
public function enrich(Varien_Event_Observer $observer)
6+
{
7+
$model = $observer->getObject();
8+
9+
if ($model instanceof Mage_Admin_Model_Roles) {
10+
$model->setResourcesList2D($model->getResourcesList2D());
11+
}
12+
13+
if ($model instanceof Mage_Admin_Model_User) {
14+
$model->setRoles($model->getRoles());
15+
}
16+
}
17+
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
class FireGento_AdminMonitoring_Model_Observer_Enrich_OrigContent {
4+
5+
public function enrich(Varien_Event_Observer $observer)
6+
{
7+
$data = $observer->getDataObject();
8+
$class = $observer->getModelObject();
9+
10+
if ($class instanceof Mage_Admin_Model_Roles) {
11+
$data->setResourcesList2D($class->getResourcesList2D());
12+
}
13+
14+
if ($class instanceof Mage_Admin_Model_User) {
15+
$data->setRoles($class->getRoles());
16+
}
17+
}
18+
19+
}

src/app/code/community/FireGento/AdminMonitoring/controllers/Adminhtml/HistoryController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FireGento_AdminMonitoring_Adminhtml_HistoryController extends Mage_Adminht
3636
protected function _initAction()
3737
{
3838
$this->loadLayout();
39-
$this->_setActiveMenu('firegento_adminmonitoring/history');
39+
$this->_setActiveMenu('system/history');
4040
$this->_addBreadcrumb(
4141
$this->getMonitoringHelper()->__('Admin Monitoring'),
4242
$this->getMonitoringHelper()->__('History')

src/app/code/community/FireGento/AdminMonitoring/etc/adminmonitoring.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
<excludes>
55
<object_types>
66
<Mage_Index_Model_Event/>
7-
<Mage_Admin_Model_User/>
87
<Enterprise_Logging_Model_Event_Changes/>
98
<Enterprise_Logging_Model_Event/>
109
<!-- omit infinite loops -->
11-
<FireGento_AdminMonitoring_Model_History/>
12-
<Mage_Oauth_Model_Nonce/>
10+
<FireGento_AdminMonitoring_Model_History/>
11+
<Mage_Oauth_Model_Nonce/>
1312
</object_types>
1413
<fields>
1514
<created_at/>

src/app/code/community/FireGento/AdminMonitoring/etc/config.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@
143143
</firegento_adminmonitoring>
144144
</observers>
145145
</firegento_adminmonitoring_log>
146+
<firegento_adminmonitoring_enrich_model_content>
147+
<observers>
148+
<firegento_adminmonitoring>
149+
<class>FireGento_AdminMonitoring_Model_Observer_Enrich_Content</class>
150+
<method>enrich</method>
151+
</firegento_adminmonitoring>
152+
</observers>
153+
</firegento_adminmonitoring_enrich_model_content>
154+
<firegento_adminmonitoring_enrich_model_orig_content>
155+
<observers>
156+
<firegento_adminmonitoring>
157+
<class>FireGento_AdminMonitoring_Model_Observer_Enrich_OrigContent</class>
158+
<method>enrich</method>
159+
</firegento_adminmonitoring>
160+
</observers>
161+
</firegento_adminmonitoring_enrich_model_orig_content>
146162
<admin_session_user_login_success>
147163
<observers>
148164
<firegento_adminmonitoring>

src/app/design/adminhtml/default/default/template/firegento/adminmonitoring/view.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@
7373
<tbody>
7474
<tr>
7575
<td class="label"><label><?php echo $this->__('Status') ?></label></td>
76-
<td class="value"><strong><?php echo $this->getHistory()->getData('status') ?></strong></td>
76+
<td class="value"><strong><?php echo Mage::helper('firegento_adminmonitoring')->statusIdToName($this->getHistory()->getData('status')) ?></strong></td>
7777
</tr>
7878
<tr>
7979
<td class="label"><label><?php echo $this->__('Action') ?></label></td>
80-
<td class="value"><strong><?php echo $this->getHistory()->getData('action') ?></strong></td>
80+
<td class="value"><strong><?php echo Mage::helper('firegento_adminmonitoring')->actionIdToName($this->getHistory()->getData('action')) ?></strong></td>
8181
</tr>
8282
<tr>
8383
<td class="label"><label><?php echo $this->__('Object Type') ?></label></td>

0 commit comments

Comments
 (0)