Skip to content

Commit 77ef813

Browse files
authored
Merge pull request #31 from MagsSwe/develop
Show status/action name instead of id in detailed view.
2 parents a4501fa + ae50fe8 commit 77ef813

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

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/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>

src/app/locale/de_DE/FireGento_AdminMonitoring.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@
3131
"Exclude admin users","Admin-Benutzer ausschließen"
3232
"No admin user","Kein Admin-Benutzer"
3333
"The logging will be disabled for the admin users selected in this config setting.","Das Logging wird für die ausgewählten Benutzer in dieser Einstellung deaktiviert."
34+
"Insert","Insert"
35+
"Update","Update"
36+
"Delete","Delete"
37+
"Login","Login"
38+
"Success","Success"
39+
"Fail","Fail"

0 commit comments

Comments
 (0)