\n";
@@ -463,6 +465,8 @@ class lamList {
/**
* Manages all POST actions (e.g. button pressed) for the account lists.
+ *
+ * @return String HTML fragment to insert into beginning of account list
*/
protected function listDoPost() {
// check if button was pressed and if we have to add/delete an account or call file upload
@@ -509,13 +513,13 @@ class lamList {
if (isset($_POST['createPDFok'])) {
$pdfStruct = $_POST['pdf_structure'];
$option = $_POST['createFor'];
+ $filename = '';
// create for clicked account
if ($option == 'DN') {
$_SESSION["accountPDF"] = new accountContainer($this->type, "accountPDF");
$_SESSION["accountPDF"]->load_account(base64_decode($_POST['clickedAccount']));
- createModulePDF(array($_SESSION["accountPDF"]),$pdfStruct);
+ $filename = createModulePDF(array($_SESSION["accountPDF"]),$pdfStruct);
unset($_SESSION["accountPDF"]);
- exit;
}
// create for all selected accounts
elseif ($option == 'SELECTED') {
@@ -529,11 +533,10 @@ class lamList {
$list[$i] = $_SESSION["accountPDF-$i"];
}
if (sizeof($list) > 0) {
- createModulePDF($list,$pdfStruct);
+ $filename = createModulePDF($list,$pdfStruct);
for ($i = 0; $i < sizeof($accounts); $i++) {
unset($_SESSION["accountPDF-$i"]);
}
- exit;
}
}
// create for all accounts
@@ -545,18 +548,19 @@ class lamList {
$list[$i] = $_SESSION["accountPDF-$i"];
}
if (sizeof($list) > 0) {
- createModulePDF($list,$pdfStruct);
+ $filename = createModulePDF($list,$pdfStruct);
for ($i = 0; $i < sizeof($this->entries); $i++) {
// clean session
unset($_SESSION["accountPDF-$i"]);
}
- exit;
}
}
elseif ($option == 'SESSION') {
- createModulePDF(array($_SESSION[$_POST['PDFSessionID']]),$pdfStruct);
+ $filename = createModulePDF(array($_SESSION[$_POST['PDFSessionID']]),$pdfStruct);
unset($_SESSION[$_GET['PDFSessionID']]);
- exit;
+ }
+ if ($filename != '') {
+ return "";
}
}
// check if back from configuration page
@@ -573,6 +577,7 @@ class lamList {
$this->listConfigurationChanged();
}
}
+ return '';
}
/**
@@ -592,59 +597,14 @@ class lamList {
if (!in_array($id, $selAccounts)) {
$selAccounts[] = $id;
}
-
+ // get possible PDF structures
+ $pdf_structures = getPDFStructureDefinitions($this->type);
+
$this->listPrintHeader();
- echo "