ytiddo wrote on Tuesday, April 21, 2009:
Someone tap me on the shoulder if this is not the right place to post fixes.
This cleans up the html generated by new_form.php when there are no forms to add, as well as generating the <form> only when needed, and removing a containing <dl>.
{{{
— interface/patient_file/encounter/new_form.php.orig 2009-04-21 16:13:26.000000000 +0100
+++ interface/patient_file/encounter/new_form.php 2009-04-21 17:04:35.000000000 +0100
@@ -7,7 +7,6 @@
<link rel=“stylesheet” href="<?php echo $css_header; ?>" type=“text/css”>
</head>
<body class=“body_top”>
-<dl>
<?php //DYNAMIC FORM RETREIVAL
include_once("$srcdir/registry.inc");
function myGetRegistered ( $state=“1”, $limit=“unlimited”, $offset=“0”)
@@ -27,8 +26,8 @@
}
$reg = myGetRegistered ();
$old_category = ‘’;
+if ($reg != false) {
echo “<FORM METHOD=POST NAME=‘choose’>\n”;
-if ($reg != false)
foreach ($reg as $entry) {
$new_category = trim($entry[‘category’]);
$new_nickname = trim($entry[‘nickname’]);
@@ -38,7 +37,6 @@
if ($old_category != $new_category) {
$new_category_ = $new_category;
$new_category_ = str_replace(’ ‘,’_’,$new_category_);
- if ($old_category != ‘’) {echo “</select>\n”;}
echo “<select name=” . $new_category_ . " onchange=‘top.restoreSession();";
echo $GLOBALS[‘concurrent_layout’] ? “parent” : “top.frames["Main"]”;
echo “.location.href = document.choose.” . $new_category_ .
@@ -47,6 +45,7 @@
echo "<option value=’" . $rootdir .
‘/patient_file/encounter/load_form.php?formname=’ .
urlencode($entry[‘directory’]) . “’>” . $nickname . “</option>\n”;
+ echo “</select>\n”;
$old_category = $new_category;
}
else {
@@ -55,10 +54,8 @@
urlencode($entry[‘directory’]) . “’>” . xl($nickname) . “</option>\n”;
}
}
-echo “</select>\n”;
echo “</FORM>\n”;
+}
?>
-</dl>
-
</body>
</html>
}}}