0

I'm using the Flag module to make a list of items that a user would like more information on. The user flags each node and those are added to a flag list. I would like to allow the user to submit this list to the admin user somehow but have not yet found a way of doing so. I'm using Drupal 7.

Thanks kindly in advance!

2
  • do you want the user to actually click a submit button to send the list or just have the admin notified everytime someone flags one of those nodes?
    – 7wonders
    Commented Jan 17, 2012 at 13:37
  • I basically want the user to be able to "submit" their list rather than the admin being notified when a node is flagged. They would flag a number of resources and then go to a form to submit the request. It could either be an email containing the items flagged or possibly a link to the list.
    – user1731
    Commented Jan 17, 2012 at 23:11

4 Answers 4

2

I actually think you are trying to make this too complicated based on your feedback. The simplest way in my mind would be to have a view (using current userid as a contextual filter) that displays the items the user has flagged. This opens up a lot of nice possibilities such as being able to remove flags before submitting, sort, filter, table view etc etc. Then quite simply have a button in the view header/footer that "submits/emails" the view url and user id to the admin. The admin can have the same view just with an extra box for userid (or exposed filter or whatever you want).

1

I have a custom solution I'd be filling to share, basically an anonymous wishlist. Using views, flag, webform, and the following hook in a little custom module.

<?php
function webform_hook_user_flag_sample_requests() {
   $view = views_get_view('webform_flag_views', TRUE);
   $view->set_display('webform_options');
   $view->execute();
   $options = array();
   if ($view->result) {
     $row_class = $view->style_options['row_class'];
     $attributes = $row_class ? " class='$row_class'" : '';
     foreach($view->result as $item) {
       $options[$item->product_id] = '<a' . $attributes . '>' . render($item->field_field_image[0]['rendered']) . ' ' . $item->field_title . ' (' . $item->commerce_product_title . ')' . '</a>';
     }
   }
   else {
     $options[0] = t("Nothing");
   }
   return $options;
 }
 function webform_hook_user_flag_sample_requests() {
   $view = views_get_view('webform_flag_views', TRUE);
   $view->set_display('webform_options');
   $view->execute();
   $options = array();
  foreach($view->result as $item){
      $options[$item->product_id]= $item->field_field_image[0]['rendered'];
      } 
return $options;

Alternatively, there's also this solution: http://drupalsteve.com/node/57, which I'm working on implementing for myself.

1
  • FYI: I didn't but I was tempted to down vote this answer. You should provide your answer here and use links to support your answer, not vice versa.
    – Screenack
    Commented Aug 4, 2015 at 16:40
0

This will almost definitely require the use of the Rules module.

Using Rules, you can set up an event to fire after a user Flags an item. You can also set a condition to not do anything further until a certain count has been reached, like 5 flags for example.

Using that event and condition, you can then set an action to send an email to users in the Admin role notifying them of the list of Flags. Perhaps you can create a special page with Views, which displays the list of items which has been flagged, for easy viewing by your admins.

2
  • 2
    I've had a suggestion from someone using the Webform module and then adding a hook to grab the items flagged. I'll update this when I have a complete solution.
    – user1731
    Commented Jan 17, 2012 at 23:34
  • If you would like to learn more about the rules module, there is a great tutorial here - dev.nodeone.se/en/blog/taming-the-butler-learning-rules Good Luck! Commented Feb 17, 2012 at 5:28
0

I think it would be better to let the users to Bookmark nodes and add them to folders. Then they can share the folder with the admin. You can use Bookmark Organizer Module for this.

Bookmark Organizer extends Flag module by providing functionality to

  1. arrange bookmarks by drag and drop them
  2. create folders and place bookmarks into them
  3. rename bookmarks and folders
  4. show previews about bookmarks and contents of a folder
  5. publish bookmarks stored in a folder to others

Bookmarks are always user related. However, a user who has access to 'administer users' can edit other users' bookmarks as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.