Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Manager Log by adding a filter for class key and item #13005

Merged
merged 5 commits into from Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/model/modx/processors/system/log/getlist.class.php
Expand Up @@ -59,6 +59,8 @@ public function process() {
*/
public function getData() {
$actionType = $this->getProperty('actionType');
$classKey = $this->getProperty('classKey');
$item = $this->getProperty('item');
$user = $this->getProperty('user');
$dateStart = $this->getProperty('dateStart');
$dateEnd = $this->getProperty('dateEnd');
Expand All @@ -69,6 +71,8 @@ public function getData() {
/* check filters */
$wa = array();
if (!empty($actionType)) { $wa['action:LIKE'] = '%'.$actionType.'%'; }
if (!empty($classKey)) { $wa['classKey:LIKE'] = '%'.$classKey.'%'; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have to be a LIKE? Are there situations where the class key isn't exactly what was chosen?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe to search snippet instead of modSnippet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Jako said, also just keeping with the same search standards of the other fields

if (!empty($item)) { $wa['item:LIKE'] = '%'.$item.'%'; }
if (!empty($user)) { $wa['user'] = $user; }
if (!empty($dateStart)) {
$dateStart = strftime('%Y-%m-%d',strtotime($dateStart.' 00:00:00'));
Expand Down
18 changes: 18 additions & 0 deletions manager/assets/modext/widgets/system/modx.grid.manager.log.js
Expand Up @@ -130,6 +130,15 @@ MODx.panel.ManagerLog = function(config) {
'change': {fn: this.filter, scope: this}
,'render': {fn:this._addEnterKeyHandler}
}
},{
xtype: 'textfield'
,fieldLabel: _('class_key')
,name: 'classKey'
,anchor: '100%'
,listeners: {
'change': {fn: this.filter, scope: this}
,'render': {fn:this._addEnterKeyHandler}
}
}]
},{
columnWidth: .5
Expand All @@ -153,6 +162,15 @@ MODx.panel.ManagerLog = function(config) {
'select': {fn: this.filter, scope: this}
,'render': {fn:this._addEnterKeyHandler}
}
},{
xtype: 'textfield'
,fieldLabel: _('id')
,name: 'item'
,anchor: '100%'
,listeners: {
'change': {fn: this.filter, scope: this}
,'render': {fn:this._addEnterKeyHandler}
}
}]
}]
}]
Expand Down