| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Rev: 498 $ | $LastChangedBy: nate $ |
|---|
| 4 | $LastChangedDate: 2009-04-16 13:00:58 -0600 (Thu, 16 Apr 2009) $ |
|---|
| 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/fields.php"); |
|---|
| 42 | |
|---|
| 43 | include("include/tabledefs_custom.php"); |
|---|
| 44 | |
|---|
| 45 | //Make sure table definition id is set |
|---|
| 46 | if(!isset($_GET["id"])) |
|---|
| 47 | $error = new appError(200,"Passed variable not set"); |
|---|
| 48 | |
|---|
| 49 | if(!hasRights("Admin")) |
|---|
| 50 | goURL(APP_PATH."noaccess.php"); |
|---|
| 51 | |
|---|
| 52 | $customFields = new customFields($db, ((int) $_GET["id"])); |
|---|
| 53 | |
|---|
| 54 | $pageTitle="Custom Fields: ".formatVariable($customFields->tableinfo["displayname"]); |
|---|
| 55 | |
|---|
| 56 | if(isset($_POST["custom1name"])) |
|---|
| 57 | $statusmessage = $customFields->process($_POST); |
|---|
| 58 | |
|---|
| 59 | $phpbms->cssIncludes[] = "pages/base/tablecustom.css"; |
|---|
| 60 | $phpbms->jsIncludes[] = "modules/base/javascript/tablecustom.js"; |
|---|
| 61 | |
|---|
| 62 | //Form Elements |
|---|
| 63 | //============================================================== |
|---|
| 64 | $theform = $customFields->prepFields(); |
|---|
| 65 | |
|---|
| 66 | $theform->jsMerge(); |
|---|
| 67 | //============================================================== |
|---|
| 68 | //End Form Elements |
|---|
| 69 | |
|---|
| 70 | include("header.php"); |
|---|
| 71 | |
|---|
| 72 | $phpbms->showTabs("tabledefs entry", "tab:2ebf956d-5e39-c7d5-16b7-501b64685a5a", ((int) $_GET["id"]))?><div class="bodyline"> |
|---|
| 73 | <h1 id="pageTitle"><span><?php echo $pageTitle?></span></h1> |
|---|
| 74 | |
|---|
| 75 | <?php if(!$customFields->tableinfo["hascustomfields"]) {?> |
|---|
| 76 | <form> |
|---|
| 77 | <p id="noCustom">Table is not set up with custom fields.</p> |
|---|
| 78 | </form> |
|---|
| 79 | <?php } else { ?> |
|---|
| 80 | <form action="<?php echo htmlentities($_SERVER["REQUEST_URI"]) ?>" method="post" name="record" id="record"> |
|---|
| 81 | |
|---|
| 82 | <p id="topSaveP"><button type="button" class="Buttons saveButtons" accesskey="s">save</button></p> |
|---|
| 83 | |
|---|
| 84 | <?php $customFields->showFields($theform); ?> |
|---|
| 85 | |
|---|
| 86 | <p id="bottomSaveP"><button type="button" class="Buttons saveButtons">save</button></p> |
|---|
| 87 | |
|---|
| 88 | </form> |
|---|
| 89 | <?php }//endif has customfields ?> |
|---|
| 90 | |
|---|
| 91 | </div> |
|---|
| 92 | <?php include("footer.php")?> |
|---|