account type is fetched before pdf is instantiated
This commit is contained in:
parent
5076243977
commit
8f68551944
|
@ -41,6 +41,12 @@ function createModulePDF($accounts,$account_type="") {
|
||||||
$_SESSION['pdf_structure'] = getStructure();
|
$_SESSION['pdf_structure'] = getStructure();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get account type from account container if none was specified or
|
||||||
|
// if it is different to the submitted or previous stored
|
||||||
|
if($account_type == "" || $account_type != $accounts[0]->get_type()) {
|
||||||
|
$account_type = $accounts[0]->get_type();
|
||||||
|
}
|
||||||
|
|
||||||
// The decimal separator must be a dot in order to write pdf-files
|
// The decimal separator must be a dot in order to write pdf-files
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
|
||||||
|
@ -49,12 +55,6 @@ function createModulePDF($accounts,$account_type="") {
|
||||||
|
|
||||||
// Loop over each account and add a new page in the PDF file for it
|
// Loop over each account and add a new page in the PDF file for it
|
||||||
foreach($accounts as $account) {
|
foreach($accounts as $account) {
|
||||||
// Get account type from account container if none was specified or
|
|
||||||
// if it is different to the submitted or previous stored
|
|
||||||
if($account_type == "" || $account_type != $account->get_type()) {
|
|
||||||
$account_type = $account->get_type();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get PDF structure from session
|
// Get PDF structure from session
|
||||||
$structure = $_SESSION['pdf_structure'][$account_type];
|
$structure = $_SESSION['pdf_structure'][$account_type];
|
||||||
|
|
||||||
|
@ -775,13 +775,13 @@ class lamPDF extends FPDF {
|
||||||
|
|
||||||
// Decide which PDF file type we shall use
|
// Decide which PDF file type we shall use
|
||||||
switch($account_type) {
|
switch($account_type) {
|
||||||
case "User":
|
case "user":
|
||||||
$subject = _("User information page");
|
$subject = _("User information page");
|
||||||
break;
|
break;
|
||||||
case "Group":
|
case "group":
|
||||||
$subject = _("Group information page");
|
$subject = _("Group information page");
|
||||||
break;
|
break;
|
||||||
case "Host":
|
case "host":
|
||||||
$subject = _("Samba-Host information page");
|
$subject = _("Samba-Host information page");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue