| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Rev$ | $LastChangedBy$ |
|---|
| 4 | $LastChangedDate$ |
|---|
| 5 | +-------------------------------------------------------------------------+ |
|---|
| 6 | | Copyright (c) 2004 - 2010, Kreotek LLC | |
|---|
| 7 | | All rights reserved. | |
|---|
| 8 | +-------------------------------------------------------------------------+ |
|---|
| 9 | | | |
|---|
| 10 | | Redistribution and use in source and binary forms, with or without | |
|---|
| 11 | | modification, are permitted provided that the following conditions are | |
|---|
| 12 | | met: | |
|---|
| 13 | | | |
|---|
| 14 | | - Redistributions of source code must retain the above copyright | |
|---|
| 15 | | notice, this list of conditions and the following disclaimer. | |
|---|
| 16 | | | |
|---|
| 17 | | - Redistributions in binary form must reproduce the above copyright | |
|---|
| 18 | | notice, this list of conditions and the following disclaimer in the | |
|---|
| 19 | | documentation and/or other materials provided with the distribution. | |
|---|
| 20 | | | |
|---|
| 21 | | - Neither the name of Kreotek LLC nor the names of its contributore may | |
|---|
| 22 | | be used to endorse or promote products derived from this software | |
|---|
| 23 | | without specific prior written permission. | |
|---|
| 24 | | | |
|---|
| 25 | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
|---|
| 26 | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
|---|
| 27 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | |
|---|
| 28 | | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
|---|
| 29 | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
|---|
| 30 | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
|---|
| 31 | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
|---|
| 32 | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
|---|
| 33 | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
|---|
| 34 | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
|---|
| 35 | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
|---|
| 36 | | | |
|---|
| 37 | +-------------------------------------------------------------------------+ |
|---|
| 38 | */ |
|---|
| 39 | |
|---|
| 40 | include("../../include/session.php"); |
|---|
| 41 | include("include/tables.php"); |
|---|
| 42 | include("include/fields.php"); |
|---|
| 43 | include("include/reports.php"); |
|---|
| 44 | |
|---|
| 45 | $thetable = new reports($db, "tbld:d595ef42-db9d-2233-1b9b-11dfd0db9cbb"); |
|---|
| 46 | $therecord = $thetable->processAddEditPage(); |
|---|
| 47 | |
|---|
| 48 | if($therecord["id"]){ |
|---|
| 49 | |
|---|
| 50 | $reportSettings = new reportSettings($db, $therecord["uuid"]); |
|---|
| 51 | $reportSettings->get(); |
|---|
| 52 | |
|---|
| 53 | }//endif |
|---|
| 54 | |
|---|
| 55 | if(isset($therecord["phpbmsStatus"])) |
|---|
| 56 | $statusmessage = $therecord["phpbmsStatus"]; |
|---|
| 57 | |
|---|
| 58 | $pageTitle="Report"; |
|---|
| 59 | |
|---|
| 60 | $phpbms->cssIncludes[] = "pages/base/reports.css"; |
|---|
| 61 | $phpbms->jsIncludes[] = "modules/base/javascript/reports.js"; |
|---|
| 62 | |
|---|
| 63 | //Form Elements |
|---|
| 64 | //============================================================== |
|---|
| 65 | $theform = new phpbmsForm(NULL, "post", "record", NULL); |
|---|
| 66 | $theform->id = "record"; |
|---|
| 67 | |
|---|
| 68 | $theinput = new inputField("name",$therecord["name"],NULL,true,NULL,32,64); |
|---|
| 69 | $theinput->setAttribute("class","important"); |
|---|
| 70 | $theform->addField($theinput); |
|---|
| 71 | |
|---|
| 72 | $theinput = new inputField("displayorder",$therecord["displayorder"],"display order",true,NULL,10,10); |
|---|
| 73 | $theform->addField($theinput); |
|---|
| 74 | |
|---|
| 75 | $theinput = new inputBasicList("type",$therecord["type"],array("Report"=>"report","PDF Report"=>"PDF Report","Export"=>"export")); |
|---|
| 76 | $theform->addField($theinput); |
|---|
| 77 | |
|---|
| 78 | $theinput = new inputRolesList($db,"roleid",$therecord["roleid"],"access (role)"); |
|---|
| 79 | $theform->addField($theinput); |
|---|
| 80 | |
|---|
| 81 | if($therecord["id"]){ |
|---|
| 82 | |
|---|
| 83 | $theinput = new inputField("reportfile",$therecord["reportfile"],"report file",true,NULL,64,128); |
|---|
| 84 | $theinput->setAttribute("readonly","readonly"); |
|---|
| 85 | $theinput->setAttribute("class","uneditable"); |
|---|
| 86 | |
|---|
| 87 | $theform->addField($theinput); |
|---|
| 88 | |
|---|
| 89 | }//endif |
|---|
| 90 | |
|---|
| 91 | $theinput = new inputTextarea("description", $therecord["description"], NULL, false, 3, 48); |
|---|
| 92 | $theform->addField($theinput); |
|---|
| 93 | |
|---|
| 94 | $thetable->getCustomFieldInfo(); |
|---|
| 95 | $theform->prepCustomFields($db, $thetable->customFieldsQueryResult, $therecord); |
|---|
| 96 | $theform->jsMerge(); |
|---|
| 97 | //============================================================== |
|---|
| 98 | //End Form Elements |
|---|
| 99 | |
|---|
| 100 | include("header.php"); |
|---|
| 101 | |
|---|
| 102 | ?><div class="bodyline"> |
|---|
| 103 | <?php $theform->startForm($pageTitle) ?> |
|---|
| 104 | <fieldset id="fsAttributes"> |
|---|
| 105 | <legend>Attributes</legend> |
|---|
| 106 | |
|---|
| 107 | <p><?php $theform->showField("type")?></p> |
|---|
| 108 | |
|---|
| 109 | <p> |
|---|
| 110 | <label for="tabledefid">report table</label><br /> |
|---|
| 111 | <?php $thetable->displayTables("tabledefid",$therecord["tabledefid"]);?><br /> |
|---|
| 112 | </p> |
|---|
| 113 | |
|---|
| 114 | <p> |
|---|
| 115 | <?php $theform->showField("displayorder"); ?><br /> |
|---|
| 116 | </p> |
|---|
| 117 | |
|---|
| 118 | <p><?php $theform->showField("roleid")?></p> |
|---|
| 119 | |
|---|
| 120 | </fieldset> |
|---|
| 121 | |
|---|
| 122 | <div id="leftSideDiv"> |
|---|
| 123 | <fieldset> |
|---|
| 124 | <legend>details</legend> |
|---|
| 125 | |
|---|
| 126 | <p class="big"><?php $theform->showField("name"); ?></p> |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | <p> |
|---|
| 130 | <?php |
|---|
| 131 | if($therecord["id"]) |
|---|
| 132 | $theform->showField("reportfile"); |
|---|
| 133 | else |
|---|
| 134 | $thetable->displayRerportFiles(); |
|---|
| 135 | ?> |
|---|
| 136 | </p> |
|---|
| 137 | |
|---|
| 138 | <p class="big"><?php $theform->showField("description"); ?></p> |
|---|
| 139 | |
|---|
| 140 | </fieldset> |
|---|
| 141 | |
|---|
| 142 | <fieldset> |
|---|
| 143 | <legend>settings</legend> |
|---|
| 144 | <div class="fauxP"> |
|---|
| 145 | <?php if(!$therecord["id"]) { |
|---|
| 146 | ?><p class="notes">Report settings are available after initial record creation.</p><?php |
|---|
| 147 | } else { |
|---|
| 148 | ?> |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | <textarea class="hiddenTextAreas" id="rsUpdates" name="rsUpdates" rows="1" cols="5"></textarea> |
|---|
| 152 | <textarea class="hiddenTextAreas" id="rsDelList" name="rsDelList" rows="1" cols="5"></textarea> |
|---|
| 153 | <textarea class="hiddenTextAreas" id="rsAdds" name="rsAdds" rows="1" cols="5"></textarea> |
|---|
| 154 | <table class="querytable simple" id="settingsTable" cellspacing="0" cellpadding="0" border="0" summary="report settings"> |
|---|
| 155 | <thead> |
|---|
| 156 | <tr> |
|---|
| 157 | <th align="right">name</th> |
|---|
| 158 | <th>value</th> |
|---|
| 159 | <th>type</th> |
|---|
| 160 | <th width="100%">description</th> |
|---|
| 161 | <th> </th> |
|---|
| 162 | </tr> |
|---|
| 163 | </thead> |
|---|
| 164 | <tbody id="rsTbody"> |
|---|
| 165 | <tr id="addNewRow"> |
|---|
| 166 | <td> |
|---|
| 167 | <input type="text" id="rsAddName"/> |
|---|
| 168 | </td> |
|---|
| 169 | <td> |
|---|
| 170 | <input type="text" id="rsAddValue" size="32"/> |
|---|
| 171 | </td> |
|---|
| 172 | <td>string</td> |
|---|
| 173 | <td>user added setting</td> |
|---|
| 174 | <td> |
|---|
| 175 | <button title="Add Setting" class="graphicButtons buttonPlus" id="rsButtonAdd" type="button"><span>+</span></button> |
|---|
| 176 | </td> |
|---|
| 177 | </tr> |
|---|
| 178 | <?php |
|---|
| 179 | $reportSettings->display(); |
|---|
| 180 | ?> |
|---|
| 181 | <tr class="queryfooter" id="rsFooterTr"> |
|---|
| 182 | <td colspan="5"> </td> |
|---|
| 183 | </tr> |
|---|
| 184 | </tbody> |
|---|
| 185 | </table> |
|---|
| 186 | <?php |
|---|
| 187 | }//endif |
|---|
| 188 | ?> |
|---|
| 189 | </div> |
|---|
| 190 | </fieldset> |
|---|
| 191 | |
|---|
| 192 | <?php $theform->showCustomFields($db, $thetable->customFieldsQueryResult) ?> |
|---|
| 193 | |
|---|
| 194 | </div> |
|---|
| 195 | |
|---|
| 196 | <?php |
|---|
| 197 | $theform->showGeneralInfo($phpbms,$therecord); |
|---|
| 198 | $theform->endForm(); |
|---|
| 199 | ?> |
|---|
| 200 | </div> |
|---|
| 201 | <?php include("footer.php");?> |
|---|