Skip to content

Commit

Permalink
Print in PDF will fail, tell us what else fails, thanks.
Browse files Browse the repository at this point in the history
Don't use PrintPDF.

Its use is minimal in Aixada. The old mpdf module is used, which creates compatibility problem with PHP7 and the new mpdf requires at least 5.6

It is proposed to eliminate, and that the user use the capabilities of the browser to create PDF.
  • Loading branch information
jorix committed Dec 3, 2018
1 parent ad3251c commit 2baac84
Show file tree
Hide file tree
Showing 140 changed files with 35 additions and 95,655 deletions.
76 changes: 25 additions & 51 deletions incidents.php
Expand Up @@ -137,50 +137,33 @@ function resetDetails(){
$("#btn_print")
.button({
icons: {
primary: "ui-icon-print",
secondary: "ui-icon-triangle-1-s"
primary: "ui-icon-print"
}
})
.menu({
content: $('#printOptionsItems').html(),
showSpeed: 50,
width:180,
flyOut: true,
itemSelected: function(item){
if ($('input:checkbox[name="bulkAction"][checked="checked"]').length == 0){
$.showMsg({
msg:"<?=$Text['msg_err_noselect'];?>",
buttons: {
"<?=$Text['btn_ok'];?>":function(){
$(this).dialog("close");
}
},
type: 'warning'});
return false;
}

var link = $(item).attr('id');

var idList = "";
$('input:checkbox[name="bulkAction"][checked="checked"]').each(function(){
idList += $(this).parents('tr').attr('incidentId')+",";
});
idList = idList.substring(0,idList.length-1);

switch (link){
case "printWindow":
var printWin = window.open('tpl/<?=$tpl_print_incidents;?>?idlist='+idList);
printWin.focus();
printWin.print();
break;

case "printPDF":
window.frames['dataFrame'].window.location = "tpl/<?=$tpl_print_incidents;?>?idlist="+idList+"&asPDF=1&outputFormat=D";
break;
}

}//end item selected
});//end print menu
.click(function(e){
var idList = "";
$('input:checkbox[name="bulkAction"][checked="checked"]').each(function(){
idList += $(this).parents('tr').attr('incidentId')+",";
});
if (idList === '') {
$.showMsg({
type: 'warning',
title: "<?php echo $Text['msg_warning']; ?>",
msg: "<?=$Text['msg_err_noselect'];?>",
buttons: {
"<?=$Text['btn_ok'];?>": function() {
$(this).dialog("close");
}
}
});
} else {
idList = idList.substring(0,idList.length-1);
var printWin = window.open('tpl/<?=$tpl_print_incidents;?>?idlist='+idList);
printWin.focus();
printWin.print();
}
return false;
});



Expand Down Expand Up @@ -445,15 +428,6 @@ function resetDetails(){


<button id="btn_print" class="overviewElements btn_right"><?=$Text['printout'];?></button>
<div id="printOptionsItems" class="hidden hideInPrint">
<ul>
<li><a href="javascript:void(null)" id="printWindow"><?=$Text['print_new_win'];?></a></li>
<li><a href="javascript:void(null)" id="printPDF"><?=$Text['print_pdf'];?></a></li>
</ul>
</div>
<!-- button id="btn_zip" class="overviewElements">Zip</button-->


</div>
</div>

Expand Down
61 changes: 0 additions & 61 deletions js/aixadautilities/loadPDF.js

This file was deleted.

20 changes: 0 additions & 20 deletions php/ctrl/SmallQ.php
Expand Up @@ -9,9 +9,6 @@
require_once(__ROOT__ . "php/utilities/general.php");
require_once(__ROOT__ . 'local_config/lang/'.get_session_language() . '.php');

include(__ROOT__ . "php/external/mpdf54/mpdf.php");


if (!isset($_SESSION)) {
session_start();
}
Expand Down Expand Up @@ -51,23 +48,6 @@
case 'getExistingThemes':
printXML(get_existing_themes_XML());
exit;

case 'printPDF':
$mpdf=new mPDF();
$mpdf->WriteHTML(get_param('htmlStr'));
$defaultFileName = $Text['coop_name'].date('Y-m-d', strtotime('Today')).'.pdf';
$outputFormat = get_param('outParam','D');
// 'F' writes a file into local_config/reports and sends back the name ;
//'D' sends back binary pdf and forces download
if ( $outputFormat == 'F'){
$fileName = __ROOT__. 'local_config/reports/'.get_param('fileName', $defaultFileName).'.pdf';
} else {
$fileName = get_param('fileName', $defaultFileName).'.pdf';

}
$mpdf->Output($fileName,$outputFormat);
echo $fileName;
exit;

default:
throw new Exception('ctrlSmallQ.php: Operation ' . $_REQUEST['oper'] . ' not supported.');
Expand Down

0 comments on commit 2baac84

Please sign in to comment.