aethelwulffe wrote on Friday, March 18, 2011:
I have a version of the scanned encounters form that worked quite decently in 3.2. This is no longer the case in 4.0.
I checked the code, looked to see what was actually written to the DB, and all that. The database has the data, but report.php and print.php won’t display the file. The path is in the DB, and the file name is there, and the following code puts them together as should be. (Note: view.php just includes print.php for this form to make it non-editable)
<?
# print scanned documents
include("../../../library/api.inc");
formHeader("Patient's Scanned Documents");
$row = formFetch('form_documents', $_GET['id']);
$doc=$row["document_path"]."/".$row["document_image"];
$thatfile=$row["document_image"];
$localpath="../../forms/documents/scanned/".$GLOBALS['pid'];
$relink=$localpath."/".$thatfile;
echo ("<span class=text>Document path on server is: $doc ");
echo ("<br>");
echo ("Document Source is: ");
echo $row["document_source"];
echo ("<br>");
echo $row["document_description"];
echo ("<br>");
echo ("<IFRAME SRC=\"$relink\"width=\"90%\"height=\"90%\"></iframe>");
//echo ("<IMG SRC=\"$relink\" ALT=\"$relink\">");
?>
<hr>
<a href="<?php echo $GLOBALS['form_exit_url']; ?>" onclick="top.restoreSession()">Done</a>
<?php
formFooter();
?>[code]
I am using an IFRAME to display the files (in report and print). The frame doesn't show at all in report (just a gray bar) and in print, it does not display the file, only an index page for the file path. In report.php, I am using:[code]echo ("<iframe src=\"../../forms/documents/scanned/${pid}/${doc_image}\"width=\"85%\"height=\"50%\"></iframe>");[/code]
It does not seem to be that the code is in error.
Here is a chunk of encounter\forms.php that I think displays the wonderful gray bar I see:
[code]
// Use the form's report.php for display. Forms with names starting with LBF
// are list-based forms sharing a single collection of code.
//
if (substr($formdir,0,3) == 'LBF') {
include_once($GLOBALS['incdir'] . "/forms/LBF/report.php");
call_user_func("lbf_report", $pid, $encounter, 2, $iter['form_id'], $formdir);
}
else {
include_once($GLOBALS['incdir'] . "/forms/$formdir/report.php");
call_user_func($formdir . "_report", $pid, $encounter, 2, $iter['form_id']);
}
echo "</div></td></tr>";
$divnos=$divnos+1;
}
echo "</table>";[/code]
I don't see an issue there either.
I have looked in dozens of files for a hint as to what is going on (and what changed in 4.0). Anyone have any hints as to why the change in behavior when it executes view or report now? Does the new "expand/collapse" code use something that nests or otherwise snuffs it?