fixed errors in cron jobs

Former-commit-id: 6926e6cca21cb43d4c08ed0c4c48ae344abe8fab
This commit is contained in:
daniel 2018-12-12 10:46:28 +01:00
parent ead4c71f1c
commit 07f5455e28
3 changed files with 32 additions and 23 deletions

View File

@ -86,9 +86,8 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
<script language="javascript" type="text/javascript" src="graphs/flot/pandora.flot.js"></script>
</head>
<body bgcolor="#ffffff" style='background:#ffffff;'>
<?php
$params['only_image'] = false;
<?php
$params['only_image'] = false;
$params['width'] = (int) $_REQUEST['viewport_width'];
$params['menu'] = false;
@ -214,17 +213,21 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
echo '</div>';
$config['font_size'] = $aux_font_size;
?>
?>
<script type="text/javascript">
$('document').ready(function () {
setTimeout(function () {
if (typeof window.callPhantom === 'function') {
window.callPhantom("loaded");
<script type="text/javascript">
$('document').ready(function () {
setTimeout(function () {
if (typeof window.callPhantom === 'function') {
try {
var status = window.callPhantom({ status: "loaded" });
} catch (error) {
console.log("CALLBACK ERROR", error.message)
}
}, 10);
});
</script>
</body>
}
}, 100);
});
</script>
</body>
</html>

View File

@ -3320,7 +3320,10 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined = fal
. ' "' . $session_id . '"'
. ' "' . $params['return_img_base_64'] . '"';
exec($cmd, $result);
$result = null;
$retcode = null;
exec($cmd, $result, $retcode);
$img_content = join("\n", $result);
if($params['return_img_base_64']){

View File

@ -37,11 +37,8 @@ else{
"&session_id=" + session_id;
}
var page = require('webpage').create();
page.viewportSize = {
width: viewport_width,
height: viewport_height
@ -49,20 +46,26 @@ page.viewportSize = {
page.zoomFactor = 1;
page.onConsoleMessage = function(msg){
console.log(msg);
};
page.onCallback = function (st){
if(!base_64){
page.render(output_filename, {format: 'png'});
} else{
page.onError = function(msg){
console.log(msg);
page.close();
}
page.onCallback = function (st) {console.log("CALLBACK CALLED", st.status)
if (!base_64) {
page.render(output_filename, { format: 'png' });
} else {
var base64 = page.renderBase64('png');
// do not remove this console.output
console.log(base64);
}
phantom.exit();
};
page.open(url, 'POST', post_data, function (status) {
});