Help with Save + Next button

istu233

New member
Hi!
I'm trying to create a new button for edit mode, which saves the current entry, and then opens the next one.
Problem is: I can't figure out how to do the saving part, and can't find the code for the built-in save button.
Any help would be appreciated, here's my code:

// Shifts fact edit mode - update + next button
$custom_buttons['shifts_fact'][$cnt]['type'] = 'php_standard';
$custom_buttons['shifts_fact'][$cnt]['callback_function'] = 'dadabik_update_and_next';
$custom_buttons['shifts_fact'][$cnt]['permission_needed'] = 'edit';
$custom_buttons['shifts_fact'][$cnt]['show_in'][] = 'edit_form';
$custom_buttons['shifts_fact'][$cnt]['position_form'] = 'top';
$custom_buttons['shifts_fact'][$cnt]['label_type'] = 'fixed';
$custom_buttons['shifts_fact'][$cnt]['label'] = 'Mentés + következő';
$custom_buttons['shifts_fact'][$cnt]['style'] = 'background:#008080;width:170px';
$cnt++;

function dadabik_update_and_next($table_name, $where_field, $where_value) {

global $conn, $dadabik_main_file;

// let's go back to the results grid
header('Location:'.$dadabik_main_file.'?tablename='.urlencode($table_name).'&function=edit&where_field='.urlencode($where_field).'&where_value='.urlencode($where_value+1));

exit;
}

Thanks, István!
---------------------------------------------

Your current DaDaBIK version​



You are using DaDaBIK version 11.9-Elba platinum, installed on 2023-05-17 17:04:26, the latest version of DaDaBIK is 11.9-Elba released on 2023-03-23

You are running the latest release of DaDaBIK

System info​

PHP Version: 7.3.17

postgres version: 12.3

Web server: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.3.17

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
 
Last edited:
Top