just happily installed signup-7.x and the latest views and VBO, but noted cant get signup's actions into my VBO dropdown select. is it possible yet or is some work required still?

Comments

jerenus’s picture

Good idea. I think that would be useful for the support of views and VBO in the future. Can you give us more information about your further ideas? We can discuss it here.

dkane’s picture

I too would love to see some signup functions incorporated into VBO. If I recall most of the functionality was available in 6.x - it just seems to have gotten lost in the port to 7.x as the ways VBO handles operations has changed. When you bring up the VBO admin view it says its trying to use a missing format, which seems to me like its looking for the old Views Bulk Operations Table display type. So maybe we just need to expose that functionality to the new bulk operations field? Granted I'm not a programmer, so that may be easier said than done.

Ideally the functionality I'd like to include would be:

Mark User as Attended
Mark User as Did Not Attend
Sign up user
Cancel Signup

I'm sure there are more that others would like to see as well, but these are the 4 that I am currently missing for my site. At the moment I am trying to build a work around by triggering rules with VBO that will do this - however I am having trouble figuring out the correct order of operations to do this with rules as it seems signup keeps looking for a signup data object, and I'm not quite sure what that is or how to use it effectively, although I believe that is a conversation for the signup_rules page.

Many thanks for this fantastic module and your upkeep of it. It is a crucial player in my site, and I am much appreciative of your hard work.

bhosmer’s picture

Issue summary: View changes

I came across this issue recently, and wanted to add some notes:

In views/default_views/signup_user_vbo_admin_list.view.php on line 121:

$handler->override_option('style_plugin', 'bulk');

it is obsolete in the way that Bulk Operations works now.

I changed it to:

$handler->override_option('style_plugin', 'table');

And I can load the view fine now.

This makes the "missing plugin" error go away, but really solves nothing in enabling bulk operations on attendance.

I started following the Handbook Page for VBO and hacked together a mockup in the signup.module.

It looks like we'll need a new bulk action, and an update to the signup_log table with some joins to update all users signed up to a particular nid.

Maintainers:

Do you have any thoughts or ideas with implementing this and updating this issue?

bhosmer’s picture

Category: Support request » Feature request

I'm updating this to a feature request, since the current module doesn't seem to support VBO just yet.

bhosmer’s picture

Assigned: Unassigned » bhosmer
Status: Active » Patch (to be ported)
StatusFileSize
new19.27 KB
sgabe’s picture

Status: Patch (to be ported) » Needs work

First of all, thank you for contributing! I just took a quick look on the patch and noticed some issues with the code in general.

  1. +++ b/signup.module
    @@ -968,7 +968,52 @@ function signup_action_info() {
    +    'signup_bulk_mark_not_attended_action' => array(                           ¶
    

    Please, watch out for trailing whitespaces.

  2. +++ b/signup.module
    @@ -1028,23 +1073,75 @@ function signup_mark_not_attended_action(&$signup) {
    -  watchdog('action', 'Marked signup @signup_id did not attend.', array('@signup_id' => $signup->sid));
    +  //watchdog('action', 'Marked signup @signup_id did not attend.', array('@signup_id' => $signup->sid));
    +  watchdog('action', 'single did');
    

    This modification of the watchdog entry seems unnecessary.

  3. +++ b/signup.module
    @@ -1028,23 +1073,75 @@ function signup_mark_not_attended_action(&$signup) {
    + * @param stdClass $node
    

    Use object, NOT "stdClass".

  4. +++ b/signup.module
    @@ -1028,23 +1073,75 @@ function signup_mark_not_attended_action(&$signup) {
    + * @return none
    

    Functions without return values must not have @return documentation.

You can read about the code formatting requirements (and much more) in the Coding standards, especially in the Documentation and comment standrads section.

bhosmer’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new18.51 KB

Thanks for catching those typos.

spelcheck’s picture

Had to change $context['rows']->sid to reset($context['rows'])->sid in the bulk view functions because $context['rows'] contained each result in a separate numbered array. reset() shows the first (and only) row array for each iteration of the functions. Also, I remember it appeared some of the original cancel, attending and not-attending functions were using FALSE and TRUE to write to the signup_log table, which had to be changed to numeric 0 and 1 respectively. Sorry I don't have time to supply a patch.

function signup_bulk_mark_not_attended_action(&$node, $context) {
  db_update('signup_log')
    ->fields(array(
    'attended' => 0,
  ))
  ->condition('sid', reset($context['rows'])->sid)
  ->condition('nid', $node->nid)
  ->execute();
  $signup->attended = 0;
  watchdog('action', 'Marked signup @signup_id not attended.', array('@signup_id' => reset($context['rows'])->sid));
}

function signup_bulk_mark_attended_action(&$node, $context) {
  // TODO Please review the conversion of this statement to the D7 database API syntax.
  /* db_query("UPDATE {signup_log} SET attended = %d WHERE sid = %d", TRUE, $signup->sid) */
  db_update('signup_log')
  ->fields(array(
    'attended' => 1,
  ))
  ->condition('sid', reset($context['rows'])->sid)
  ->condition('nid', $node->nid)
  ->execute();
  $signup->attended = 1;
  watchdog('action', 'Marked signup @signup_id attended.', array('@signup_id' => reset($context['rows'])->sid));
}

function signup_bulk_cancel_action(&$node, $context) {
  signup_cancel_signup(reset($context['rows'])->sid);
  watchdog('action', 'Canceled signup @signup_id.', array('@signup_id' => reset($context['rows'])->sid));
}