0

In our website, I created a webform to allow users to ask for permission to purchase items; then, I created a view to show a table of records with the values in the fields contained in the webform submissions.

How can I add a custom button next to each record of the view to make our chief accountant able to authorize the requests, one by one?

I mean, clicking the custom button an e-mail should be sent to the authors of the requests notifying them they can proceed to buy the items they need, or eventually they can't, if only I could even add a Yes/No radio button besides the Authorize button.

1
  • Welcome to Drupal Answers! To get more helpful answers, the question should give more information about the built view. Without knowing what that view is showing and its settings, it's quite hard to give an answer that helps you.
    – apaderno
    Jun 17 at 8:50

1 Answer 1

0

Possibly another, simpler, approach might be to use VBO (views_bulk_operations) and a custom action. VBO will give you checkboxes beside each row of your view and then a button at the top/bottom of the view to run a single action "Authorize". That is the easy part. The tricky part is then to create a custom "action" which sends the email (with info from that record). Take a look under VBO's src/Plugins/Actions folder to see some example actions.

1
  • I don't know how to define a custom operation. The view shows a table with 5 fields: the list of items, corresponding list of prices, links to pro-forma invoices, time of submission and user id who submitted data. VBO shows only flag/star, unflag/unstar, lock, unlock and delete submissions, I just would like to add two radio buttons of type Yes/No and a "Confirm" submit button. I tried to use "Views union", "Business rules", but I don't have idea about how to implement an authorization cycle. Submission->Authorization->E-mail to user notifying if his/her request has been accepted or not.
    – pranick67
    Jun 22 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.