wildmanmatt
New member
Hi,
I am trying to create a custom button that will generate a PDF from an existing template.
I already have the PDF template working via the PDF button and dropdown. The template file is called Card.php (and the associated Card_settings.php
I have added the following settings to my settings_custom.php:
$parse_pdf_php_template_even_if_export_pdf_disable = 1;
$enable_custom_button_functions = 1;
$export_to_pdf_feature = 1;
I have added the following to custom_buttons.php:
$cnt = 1;
$custom_buttons['cardprint'][$cnt]['type'] = 'javascript';
$custom_buttons['cardprint'][$cnt]['callback_function'] = 'dadabik_card_print';
$custom_buttons['cardprint'][$cnt]['permission_needed'] = 'none';
$custom_buttons['cardprint'][$cnt]['show_in'][] = 'edit_form';
$custom_buttons['cardprint'][$cnt]['show_in'][] = 'details_page';
$custom_buttons['cardprint'][$cnt]['position_form'] = 'top';
$custom_buttons['cardprint'][$cnt]['label_type'] = 'fixed';
$custom_buttons['cardprint'][$cnt]['label'] = 'PRINT Card';
$custom_buttons['cardprint'][$cnt]['style'] = 'background:#2e4472;width:200px';
$cnt++;
I have tried the following code in custom_functions.js :
function dadabik_diverlog_card_print($table_name, $where_field, $where_value)
{
header('Location:index.php?tablename=membersdatabase&function=search&export_to_pdf=1&pdf_template=Card');
exit();
}
I did also try putting that code in custom_required_functions.php and changing the button type to 'php_standard', but that didn't work either.
The button isn't even showing up for me on the edit view or the record details view.
I'm not sure what I'm doing wrong?
I tried to follow the manual and also the information from this post: https://dadabik.com/forum/read.php?1,20784,20786#msg-20786
Thanks,
Matt
I am trying to create a custom button that will generate a PDF from an existing template.
I already have the PDF template working via the PDF button and dropdown. The template file is called Card.php (and the associated Card_settings.php
I have added the following settings to my settings_custom.php:
$parse_pdf_php_template_even_if_export_pdf_disable = 1;
$enable_custom_button_functions = 1;
$export_to_pdf_feature = 1;
I have added the following to custom_buttons.php:
$cnt = 1;
$custom_buttons['cardprint'][$cnt]['type'] = 'javascript';
$custom_buttons['cardprint'][$cnt]['callback_function'] = 'dadabik_card_print';
$custom_buttons['cardprint'][$cnt]['permission_needed'] = 'none';
$custom_buttons['cardprint'][$cnt]['show_in'][] = 'edit_form';
$custom_buttons['cardprint'][$cnt]['show_in'][] = 'details_page';
$custom_buttons['cardprint'][$cnt]['position_form'] = 'top';
$custom_buttons['cardprint'][$cnt]['label_type'] = 'fixed';
$custom_buttons['cardprint'][$cnt]['label'] = 'PRINT Card';
$custom_buttons['cardprint'][$cnt]['style'] = 'background:#2e4472;width:200px';
$cnt++;
I have tried the following code in custom_functions.js :
function dadabik_diverlog_card_print($table_name, $where_field, $where_value)
{
header('Location:index.php?tablename=membersdatabase&function=search&export_to_pdf=1&pdf_template=Card');
exit();
}
I did also try putting that code in custom_required_functions.php and changing the button type to 'php_standard', but that didn't work either.
The button isn't even showing up for me on the edit view or the record details view.
I'm not sure what I'm doing wrong?
I tried to follow the manual and also the information from this post: https://dadabik.com/forum/read.php?1,20784,20786#msg-20786
Thanks,
Matt