Comments

sun’s picture

Title: Will Feedback 2 be integrated with views 2 » Views integration
Category: support » feature
Status: Active » Postponed

Not yet.

However, I'm also not (yet) sure whether we will convert feedbacks into nodes, @see #351698: Use entities for Feedback messages

socialnicheguru’s picture

i was using case tracker but feedback is so convenient for giving feedback.

Edit- any progress on this front? This would alleviate the headache of creating your own view. You can leverage views so people can create custom views.

This could become a great ticketing/bug/feature request system.

Chris

glennpratt’s picture

StatusFileSize
new4.45 KB

Quick patch against 6.x-2.x-dev. Works against 2.0.

Leaving status as postponed until the other nodes issue is decided.

glennpratt’s picture

Rolled against 2.0 for those who need it.

glennpratt’s picture

Status: Postponed » Needs review

Haven't seen any progress on #351698: Use entities for Feedback messages.

This should be an easy change, even if there is a switch to nodes later. Switching to needs review.

msonnabaum’s picture

StatusFileSize
new4.4 KB

Re-rolled the patch against the latest release.

summit’s picture

Hi, will this be committed please?
thanks a lot in advance for considering, would be great to have views support.
greetings, Martijn

jody lynn’s picture

StatusFileSize
new13.37 KB

I expanded and fixed up the views integration and added a disabled default view to allow takeover of the Feedback messages report page.

It lacks the ability to use checkboxes to mark messages as 'processed'. So the next step is to create a VBO default view as well, which will tie into other open issues about actions/rules integrations and the ability to delete messages.

The basic views integration of all the data is complete though and ready for review.

_vid’s picture

Subscribing.
I'd like to create a view for administrators that I could use to replace the menu item for the report that displays the number of pending feedback messages, with tool-tip titles, like so:

Feedback (12)

_vid’s picture

I've been able to replace the menu item using the patch and a view with custom displays: attachment_1 and block_1.
Attachment_1 is pretty simple. Just a default argument of 1 for feedback: status and the only field is the global counter. It's not attached to anything, rather it just used for the query.

Block_1 has no arg and 1 field: custom text with blank text. In the header, type: php I added this code to capture the record count of the above query and use jquery to update the 'feedback messages' link to include the total number of active messages:

<?php
if(!function_exists('recordCount')){
 function recordCount($viewName,$displayName){
    $view = views_get_view($viewName);
    $view->execute_display($displayName);
    return count($view->result);
 }
}
/*get the record count:   */ 
$totalCount=recordCount('feedback','attachment_1');
$feedbackLinkOutput = '<a class="appended" title="Link to Feedback report" href="/admin/reports/feedback?&page=,0">Feedback messages</a> <a href="/admin/reports/feedback?&page=,0" title="There are '.$totalCount.' feedback messages pending.">('.$totalCount.')</a>';
$feedbackView_js = <<<JAVASCRIPT
Drupal.behaviors.feedbackView = function(context) {
 var theItem=$("#sidebar-left a:not(.appended):contains('Feedback messages')"); 
 if(theItem.length>0){
  theItem.parent().append('{$feedbackLinkOutput}'); theItem.remove(); 
 }
}
JAVASCRIPT;
drupal_add_js($feedbackView_js, 'inline');
?>

Then I put the block in the footer. Next up would be to roll this into a custom module but it worked, so I thought I'd share the code thus far.

jody lynn’s picture

This issue is on adding views integration not creating a specific view. This kind of view should be created by choosing 'show summary view' from the default argument settings.

jody lynn’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Assigned: Unassigned » jody lynn
Status: Needs review » Needs work
jody lynn’s picture

Status: Needs work » Needs review
StatusFileSize
new12.84 KB

Minor changes, and this is working fine on 7.x.

jody lynn’s picture

StatusFileSize
new128.44 KB
new20.78 KB

I rerolled it. The default view it provides overrides the feedback reports page using a view (see screenshot)

sun’s picture

Looks good - but how are we going to manage feedback messages? VBO?

jody lynn’s picture

Yeah, so I think the options are to add actions integration and VBO or to use flag (with or without actions integration, depending on whether we use the flag states themselves or continue to rely on the feedback module statuses).

A simpler option would be to just add a link to the full entry display to switch the entry between processed and open. That makes sense to have anyway, and I'm already adding a similar 'delete' link in another issue.

I think it still makes sense to push the views integration including the default view in the meantime without the ability to change the states because now that feedback is fieldable you have to have a customizable view in order to add your custom fields to the report.

tim.plunkett’s picture

Status: Needs review » Needs work

The default view needs some "No Results Behavior". Otherwise the page is completely empty when you first visit it after install, with no feedback yet.

I like the VBO idea, but either way this should probably wait on #323506: Allow to delete items, so that we can add a delete link to the default view.

jody lynn’s picture

Status: Needs work » Needs review
StatusFileSize
new25.93 KB

I added empty text and delete links and changed the views api requirement to 3.0.

sun’s picture

This looks good to me (though I'm not really familiar with the Views API, so need to rely on you guys here to do it properly).

However, final adjustment: I'd prefer to have all or most Views support files in a /views sub-directory. The more the better, though I'm not sure whether Views supports to move all. All I know is that you can simply specify 'path' in hook_views_api() to accomplish this.

sun’s picture

Status: Needs review » Fixed

Thanks for reporting, reviewing, and testing! Committed to 7.x-2.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Prior to commit, I disabled the default view by default.

Feel free to re-open this issue if you see problems or room for optimization.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

charos’s picture

Any chance for a D6 backport?