1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <!-- Generated by Hand -->
4 Copyright (C) 2011 Julia Longtin <julia.longtin@gmail.com>
6 This program is free software; you can redistribute it and/or
7 Modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 <xsl:stylesheet version=
"1.0"
12 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
13 <xsl:output method=
"xml" omit-xml-declaration=
"yes"/>
14 <xsl:include href=
"common_objects.xslt"/>
15 <xsl:include href=
"report_objects.xslt"/>
16 <xsl:strip-space elements=
"*"/>
17 <xsl:template match=
"/">
18 <xsl:apply-templates select=
"form"/>
20 <!-- The variable telling field_objects.xslt what form is calling it -->
21 <xsl:variable name=
"page">show
</xsl:variable>
22 <!-- if fetchrow has contents, a variable with that name will be created by field_objects.xslt, and all fields created by it will retreive values from it. -->
23 <xsl:variable name=
"fetchrow">xyzzy
</xsl:variable>
24 <xsl:template match=
"form">
25 <xsl:text disable-output-escaping=
"yes"><![CDATA[
<?php
27 * The page shown when the user requests to see this form in a
"report view". does not allow editing contents, or saving. has 'print' and 'delete' buttons.
30 /* for $GLOBALS[], ?? */
31 require_once('../../globals.php');
32 /* for acl_check(), ?? */
33 require_once($GLOBALS['srcdir'].'/api.inc');
34 /* for display_layout_rows(), ?? */
35 require_once($GLOBALS['srcdir'].'/options.inc.php');
38 <!-- These templates generate PHP code -->
39 <xsl:apply-templates select=
"table|RealName|safename|acl|style"/>
40 <!-- Fetch form contents from the database. -->
41 <xsl:apply-templates select=
"table" mode=
"fetch"/>
42 <!-- set up for using the layouts engine -->
43 <xsl:apply-templates select=
"layout" mode=
"head"/>
44 <!-- and set up the fake table of layouts for fields using the manual engine -->
45 <xsl:apply-templates select=
"manual" mode=
"head"/>
46 <xsl:text disable-output-escaping=
"yes"><![CDATA[
47 /* since we have no-where to return, abuse returnurl to link to the 'edit' page */
48 /* FIXME: pass the ID, create blank rows if necissary. */
49 $returnurl =
"../../forms/$form_folder/view.php?mode=noencounter";
52 <!-- FIXME: this needs to work for layout based fields added after form creation. ideas? -->
53 <xsl:if test=
"//field[@type='date']">
54 <xsl:text disable-output-escaping=
"yes"><![CDATA[/* remove the time-of-day from all date fields */
56 <xsl:apply-templates select=
"//field[@type='date']" mode=
"split_timeofday"/>
58 <xsl:call-template name=
"generate_chkdata"/>
59 <xsl:text disable-output-escaping=
"yes"><![CDATA[
60 ?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
61 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
64 <!-- declare this document as being encoded in UTF-8 -->
65 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8" ></meta>
67 <!-- supporting javascript code -->
69 <script type=
"text/javascript" src=
"<?php echo $GLOBALS['webroot']; ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
70 <!-- For jquery, required by edit, print, and delete buttons. -->
71 <script type=
"text/javascript" src=
"<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-2-1/index.js"></script>
72 <script type=
"text/javascript" src=
"<?php echo $GLOBALS['webroot']; ?>/library/textformat.js"></script>
74 <!-- Global Stylesheet -->
75 <link rel=
"stylesheet" href=
"<?php echo $css_header; ?>" type=
"text/css"/>
76 <!-- Form Specific Stylesheet. -->
77 <link rel=
"stylesheet" href=
"../../forms/<?php echo $form_folder; ?>/style.css" type=
"text/css"/>
79 <script type=
"text/javascript">
81 <!-- FIXME: this needs to detect access method, and construct a URL appropriately! -->
82 function PrintForm() {
83 newwin = window.open(
"<?php echo $rootdir.'/forms/'.$form_folder.'/print.php?id='.$_GET['id']; ?>",
"print_<?php echo $form_name; ?>");
87 <title><?php echo htmlspecialchars('Show '.$form_name);
?></title>
90 <body class=
"body_top">
93 <span class=
"title"><?php xl($form_name,'e');
?></span>
95 if ($thisauth_write_addonly)
97 <a href=
"<?php echo $returnurl; ?>" onclick=
"top.restoreSession()">
98 <span class=
"back"><?php xl($tmore,'e');
?></span>
103 <form method=
"post" id=
"<?php echo $form_folder; ?>" action=
"">
105 <!-- container for the main body of the form -->
106 <div id=
"form_container">
111 <xsl:apply-templates select=
"H2|H3|H4|layout|manual"/>
112 <xsl:text disable-output-escaping=
"yes"><![CDATA[
114 </div><!-- end show -->
116 </div><!-- end form_container -->
118 <!-- Print button -->
119 <div id=
"button_bar" class=
"button_bar">
120 <fieldset class=
"button_bar">
121 <input type=
"button" class=
"print" value=
"<?php xl('Print','e'); ?>" />
123 </div><!-- end button_bar -->
126 <script type=
"text/javascript">
127 // jQuery stuff to make the page a little easier to use
129 $(document).ready(function(){
130 $(
".print").click(function() { PrintForm(); });