navigation  interaction  search

 other resources

Changeset 318

Show
Ignore:
Timestamp:
10/11/07 11:13:13
Author:
brieb
Message:

Added development SQL export report for table definitions.
Added sorting/grouping to other command dropdowns
Recorded table options screen in new system.
Modified installers/updaters to use new tableoptions.
Added e-mail client quote PDF command.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phpbms/common/stylesheet/mozilla/pages/search.css

    r285 r318  
    4444.sqlDn{background-image: url("../image/search-toolbar-sql-dn.png")} 
    4545 
    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       
    5454 
    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 
    6571        #recordCommands .toolbarDropDowns a{ 
    6672                width:auto; 
     
    7682                font-weight:normal; 
    7783        } 
    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        } 
    7988         
    8089        #recordCommands .toolbarDropDowns a:hover{ 
     
    8493        } 
    8594 
    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  
    33#topTitle{} 
    44.noselects{cursor:auto} 
     5 
     6#save, #cancel {width:75px;} 
  • trunk/phpbms/include/search_class.php

    r308 r318  
    401401                function getTableOptions($id){ 
    402402                        $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"; 
    405419                        $queryresult=$this->db->query($querystatement); 
    406420                         
    407421                        while($therecord=$this->db->fetchArray($queryresult)) { 
     422                         
    408423                                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                                                                         
    411432                                }else{ 
     433                                 
    412434                                        $options[$therecord["name"]]["allowed"]=$therecord["option"]; 
    413435                                        $options[$therecord["name"]]["roleid"]=$therecord["roleid"]; 
    414                                 } 
    415                         } 
     436                                         
     437                                }//endif 
     438                                 
     439                        }//endwhile 
     440                         
    416441                        return $options; 
     442                         
    417443                }//end getTableOptions 
    418444 
     
    670696                                        <div id="otherDropDown" class="toolbarDropDowns" style="display:none"> 
    671697                                                <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                                                                ?> 
    673702                                                                <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                                                         
    675710                                                        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                                                                                 
    678724                                                                                ?> 
    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> 
    680726                                                                                <?php 
    681                                                                         } 
    682                                                                 } 
    683                                                         } 
     727                                                                                 
     728                                                                        }//end if 
     729                                                                         
     730                                                                }//endforeach 
     731                                                                 
     732                                                        }//end if 
    684733                                                        ?> 
    685734                                                </ul> 
  • trunk/phpbms/install/createtables.sql

    r308 r318  
    187187  othercommand tinyint(1) NOT NULL default '0', 
    188188  roleid int(11) NOT NULL default '0', 
     189  `displayorder` INTEGER NOT NULL DEFAULT 0, 
    189190  PRIMARY KEY  (id), 
    190191  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()); 
     1INSERT 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()); 
     2INSERT 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()); 
     3INSERT 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()); 
    44INSERT 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()); 
     5INSERT 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); 
     1INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'new', '1', '0', '0', '0'); 
     2INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'printex', '1', '0', '0', '0'); 
     3INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'select', '1', '0', '0', '0'); 
     4INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'edit', '1', '0', '0', '0'); 
     5INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'new', '1', '0', '0', '0'); 
     6INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'select', '1', '0', '0', '0'); 
     7INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'edit', '1', '0', '0', '0'); 
     8INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'printex', '1', '0', '0', '0'); 
     9INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'printex', '1', '0', '0', '0'); 
     10INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'edit', '1', '0', '0', '0'); 
     11INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'select', '1', '0', '0', '0'); 
     12INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'new', '1', '0', '0', '0'); 
     13INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'printex', '1', '0', '0', '0'); 
     14INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'mark_asread', 'mark as read', '1', '0', '0'); 
     15INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'new', '1', '0', '0', '0'); 
     16INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'edit', '1', '0', '0', '0'); 
     17INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'select', '1', '0', '0', '0'); 
     18INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'new', '1', '0', '0', '0'); 
     19INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'printex', '1', '0', '0', '0'); 
     20INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'edit', '1', '0', '0', '0'); 
     21INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'select', '1', '0', '0', '0'); 
     22INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'printex', '1', '0', '0', '0'); 
     23INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'edit', '1', '0', '0', '0'); 
     24INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'select', '1', '0', '0', '0'); 
     25INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'printex', '1', '0', '0', '0'); 
     26INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'new', '1', '0', '0', '0'); 
     27INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'edit', '1', '0', '0', '0'); 
     28INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'select', '1', '0', '0', '0'); 
     29INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'printex', '1', '0', '0', '0'); 
     30INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'edit', '1', '0', '0', '0'); 
     31INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'select', '1', '0', '0', '0'); 
     32INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'select', '1', '0', '0', '0'); 
     33INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'new', '1', '0', '0', '0'); 
     34INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'edit', '1', '0', '0', '0'); 
     35INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'mark_asread', 'mark completed', '1', '0', '0'); 
     36INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'mark_asread', 'mark done', '1', '0', '0'); 
     37INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'select', '1', '0', '0', '0'); 
     38INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'edit', '1', '0', '0', '0'); 
     39INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'new', '1', '0', '0', '0'); 
     40INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'printex', '1', '0', '0', '0'); 
     41INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'new', '1', '0', '0', '0'); 
     42INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'select', '1', '0', '0', '0'); 
     43INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'edit', '1', '0', '0', '0'); 
     44INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'printex', '1', '0', '0', '0'); 
     45INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 
     46INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'select', '1', '0', '0', '0'); 
     47INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 
     48INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'new', '1', '0', '0', '0'); 
     49INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'select', '1', '0', '0', '0'); 
     50INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'printex', '1', '0', '0', '0'); 
     51INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'edit', '1', '0', '0', '0'); 
     52INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'new', '1', '0', '0', '0'); 
     53INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'printex', '1', '0', '0', '0'); 
     54INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'select', '1', '0', '0', '0'); 
     55INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'edit', '1', '0', '0', '0'); 
     56INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'inactivate', 'inactivate', '1', '0', '0'); 
     57INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'runSelected', 'run job(s)', '1', '0', '0'); 
     58INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'new', '0', '0', '0', '0'); 
     59INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'select', '1', '0', '0', '0'); 
     60INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'edit', '0', '0', '0', '0'); 
     61INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'printex', '1', '0', '0', '0'); 
     62INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'edit', '1', '0', '-100', '0'); 
     63INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'select', '1', '0', '-100', '0'); 
     64INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'new', '1', '0', '-100', '0'); 
     65INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'printex', '1', '0', '0', '0'); 
  • trunk/phpbms/install/updatev0.9.sql

    r312 r318  
    108108INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES ('219', 'Help', '', '0', '200', '1', '1', NOW(), NOW(), '0'); 
    109109INSERT 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"; 
    112110INSERT 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()); 
     111INSERT 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()); 
     112DELETE FROM tableoptions; 
     113ALTER TABLE `tableoptions` ADD COLUMN `displayorder` INTEGER UNSIGNED NOT NULL DEFAULT 0; 
     114INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'new', '1', '0', '0', '0'); 
     115INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'printex', '1', '0', '0', '0'); 
     116INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'select', '1', '0', '0', '0'); 
     117INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('9', 'edit', '1', '0', '0', '0'); 
     118INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'new', '1', '0', '0', '0'); 
     119INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'select', '1', '0', '0', '0'); 
     120INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'edit', '1', '0', '0', '0'); 
     121INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('10', 'printex', '1', '0', '0', '0'); 
     122INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'printex', '1', '0', '0', '0'); 
     123INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'edit', '1', '0', '0', '0'); 
     124INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'select', '1', '0', '0', '0'); 
     125INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('11', 'new', '1', '0', '0', '0'); 
     126INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'printex', '1', '0', '0', '0'); 
     127INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'mark_asread', 'mark as read', '1', '0', '0'); 
     128INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'new', '1', '0', '0', '0'); 
     129INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'edit', '1', '0', '0', '0'); 
     130INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('12', 'select', '1', '0', '0', '0'); 
     131INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'new', '1', '0', '0', '0'); 
     132INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'printex', '1', '0', '0', '0'); 
     133INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'edit', '1', '0', '0', '0'); 
     134INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('16', 'select', '1', '0', '0', '0'); 
     135INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'printex', '1', '0', '0', '0'); 
     136INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'edit', '1', '0', '0', '0'); 
     137INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('17', 'select', '1', '0', '0', '0'); 
     138INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'printex', '1', '0', '0', '0'); 
     139INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'new', '1', '0', '0', '0'); 
     140INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'edit', '1', '0', '0', '0'); 
     141INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('19', 'select', '1', '0', '0', '0'); 
     142INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'printex', '1', '0', '0', '0'); 
     143INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'edit', '1', '0', '0', '0'); 
     144INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('21', 'select', '1', '0', '0', '0'); 
     145INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'select', '1', '0', '0', '0'); 
     146INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'new', '1', '0', '0', '0'); 
     147INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'edit', '1', '0', '0', '0'); 
     148INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('23', 'mark_asread', 'mark completed', '1', '0', '0'); 
     149INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'mark_asread', 'mark done', '1', '0', '0'); 
     150INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'select', '1', '0', '0', '0'); 
     151INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'edit', '1', '0', '0', '0'); 
     152INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('24', 'new', '1', '0', '0', '0'); 
     153INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'printex', '1', '0', '0', '0'); 
     154INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'new', '1', '0', '0', '0'); 
     155INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'select', '1', '0', '0', '0'); 
     156INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('26', 'edit', '1', '0', '0', '0'); 
     157INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'printex', '1', '0', '0', '0'); 
     158INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 
     159INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'select', '1', '0', '0', '0'); 
     160INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('27', 'new', '1', '0', '0', '0'); 
     161INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'new', '1', '0', '0', '0'); 
     162INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'select', '1', '0', '0', '0'); 
     163INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'printex', '1', '0', '0', '0'); 
     164INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('200', 'edit', '1', '0', '0', '0'); 
     165INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'new', '1', '0', '0', '0'); 
     166INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'printex', '1', '0', '0', '0'); 
     167INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'select', '1', '0', '0', '0'); 
     168INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'edit', '1', '0', '0', '0'); 
     169INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'inactivate', 'inactivate', '1', '0', '0'); 
     170INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('201', 'runSelected', 'run job(s)', '1', '0', '0'); 
     171INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'new', '0', '0', '0', '0'); 
     172INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'select', '1', '0', '0', '0'); 
     173INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'edit', '0', '0', '0', '0'); 
     174INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('202', 'printex', '1', '0', '0', '0'); 
     175INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'edit', '1', '0', '-100', '0'); 
     176INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'select', '1', '0', '-100', '0'); 
     177INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`, `displayorder`) VALUES ('203', 'new', '1', '0', '-100', '0'); 
     178INSERT 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  
    3838*/ 
    3939         
    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 { 
    4941         
    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                 
    8268         
    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">&nbsp;</th> 
     128                                </tr> 
     129                        </thead> 
     130                         
     131                        <tfoot> 
     132                                <tr class="queryfooter"> 
     133                                        <td colspan="6">&nbsp;</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 =