Changeset 541 for trunk/phpbms/include
- Timestamp:
- 05/28/09 13:08:01 (3 years ago)
- Location:
- trunk/phpbms/include
- Files:
-
- 3 modified
-
common_functions.php (modified) (3 diffs)
-
fields.php (modified) (3 diffs)
-
tables.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/include/common_functions.php
r522 r541 180 180 //Most Common Functions of the Application go here. 181 181 //================================================= 182 183 /** 184 * generates a Universal Unique ID (UUID) with an optional prefix 185 * 186 * @param string $prefix prefix to prepend to the UUID 187 */ 182 188 function uuid($prefix = ''){ 183 189 … … 203 209 } 204 210 211 205 212 function goURL($url){ 206 213 if(headers_sent()) … … 209 216 exit; 210 217 } 218 211 219 212 220 function hasRights($roleid,$fullAccessAdmin = true){ -
trunk/phpbms/include/fields.php
r519 r541 96 96 // Displays the bottom record details that are present on almost all phpBMS 97 97 // records. These are non-modifiable 98 function show CreateModify($phpbms, $therecord){98 function showGeneralInfo($phpbms, $therecord){ 99 99 ?> 100 100 <div id="createmodifiedby" > 101 <div id="savecancel2"><?php showSaveCancel(2)?></div>102 101 <table> 103 102 <tbody> 104 <tr id="cmFirstRow">103 <tr class="topRows"> 105 104 <td class="cmTitles"> 106 105 <input name="createdby" type="hidden" value="<?php $therecord["createdby"] ?>" /> … … 110 109 <td><?php echo htmlQuotes($phpbms->getUserName($therecord["createdby"]))?></td> 111 110 <td><?php echo formatFromSQLDatetime($therecord["creationdate"]) ?></td> 111 <td id="cmButtonContainer" rowspan="3"> 112 <?php showSaveCancel(2)?> 113 </td> 112 114 </tr> 113 <tr >115 <tr class="topRows"> 114 116 <td class="cmTitles"> 115 117 <input name="modifiedby" type="hidden" value="<?php $therecord["modifiedby"] ?>" /> … … 121 123 <td><?php echo formatFromSQLDatetime($therecord["modifieddate"]) ?></td> 122 124 </tr> 125 <tr> 126 <td class="cmTitles"> 127 uuid / id 128 <input name="uuid" id="uuid" type="hidden" value="<?php if(isset($therecord["uuid"])) echo $therecord["uuid"] ?>" /> 129 <input id="id" name="id" type="hidden" value="<?php echo $therecord["id"]?>" /> 130 </td> 131 <td colspan="2" id="cmIds"><span><?php echo isset($therecord["uuid"])?$therecord["uuid"]:' ' ?></span><span id="cmId"><?php echo $therecord["id"] ?></span></td> 132 </tr> 123 133 </tbody> 124 134 </table> 125 135 </div> 126 136 <?php 127 }//end function show CreateModify137 }//end function showGeneralInfo 128 138 129 139 -
trunk/phpbms/include/tables.php
r526 r541 49 49 var $fields = array(); 50 50 51 51 52 function phpbmsTable($db,$tabledefid = 0,$backurl = NULL){ 52 53 … … 286 287 287 288 288 // retrieves default values for record 289 // uses the field name to retrieve the default value, and if it does not 290 // match one the predefined phpBMS names (such as id, or modified by) 291 // it uses the field type 289 /** 290 * Retrieves default values for a single record 291 * 292 * Uses the field names to guess a default value. If it cannot find 293 * one of the standard names it sets the default value based on the type 294 * 295 */ 292 296 function getDefaults(){ 293 297 … … 298 302 switch($fieldname){ 299 303 300 case "id": 301 case "modifiedby": 302 case "modifieddate": 304 case "id": 305 case "modifiedby": 306 case "modifieddate": 307 $therecord[$fieldname] = NULL; 308 break; 309 310 case "uuid": 311 $therecord["uuid"] = uuid($this->prefix.":"); 312 break; 313 314 case "createdby": 315 $therecord["createdby"] = $_SESSION["userinfo"]["id"]; 316 break; 317 318 default: 319 if(strpos($thefield["flags"],"not_null") === false) 303 320 $therecord[$fieldname] = NULL; 304 break; 305 306 case "createdby": 307 $therecord["createdby"] = $_SESSION["userinfo"]["id"]; 308 break; 309 310 default: 311 if(strpos($thefield["flags"],"not_null") === false) 312 $therecord[$fieldname] = NULL; 313 else 314 $therecord[$fieldname] = $this->getDefaultByType($thefield["type"]); 315 316 break; 321 else 322 $therecord[$fieldname] = $this->getDefaultByType($thefield["type"]); 323 324 break; 317 325 318 326 }//endswitch