0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-03-16 22:33:34 +00:00

Merge pull request from sgaved/patch-18

Add ability to choose page size and orientation in pdf templates
This commit is contained in:
Ashley Nicolson 2017-04-05 18:08:55 +01:00 committed by GitHub
commit e316a0259d
6 changed files with 78 additions and 6 deletions

View file

@ -3966,3 +3966,8 @@ $app_list_strings['day_list']['Thursday'] = 'Thursday';
$app_list_strings['day_list']['Friday'] = 'Friday';
$app_list_strings['day_list']['Saturday'] = 'Saturday';
$app_list_strings['day_list']['Sunday'] = 'Sunday';
$app_list_strings['pdf_page_size_dom']['A4'] = 'A4';
$app_list_strings['pdf_page_size_dom']['Letter'] = 'Letter';
$app_list_strings['pdf_page_size_dom']['Legal'] = 'Legal';
$app_list_strings['pdf_orientation_dom']['Portrait'] = 'Portrait';
$app_list_strings['pdf_orientation_dom']['Landscape'] = 'Landscape';

View file

@ -140,7 +140,8 @@ if ($task == 'pdf' || $task == 'emailpdf') {
ob_clean();
try {
$pdf = new mPDF('en', 'A4', '', 'DejaVuSansCondensed', $template->margin_left, $template->margin_right, $template->margin_top, $template->margin_bottom, $template->margin_header, $template->margin_footer);
$orientation = ($template->orientation == "Landscape") ? "-L" : "";
$pdf = new mPDF('en', $template->page_size . $orientation, '', 'DejaVuSansCondensed', $template->margin_left, $template->margin_right, $template->margin_top, $template->margin_bottom, $template->margin_header, $template->margin_footer);
$pdf->SetAutoFont();
$pdf->SetHTMLHeader($header);
$pdf->SetHTMLFooter($footer);

View file

@ -83,5 +83,7 @@ $mod_strings = array (
'LBL_MARGIN_FOOTER' => 'Margin Footer',
'LBL_EDITVIEW_PANEL1' => 'Margins',
'LBL_DETAILVIEW_PANEL1' => 'Margins',
'LBL_PAGE_SIZE' => 'Page Size',
'LBL_ORIENTATION' => 'Orientation',
);
?>

View file

@ -72,6 +72,19 @@ $viewdefs [$module_name] =
),
),
2 =>
array (
0 =>
array (
'name' => 'page_size',
'label' => 'LBL_PAGE_SIZE',
),
1 =>
array (
'name' => 'orientation',
'label' => 'LBL_ORIENTATION',
),
),
3 =>
array (
0 =>
array (
@ -80,7 +93,7 @@ $viewdefs [$module_name] =
'customCode' => '{$fields.pdfheader.value}',
),
),
3 =>
4 =>
array (
0 =>
array (
@ -89,7 +102,7 @@ $viewdefs [$module_name] =
'customCode' => '{$fields.description.value}',
),
),
4 =>
5 =>
array (
0 =>
array (

View file

@ -91,6 +91,19 @@ $viewdefs [$module_name] =
1 => '',
),
3 =>
array (
0 =>
array (
'name' => 'page_size',
'label' => 'LBL_PAGE_SIZE',
),
1 =>
array (
'name' => 'orientation',
'label' => 'LBL_ORIENTATION',
),
),
4 =>
array (
0 =>
array (
@ -99,7 +112,7 @@ $viewdefs [$module_name] =
'customCode' => '{$INSERT_FIELDS}',
),
),
4 =>
5 =>
array (
0 =>
array (
@ -107,7 +120,7 @@ $viewdefs [$module_name] =
'label' => 'LBL_DESCRIPTION',
),
),
5 =>
6 =>
array (
0 =>
array (
@ -115,7 +128,7 @@ $viewdefs [$module_name] =
'label' => 'LBL_HEADER',
),
),
6 =>
7 =>
array (
0 =>
array (

View file

@ -268,6 +268,44 @@ $dictionary['AOS_PDF_Templates'] = array(
'enable_range_search' => false,
'disable_num_format' => '',
),
'page_size' =>
array (
'required' => '0',
'name' => 'page_size',
'vname' => 'LBL_PAGE_SIZE',
'type' => 'enum',
'massupdate' => 0,
'default' => '',
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => 0,
'reportable' => 0,
'len' => 100,
'options' => 'pdf_page_size_dom',
'studio' => 'visible',
),
'orientation' =>
array (
'required' => '0',
'name' => 'orientation',
'vname' => 'LBL_ORIENTATION',
'type' => 'enum',
'massupdate' => 0,
'default' => '',
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => 0,
'reportable' => 0,
'len' => 100,
'options' => 'pdf_orientation_dom',
'studio' => 'visible',
),
),
'relationships'=>array (
),