1

I am working with drupal 7 webform submission results. I would like to integrate 2 features to webform submission results rows. One of them is adding a checkbox on individual rows for selecting multiple submissions and printing all these selected submissions on paper at the same time, second feature is adding another checkbox to archive multiple submissions. (I try to use webform2pdf and webform_archive but they didn't work for solution)

I kind of know that I need to use hook_preprocess_hook, but I would like to listen some approaches or recommendations. Something like this(stolen from webform2pdf module):

function webformpdf2_preprocess_webform_results_submissions(&$vars) {
  $rows =& $vars['table']['#rows'];
  $i = 0;
  $table_row_keys = array_keys($vars['table']['#rows']);
  foreach ($vars['submissions'] as $sid => $submission) {
    if (webform2pdf_enabled_pdf_access($vars['node'], 'webform_submission_access', $vars['node'], $submission, 'view')) {
    $rows[$table_row_keys[$i]][] = l(t('Download PDF'), 'node/' . $submission->nid . '/submission/' . $submission->sid . '/downloadpdf');
   }
   else {
   $rows[$table_row_keys[$i]][] = '';
   }
   $i++;
}

 $header_keys = array_keys($vars['table']['#header']);
 $last_header_key = array_pop($header_keys);
 $vars['table']['#operation_total'] += 1;
 $vars['table']['#header'][$last_header_key]['colspan'] =$vars['table']['#header'][$last_header_key]['colspan']+ 1;
}

I played around with this block code i just couldn't create the checkboxes. Thanks for your help and attention.

0

Your Answer

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

Browse other questions tagged or ask your own question.