"Next"/"Previous" buttons on form view
I have a customer who uses a simple module for recording data that needs 3rd party verification. So, one person enters the data resulting in a big list of records. The 2nd person then logs in and checks each record and marks it as validated in the form view.
Is it possible to add "next" and "previous" buttons on the form view toolbar to speed up navigation?
Cheers
Comments
// make sure it's not a new record but one we are editing if (!empty($values['id'])) { $buttons = []; // Method you will need to implement to get next and previous IDs $prev_id = $this->get_prev($values['id']); $next_id = $this->get_next($values['id']); if ($prev_id) { $buttons[] = '<input type="button" value="Previous" id="previous" onclick="window.location="'.fuel_url('my_module/edit/'.$prev_id).'"/>'; } if ($next_id) { $buttons[] = '<input type="button" value="Next" id="previous" onclick="window.location="'.fuel_url('my_module/edit/'.$next).'"/>'; } if (!empty($buttons)) { $fields['__FORM_BUILDER__'] = array('other_actions' => implode(' ', $buttons)); } }
I guess the tricky bit would for the buttons to know what the sorting status of the list view was before they jumped into the form view.
https://github.com/daylightstudio/FUEL-CMS-Blog-Module/blob/master/libraries/Fuel_blog.php