Commit 45d2c187 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Download/Excel: argument passing via SIP implemented. Update documentation.

parent 02b1a66f
Pipeline #755 passed with stage
in 1 minute and 49 seconds
......@@ -6358,24 +6358,21 @@ Setup
'''''
* Create a special column name `_excel` (or `_link`) in QFQ/Report. As a source, define a T3 page, which have to deliver
the dynamic content. ::
the dynamic content (also: `excel-export-sample_`). ::
# New
SELECT CONCAT('d:final.xlsx|M:excel|s:1|t:Excel (new)|p:?id=exceldata') AS _link
# Template
SELECT CONCAT('d:final.xlsx|M:excel|s:1|t:Excel (template)|F:fileadmin/template.xlsx|p:?id=exceldata&arg1=hello') AS _link
* Create a T3 page which delivers the content.
* Disable all HTML header and wrapping code on that page. Typoscript setup: ::
* Disable all HTML header and wrapping code on that page. It's also a good idea to limit access to such page on localhost,
your development network and your webserver address. Typoscript setup: ::
config.disableAllHeaderCode = 1
tt_content.stdWrap >
page >
page = PAGE
[usergroup = *] || [IP = 127.0.0.1,192.168.1.*]
[usergroup = *] || [IP = 127.0.0.1,192.168.1.*,<webserver IP>]
page.10 < styles.content.get
[else]
page.10 = TEXT
......@@ -6384,7 +6381,7 @@ Setup
* Use the regular QFQ Report syntax to create some output.
* The newline at the end of every line needs to be CHAR(10). To make it simpler, the special column name `... AS _XLS`
can be used.
(see _XLS, _XLSs, _XLSb, _XLSn) can be used.
* One option per line.
* Empty lines will be skipped.
* Lines starting with '#' will be skipped (comments). Inline comment signs are NOT recognized as comment sign.
......@@ -6425,7 +6422,7 @@ This fills D11, E11, F11, D12
In Report Syntax: ::
# With ... AS _XLS
# With ... AS _XLS (token explicit given)
10.sql = SELECT 'position=D10' AS _XLS,
's=Hello' AS _XLS,
's=World' AS _XLS,
......@@ -6434,7 +6431,7 @@ In Report Syntax: ::
's=Second line' AS _XLS,
'n=123' AS _XLS,
# With ... AS _XLSs
# With ... AS _XLSs (token generated internally)
20.sql = SELECT 'position=D20' AS _XLS,
'Hello' AS _XLSs,
'World' AS _XLSs,
......@@ -6443,10 +6440,25 @@ In Report Syntax: ::
'Second line' AS _XLSs,
'n=123' AS _XLS,
# With ... AS _XLSb (Base64 encoding)
# With ... AS _XLSb (token generated internally and content is base64 encoded)
30.sql = SELECT 'position=D30' AS _XLS,
'<some content with special characters like newline/carriage return>' AS _XLSb
.. _excel-export-sample:
Excel export samples: ::
# From scratch (both are the same, one with '_excel' the other with '_link')
SELECT CONCAT('d:new.xlsx|t:Excel (new)|p:?id=exceldata') AS _excel
SELECT CONCAT('d:new.xlsx|t:Excel (new)|p:?id=exceldata|M:excel|s:1') AS _link
# Template
SELECT CONCAT('d:final.xlsx|t:Excel (template)|F:fileadmin/template.xlsx|p:?id=exceldata') AS _excel
# With parameter (via SIP) - get the Parameter on page 'exceldata' with '{{arg1:S}}' and '{{arg2:S}}'
SELECT CONCAT('d:final.xlsx|t:Excel (parameter)|p:?id=exceldata&_sip=1&arg1=hello&arg2=world') AS _excel
.. _drag_and_drop:
Drag and drop
......
......@@ -43,12 +43,12 @@ require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
*
* Description:
*
* Delete successfull.
* Delete successful.
* status = 'success'
* message = <message>
* redirect = 'client'
*
* Delete successfull.
* Delete successful.
* status = 'success'
* message = <message>
* redirect = 'url'
......
......@@ -13,6 +13,8 @@ use qfq;
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/File.php');
require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
/**
* Process File Upload - immediately when the the user selects a file.
......@@ -23,7 +25,7 @@ require_once(__DIR__ . '/../qfq/File.php');
*
* Description:
*
* Upload successfull & File accepted by server.
* Upload successful & File accepted by server.
* status = 'success'
* message = <message>
*
......
......@@ -303,6 +303,7 @@ const ERROR_LANGUAGE_NOT_CONFIGURED_IN_QFQ = 2300;
const ERROR_MISSING_SESSIONNAME = 2400;
const ERROR_QFQ_SESSION_MISSING = 2401;
const ERROR_SESSION_BROKEN_SCRIPT_PATH = 2402;
const ERROR_MISSING_COOKIE = 2403;
const ERROR_HTML2PDF_MISSING_CONFIG = 2500;
const ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE = 2501;
......
......@@ -41,18 +41,33 @@ class DownloadPage {
}
// Check php.ini
if(ini_get('allow_url_fopen')!='1'){
if (ini_get('allow_url_fopen') != '1') {
throw new UserReportException("php.ini: 'allow_url_fopen' is off and needs to be open to get '$page''", ERROR_DOWNLOAD_FOPEN_BLOCKED);
}
if (!isset($_COOKIE[SESSION_NAME])) {
throw new UserReportException('Error: missing QFQ cookie - allow cookies in your browser', ERROR_MISSING_COOKIE);
}
// Download page
$ctx = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
),
// Copy cookie: to forward current QFQ user session
'http' => array(
'method' => "GET",
'header' => "Accept-language: en\r\n" .
"Cookie: " . SESSION_NAME . "=" . $_COOKIE[SESSION_NAME] . "\r\n",
),
);
// The current session needs to be closed, cause the SESSION needs to be opened again by processing get_file_contents()
// T3 is started again to render the requested page
Session::close();
return file_get_contents($page, false, stream_context_create($ctx));
}
}
\ No newline at end of file
......@@ -60,7 +60,7 @@ define("DFLT_UPLOAD_TMP_TTL", "300");
//define("PATH_ICONS", "typo3conf/ext/qfq/Resources/Public/icons/");
const PATH_ICONS = 'typo3conf/ext/qfq/Resources/Public/icons';
// Definitions to allow successfull include of ext_localconf.
// Definitions to allow successful include of ext_localconf.
//define( 'TYPO3_MODE', '1' );
//define( 'FORMREPORT', '1' );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment