Changeset 318
- Timestamp:
- 10/11/07 11:13:13
- Files:
-
- trunk/phpbms/common/stylesheet/mozilla/pages/search.css (modified) (3 diffs)
- trunk/phpbms/common/stylesheet/mozilla/pages/tableoptions.css (modified) (1 diff)
- trunk/phpbms/include/search_class.php (modified) (2 diffs)
- trunk/phpbms/install/createtables.sql (modified) (1 diff)
- trunk/phpbms/install/reports.sql (modified) (1 diff)
- trunk/phpbms/install/tableoptions.sql (modified) (1 diff)
- trunk/phpbms/install/updatev0.9.sql (modified) (1 diff)
- trunk/phpbms/modules/base/include/tabledefs_options_include.php (modified) (1 diff)
- trunk/phpbms/modules/base/javascript/tableoptions.js (modified) (1 diff)
- trunk/phpbms/modules/base/report/tabledefs_sqlexport.php (added)
- trunk/phpbms/modules/base/tabledefs_options.php (modified) (3 diffs)
- trunk/phpbms/modules/bms/include/invoices.php (modified) (1 diff)
- trunk/phpbms/modules/bms/install/tableoptions.sql (modified) (1 diff)
- trunk/phpbms/modules/bms/install/updatev0.90.sql (modified) (4 diffs)
- trunk/phpbms/modules/recurringinvoices/install/tableoptions.sql (modified) (1 diff)
- trunk/phpbms/modules/recurringinvoices/install/update.php (added)
- trunk/phpbms/modules/recurringinvoices/install/updatev1.01.sql (added)
- trunk/phpbms/modules/recurringinvoices/install/version.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phpbms/common/stylesheet/mozilla/pages/search.css
r285 r318 44 44 .sqlDn{background-image: url("../image/search-toolbar-sql-dn.png")} 45 45 46 #recordCommands .toolbarDropDowns{47 margin-top:1px;48 padding:2px 2px 4px 2px;49 position:absolute;50 background:white;51 border:1px solid #999999;52 display:none;53 }46 #recordCommands .toolbarDropDowns{ 47 margin-top:1px; 48 padding:2px 2px 4px 2px; 49 position:absolute; 50 background:white; 51 border:1px solid #999999; 52 display:none; 53 } 54 54 55 #recordCommands .toolbarDropDowns ul{margin:0;padding:0; height:auto} 56 #recordCommands .toolbarDropDowns li{ 57 padding:0; 58 margin:0; 59 float:none; 60 background:none; 61 list-style-type:none; 62 width:auto; 63 height:auto; 64 } 55 #recordCommands .toolbarDropDowns ul{ 56 margin:0; 57 padding:0; 58 height:auto 59 } 60 61 #recordCommands .toolbarDropDowns li{ 62 padding:0; 63 margin:0; 64 float:none; 65 background:none; 66 list-style-type:none; 67 width:auto; 68 height:auto; 69 } 70 65 71 #recordCommands .toolbarDropDowns a{ 66 72 width:auto; … … 76 82 font-weight:normal; 77 83 } 78 #recordCommands .toolbarDropDowns .menuSep {border-top:1px solid #CCCCCC; padding-top:3px;margin-top:3px;} 84 85 #recordCommands .toolbarDropDowns .menuSep { 86 border-top:1px solid #CCCCCC; padding-top:3px;margin-top:3px; 87 } 79 88 80 89 #recordCommands .toolbarDropDowns a:hover{ … … 84 93 } 85 94 86 87 88 #sortSavedDeleteButton,#sortSavedLoadButton,#sortSavedCancelButton{width:75px;}95 #sortSavedDeleteButton,#sortSavedLoadButton,#sortSavedCancelButton{ 96 width:75px; 97 } trunk/phpbms/common/stylesheet/mozilla/pages/tableoptions.css
r162 r318 3 3 #topTitle{} 4 4 .noselects{cursor:auto} 5 6 #save, #cancel {width:75px;} trunk/phpbms/include/search_class.php
r308 r318 401 401 function getTableOptions($id){ 402 402 $options=Array(); 403 $querystatement="SELECT id,name,`option`,othercommand,roleid 404 FROM tableoptions WHERE tabledefid=".$id; 403 $querystatement=" 404 SELECT 405 id, 406 name, 407 `option`, 408 othercommand, 409 roleid, 410 displayorder 411 FROM 412 tableoptions 413 WHERE 414 tabledefid = ".$id." 415 ORDER BY 416 othercommand, 417 displayorder, 418 id"; 405 419 $queryresult=$this->db->query($querystatement); 406 420 407 421 while($therecord=$this->db->fetchArray($queryresult)) { 422 408 423 if($therecord["othercommand"]) { 409 $options["othercommands"][$therecord["id"]]["displayname"]=$therecord["option"]; 410 $options["othercommands"][$therecord["id"]]["roleid"]=$therecord["roleid"]; 424 425 $options["othercommands"][] = array( 426 "id" => $therecord["id"], 427 "name" => $therecord["option"], 428 "roleid" => $therecord["roleid"], 429 "displayorder" => $therecord["displayorder"] 430 ); 431 411 432 }else{ 433 412 434 $options[$therecord["name"]]["allowed"]=$therecord["option"]; 413 435 $options[$therecord["name"]]["roleid"]=$therecord["roleid"]; 414 } 415 } 436 437 }//endif 438 439 }//endwhile 440 416 441 return $options; 442 417 443 }//end getTableOptions 418 444 … … 670 696 <div id="otherDropDown" class="toolbarDropDowns" style="display:none"> 671 697 <ul> 672 <?php if($this->thetabledef["deletebutton"] != "delete" && $this->thetabledef["deletebutton"] != "NA") {?> 698 <?php 699 if($this->thetabledef["deletebutton"] != "delete" && $this->thetabledef["deletebutton"] != "NA") { 700 701 ?> 673 702 <li><a href="#" title="(alt + d)" onclick="chooseOtherCommand('-1','<?php echo $this->thetabledef["deletebutton"]?>')"><strong><?php echo $this->thetabledef["deletebutton"]?></strong></a></li> 674 <?php } 703 <?php 704 705 $displayOrder = -1; 706 707 }else 708 $displayOrder = 0; 709 675 710 if($this->tableoptions["othercommands"]){ 676 foreach($this->tableoptions["othercommands"] as $key => $value){ 677 if(hasRights($value["roleid"])){ 711 712 foreach($this->tableoptions["othercommands"] as $command){ 713 714 if(hasRights($command["roleid"])){ 715 716 if($command["displayorder"] != $displayOrder){ 717 718 $class = ' class="menuSep"'; 719 $displayOrder = $command["displayorder"]; 720 721 } else 722 $class = ""; 723 678 724 ?> 679 <li ><a href="#" onclick="chooseOtherCommand('<?php echo $key ?>','')"><?php echo $value["displayname"]?></a></li>725 <li<?php echo $class?>><a href="#" onclick="chooseOtherCommand('<?php echo $command["id"] ?>','')"><?php echo $command["name"]?></a></li> 680 726 <?php 681 } 682 } 683 } 727 728 }//end if 729 730 }//endforeach 731 732 }//end if 684 733 ?> 685 734 </ul> trunk/phpbms/install/createtables.sql
r308 r318 187 187 othercommand tinyint(1) NOT NULL default '0', 188 188 roleid int(11) NOT NULL default '0', 189 `displayorder` INTEGER NOT NULL DEFAULT 0, 189 190 PRIMARY KEY (id), 190 191 KEY tabledef (tabledefid) trunk/phpbms/install/reports.sql
r287 r318 1 INSERT INTO `reports` (` id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (1,'Raw Table Print','report',0,0,30,'report/general_tableprint.php','This report will prints out of every field for the table for the given records. The report is displayed HTML format.',1,NOW(),1,NOW());2 INSERT INTO `reports` (` id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (2,'Raw Table Export','export',0,0,30,'report/general_export.php','This report will generate a tab-delimited text file. Values are encapsulated in quotes, and the first line lists the field names.',1,NOW(),1,NOW());3 INSERT INTO `reports` (` id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (3,'Note Summary','PDF Report',12,50,0,'modules/base/report/notes_summary.php','PDF report giving basic note information (subject,dates,content) . By deault, the notes are shown in chronological order.',1,NOW(),1,NOW());1 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Raw Table Print','report',0,0,30,'report/general_tableprint.php','This report will prints out of every field for the table for the given records. The report is displayed HTML format.',1,NOW(),1,NOW()); 2 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Raw Table Export','export',0,0,30,'report/general_export.php','This report will generate a tab-delimited text file. Values are encapsulated in quotes, and the first line lists the field names.',1,NOW(),1,NOW()); 3 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Note Summary','PDF Report',12,50,0,'modules/base/report/notes_summary.php','PDF report giving basic note information (subject,dates,content) . By deault, the notes are shown in chronological order.',1,NOW(),1,NOW()); 4 4 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('SQL Export', 'export', '0', '0', '-100', 'report/general_sql.php', 'Generate SQL INSERT statements for records.', 1, NOW(), 1, NOW()); 5 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Support Tables SQL Export', 'export', '11', '0', '0', 'modules/base/report/tabledefs_sqlexport.php', 'Insert statements for all support table records for table definition records.', 1, NOW(), 1, NOW()); trunk/phpbms/install/tableoptions.sql
r317 r318 1 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (9,'new','1',0,0); 2 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (9,'edit','1',0,0); 3 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (9,'select','1',0,0); 4 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (9,'printex','1',0,0); 5 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (10,'new','1',0,0); 6 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (10,'select','1',0,0); 7 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (10,'edit','1',0,0); 8 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (10,'printex','1',0,0); 9 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (11,'new','1',0,0); 10 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (11,'select','1',0,0); 11 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (11,'edit','1',0,0); 12 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (11,'printex','1',0,0); 13 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (12,'new','1',0,0); 14 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (12,'edit','1',0,0); 15 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (12,'select','1',0,0); 16 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (12,'mark_asread','mark as read',1,0); 17 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (12,'printex','1',0,0); 18 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (16,'new','1',0,0); 19 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (16,'select','1',0,0); 20 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (16,'edit','1',0,0); 21 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (16,'printex','1',0,0); 22 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (17,'select','1',0,0); 23 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (17,'edit','1',0,0); 24 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (17,'printex','1',0,0); 25 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (19,'new','1',0,0); 26 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (19,'edit','1',0,0); 27 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (19,'select','1',0,0); 28 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (19,'printex','1',0,0); 29 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (21,'edit','1',0,0); 30 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (21,'select','1',0,0); 31 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (21,'printex','1',0,0); 32 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (23,'new','1',0,0); 33 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (23,'edit','1',0,0); 34 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (23,'select','1',0,0); 35 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (23,'mark_asread','mark completed',1,0); 36 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (24,'new','1',0,0); 37 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (24,'edit','1',0,0); 38 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (24,'select','1',0,0); 39 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (24,'mark_asread','mark done',1,0); 40 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (26,'new','1',0,0); 41 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (26,'select','1',0,0); 42 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (26,'edit','1',0,0); 43 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (26,'printex','1',0,0); 44 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (27,'new','1',0,0); 45 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (27,'select','1',0,0); 46 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (27,'edit','1',0,0); 47 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (27,'printex','1',0,0); 48 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (200,'new','1',0,0); 49 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (200,'select','1',0,0); 50 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (200,'edit','1',0,0); 51 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (200,'printex','1',0,0); 52 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'new','1',0,0); 53 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'select','1',0,0); 54 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'edit','1',0,0); 55 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'printex','0',0,0); 56 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'inactivate','inactivate',1,0); 57 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'runSelected','run job(s)',1,0); 58 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'printex','1',0,0); 59 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,'new','0',0,0); 60 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,'select','1',0,0); 61 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,'edit','0',0,0); 62 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,'printex','1',0,0); 63 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (203,'new','1',0,-100); 64 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (203,'select','1',0,-100); 65 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (203,'edit','1',0,-100); 66 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (203,'printex','1',0,0); 1 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'new', '1', '0', '0', '0'); 2 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'printex', '1', '0', '0', '0'); 3 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'select', '1', '0', '0', '0'); 4 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'edit', '1', '0', '0', '0'); 5 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'new', '1', '0', '0', '0'); 6 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'select', '1', '0', '0', '0'); 7 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'edit', '1', '0', '0', '0'); 8 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'printex', '1', '0', '0', '0'); 9 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'printex', '1', '0', '0', '0'); 10 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'edit', '1', '0', '0', '0'); 11 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'select', '1', '0', '0', '0'); 12 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'new', '1', '0', '0', '0'); 13 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'printex', '1', '0', '0', '0'); 14 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'mark_asread', 'mark as read', '1', '0', '0'); 15 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'new', '1', '0', '0', '0'); 16 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'edit', '1', '0', '0', '0'); 17 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'select', '1', '0', '0', '0'); 18 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'new', '1', '0', '0', '0'); 19 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'printex', '1', '0', '0', '0'); 20 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'edit', '1', '0', '0', '0'); 21 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'select', '1', '0', '0', '0'); 22 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'printex', '1', '0', '0', '0'); 23 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'edit', '1', '0', '0', '0'); 24 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'select', '1', '0', '0', '0'); 25 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'printex', '1', '0', '0', '0'); 26 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'new', '1', '0', '0', '0'); 27 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'edit', '1', '0', '0', '0'); 28 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'select', '1', '0', '0', '0'); 29 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'printex', '1', '0', '0', '0'); 30 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'edit', '1', '0', '0', '0'); 31 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'select', '1', '0', '0', '0'); 32 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'select', '1', '0', '0', '0'); 33 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'new', '1', '0', '0', '0'); 34 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'edit', '1', '0', '0', '0'); 35 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'mark_asread', 'mark completed', '1', '0', '0'); 36 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'mark_asread', 'mark done', '1', '0', '0'); 37 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'select', '1', '0', '0', '0'); 38 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'edit', '1', '0', '0', '0'); 39 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'new', '1', '0', '0', '0'); 40 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'printex', '1', '0', '0', '0'); 41 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'new', '1', '0', '0', '0'); 42 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'select', '1', '0', '0', '0'); 43 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'edit', '1', '0', '0', '0'); 44 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'printex', '1', '0', '0', '0'); 45 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 46 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'select', '1', '0', '0', '0'); 47 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 48 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'new', '1', '0', '0', '0'); 49 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'select', '1', '0', '0', '0'); 50 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'printex', '1', '0', '0', '0'); 51 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'edit', '1', '0', '0', '0'); 52 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'new', '1', '0', '0', '0'); 53 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'printex', '1', '0', '0', '0'); 54 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'select', '1', '0', '0', '0'); 55 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'edit', '1', '0', '0', '0'); 56 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'inactivate', 'inactivate', '1', '0', '0'); 57 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'runSelected', 'run job(s)', '1', '0', '0'); 58 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'new', '0', '0', '0', '0'); 59 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'select', '1', '0', '0', '0'); 60 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'edit', '0', '0', '0', '0'); 61 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'printex', '1', '0', '0', '0'); 62 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'edit', '1', '0', '-100', '0'); 63 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'select', '1', '0', '-100', '0'); 64 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'new', '1', '0', '-100', '0'); 65 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'printex', '1', '0', '0', '0'); trunk/phpbms/install/updatev0.9.sql
r312 r318 108 108 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES ('219', 'Help', '', '0', '200', '1', '1', NOW(), NOW(), '0'); 109 109 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES ('220', 'About phpBMS', 'javascript:menu.showHelp()', '219', '0', '1', '1', NOW(), NOW(), '0'); 110 DELETE FROM tableoptions WHERE name='printex';111 INSERT INTO tableoptions (tabledefid, name, `option`,othercommand, roleid) SELECT id, "printex", 1, 0, 0 FROM tabledefs WHERE `type` != "view";112 110 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('SQL Export', 'export', '0', '0', '-100', 'report/general_sql.php', 'Generate SQL INSERT statements for records.', 1, NOW(), 1, NOW()); 111 INSERT INTO `reports` (`name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('Support Tables SQL Export', 'export', '11', '0', '0', 'modules/base/report/tabledefs_sqlexport.php', 'Insert statements for all support table records for table definition records.', 1, NOW(), 1, NOW()); 112 DELETE FROM tableoptions; 113 ALTER TABLE `tableoptions` ADD COLUMN `displayorder` INTEGER UNSIGNED NOT NULL DEFAULT 0; 114 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'new', '1', '0', '0', '0'); 115 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'printex', '1', '0', '0', '0'); 116 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'select', '1', '0', '0', '0'); 117 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'edit', '1', '0', '0', '0'); 118 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'new', '1', '0', '0', '0'); 119 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'select', '1', '0', '0', '0'); 120 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'edit', '1', '0', '0', '0'); 121 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'printex', '1', '0', '0', '0'); 122 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'printex', '1', '0', '0', '0'); 123 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'edit', '1', '0', '0', '0'); 124 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'select', '1', '0', '0', '0'); 125 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'new', '1', '0', '0', '0'); 126 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'printex', '1', '0', '0', '0'); 127 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'mark_asread', 'mark as read', '1', '0', '0'); 128 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'new', '1', '0', '0', '0'); 129 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'edit', '1', '0', '0', '0'); 130 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'select', '1', '0', '0', '0'); 131 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'new', '1', '0', '0', '0'); 132 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'printex', '1', '0', '0', '0'); 133 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'edit', '1', '0', '0', '0'); 134 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'select', '1', '0', '0', '0'); 135 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'printex', '1', '0', '0', '0'); 136 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'edit', '1', '0', '0', '0'); 137 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'select', '1', '0', '0', '0'); 138 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'printex', '1', '0', '0', '0'); 139 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'new', '1', '0', '0', '0'); 140 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'edit', '1', '0', '0', '0'); 141 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'select', '1', '0', '0', '0'); 142 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'printex', '1', '0', '0', '0'); 143 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'edit', '1', '0', '0', '0'); 144 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'select', '1', '0', '0', '0'); 145 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'select', '1', '0', '0', '0'); 146 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'new', '1', '0', '0', '0'); 147 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'edit', '1', '0', '0', '0'); 148 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'mark_asread', 'mark completed', '1', '0', '0'); 149 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'mark_asread', 'mark done', '1', '0', '0'); 150 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'select', '1', '0', '0', '0'); 151 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'edit', '1', '0', '0', '0'); 152 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'new', '1', '0', '0', '0'); 153 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'printex', '1', '0', '0', '0'); 154 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'new', '1', '0', '0', '0'); 155 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'select', '1', '0', '0', '0'); 156 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'edit', '1', '0', '0', '0'); 157 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'printex', '1', '0', '0', '0'); 158 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 159 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'select', '1', '0', '0', '0'); 160 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 161 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'new', '1', '0', '0', '0'); 162 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'select', '1', '0', '0', '0'); 163 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'printex', '1', '0', '0', '0'); 164 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'edit', '1', '0', '0', '0'); 165 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'new', '1', '0', '0', '0'); 166 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'printex', '1', '0', '0', '0'); 167 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'select', '1', '0', '0', '0'); 168 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'edit', '1', '0', '0', '0'); 169 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'inactivate', 'inactivate', '1', '0', '0'); 170 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'runSelected', 'run job(s)', '1', '0', '0'); 171 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'new', '0', '0', '0', '0'); 172 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'select', '1', '0', '0', '0'); 173 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'edit', '0', '0', '0', '0'); 174 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'printex', '1', '0', '0', '0'); 175 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'edit', '1', '0', '-100', '0'); 176 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'select', '1', '0', '-100', '0'); 177 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'new', '1', '0', '-100', '0'); 178 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'printex', '1', '0', '0', '0'); trunk/phpbms/modules/base/include/tabledefs_options_include.php
r285 r318 38 38 */ 39 39 40 function setOptionDefaults(){ 41 $therecord["id"]=NULL; 42 $therecord["name"]=""; 43 $therecord["option"]=""; 44 $therecord["othercommand"]=0; 45 $therecord["roleid"]=0; 46 47 return $therecord; 48 } 40 class tableOptions { 49 41 50 function getOptions($db,$tabledefid,$optionid=false){ 51 52 $querystatement="SELECT tableoptions.id, tableoptions.name, tableoptions.option, tableoptions.othercommand, tableoptions.roleid, roles.name as rolename 53 FROM tableoptions LEFT JOIN roles ON tableoptions.roleid=roles.id 54 WHERE tabledefid=".$tabledefid; 55 if($optionid) $querystatement.=" AND tableoptions.id=".$optionid; 56 $querystatement.=" ORDER BY othercommand, tableoptions.id"; 57 58 $queryresult=$db->query($querystatement); 59 60 return $queryresult; 61 }// end function 62 63 64 function addOption($db,$variables,$tabledefid){ 65 66 $querystatement="INSERT INTO tableoptions (tabledefid, roleid, name, `option`, othercommand) 67 values ("; 68 $querystatement.=$tabledefid.", "; 69 $querystatement.=$variables["roleid"].", "; 70 if($variables["othercommand"]==1) { 71 $querystatement.="\"".$variables["name"]."\", "; 72 $querystatement.="\"".$variables["option"]."\", "; 73 } else { 74 $querystatement.="\"".$variables["pdName"]."\", "; 75 $querystatement.="\"".$variables["pdOption"]."\", "; 76 } 77 $querystatement.="\"".$variables["othercommand"]."\") "; 78 if($db->query($querystatement)) $thereturn ="Option Added"; 79 80 return $thereturn; 81 }// end function 42 function tableOptions($db, $tabledefid){ 43 44 $this->db = $db; 45 $this->tabledefid = ((int) $tabledefid); 46 47 }//end method 48 49 50 function getTableName(){ 51 52 $querystatement = " 53 SELECT 54 displayname 55 FROM 56 tabledefs 57 WHERE 58 id=".$this->tabledefid; 59 60 $queryresult = $this->db->query($querystatement); 61 62 $therecord = $this->db->fetchArray($queryresult); 63 64 return formatVariable($therecord["displayname"]); 65 66 }//end method 67 82 68 83 84 function updateOption($db,$variables){ 85 86 $querystatement="UPDATE tableoptions set "; 87 $querystatement.="othercommand=".$variables["othercommand"].", "; 88 $querystatement.="roleid=".$variables["roleid"].", "; 89 if($variables["othercommand"]==1) { 90 $querystatement.="name=\"".$variables["name"]."\", "; 91 $querystatement.="`option`=\"".$variables["option"]."\", "; 92 } else { 93 $querystatement.="name=\"".$variables["pdName"]."\", "; 94 $querystatement.="`option`=\"".$variables["pdOption"]."\", "; 95 } 96 $querystatement.="othercommand=".$variables["othercommand"]." "; 97 $querystatement.="WHERE id=".$variables["optionid"]; 98 if($db->query($querystatement)) $thereturn ="Option Updated"; 99 100 return $thereturn; 101 } 102 103 function deleteOption($db,$id){ 104 105 $querystatement="DELETE FROM tableoptions WHERE id=".$id; 106 if($db->query($querystatement)) $thereturn ="Option Deleted"; 107 108 return $thereturn; 109 } 110 69 function getDefaults(){ 70 71 return array( 72 "id" => NULL, 73 "name" => "", 74 "option" => "", 75 "othercommand" => 0, 76 "roleid" => 0, 77 "displayorder" => 0 78 ); 79 80 }//end method 81 82 83 function get($id = NULL){ 84 85 $querystatement = " 86 SELECT 87 tableoptions.id, 88 tableoptions.name, 89 tableoptions.option, 90 tableoptions.othercommand, 91 tableoptions.displayorder, 92 tableoptions.roleid, 93 roles.name AS rolename 94 FROM 95 tableoptions LEFT JOIN roles ON tableoptions.roleid = roles.id 96 WHERE"; 97 if($id) 98 $querystatement .= " 99 tableoptions.id = ".((int) $id); 100 else 101 $querystatement .= " 102 tabledefid = ".$this->tabledefid; 103 104 $querystatement .= " 105 ORDER BY 106 tableoptions.othercommand, 107 tableoptions.displayorder, 108 tableoptions.name"; 109 110 return $this->db->query($querystatement); 111 112 }//end method 113 114 115 function showRecords($queryresult){ 116 117 global $phpbms; 118 119 ?><table border="0" cellpadding="3" cellspacing="0" class="querytable"> 120 <thead> 121 <tr> 122 <th nowrap="nowrap"align="left" width="100%">name</th> 123 <th nowrap="nowrap"align="center">allowed</th> 124 <th nowrap="nowrap"align="left">function name</th> 125 <th nowrap="nowrap"align="left">access</th> 126 <th nowrap="nowrap"align="right">display order</th> 127 <th nowrap="nowrap"> </th> 128 </tr> 129 </thead> 130 131 <tfoot> 132 <tr class="queryfooter"> 133 <td colspan="6"> </td> 134 </tr> 135 </tfoot> 136 137 <tbody> 138 <?php 139 140 if($this->db->numRows($queryresult)){ 141 142 $row = 1; 143 144 $other = 3; 145 146 while($therecord = $this->db->fetchArray($queryresult)){ 147 148 $row =