Changeset 170
- Timestamp:
- 11/10/06 19:49:30 (6 years ago)
- Location:
- trunk/phpbms
- Files:
-
- 9 added
- 1 removed
- 81 modified
-
common/stylesheet/mozilla/forms.css (modified) (1 diff)
-
common/stylesheet/mozilla/pages/roles.css (added)
-
common/stylesheet/mozilla/pages/tabledefs.css (modified) (1 diff)
-
common/stylesheet/mozilla/pages/users.css (modified) (1 diff)
-
include/common_functions.php (modified) (2 diffs)
-
include/fields.php (modified) (1 diff)
-
include/login_include.php (modified) (1 diff)
-
include/print_class.php (modified) (2 diffs)
-
include/search_class.php (modified) (15 diffs)
-
include/session.php (modified) (1 diff)
-
install/ updatev0.7.sql (modified) (1 diff)
-
install/choices.sql (modified) (1 diff)
-
install/createtables.sql (modified) (9 diffs)
-
install/installxml.php (modified) (1 diff)
-
install/menu.sql (modified) (1 diff)
-
install/reports.sql (modified) (1 diff)
-
install/roles.sql (added)
-
install/tablecolumns.sql (modified) (1 diff)
-
install/tabledefs.sql (modified) (1 diff)
-
install/tablefindoptions.sql (modified) (1 diff)
-
install/tableoptions.sql (modified) (1 diff)
-
install/tablesearchablefields.sql (modified) (1 diff)
-
install/updatexml.php (modified) (2 diffs)
-
install/users.sql (modified) (1 diff)
-
loadsearch.php (modified) (4 diffs)
-
menu.php (modified) (5 diffs)
-
modules/base/files_addedit.php (modified) (2 diffs)
-
modules/base/include/adminsettings_include.php (modified) (1 diff)
-
modules/base/include/attachments_addedit_include.php (modified) (5 diffs)
-
modules/base/include/files_addedit_include.php (modified) (6 diffs)
-
modules/base/include/menu_addedit_include.php (modified) (7 diffs)
-
modules/base/include/notes_addedit_include.php (modified) (1 diff)
-
modules/base/include/notes_search_functions.php (modified) (1 diff)
-
modules/base/include/relationships_addedit_include.php (modified) (2 diffs)
-
modules/base/include/reports_addedit_include.php (modified) (7 diffs)
-
modules/base/include/roles_addedit_include.php (added)
-
modules/base/include/roles_search_functions.php (added)
-
modules/base/include/tabledefs_addedit_include.php (modified) (9 diffs)
-
modules/base/include/tabledefs_columns_include.php (modified) (1 diff)
-
modules/base/include/tabledefs_functions.php (modified) (1 diff)
-
modules/base/include/tabledefs_options_include.php (modified) (5 diffs)
-
modules/base/include/tabledefs_quicksearch_include.php (modified) (5 diffs)
-
modules/base/include/tabledefs_searchfields_include.php (modified) (1 diff)
-
modules/base/include/usersearches_edit_include.php (modified) (5 diffs)
-
modules/base/include/users_addedit_include.php (modified) (9 diffs)
-
modules/base/javascript/file.js (modified) (2 diffs)
-
modules/base/javascript/roles.js (added)
-
modules/base/javascript/tabledefs.js (added)
-
modules/base/javascript/users.js (added)
-
modules/base/menu_addedit.php (modified) (5 diffs)
-
modules/base/notes_addedit.php (modified) (1 diff)
-
modules/base/reports_addedit.php (modified) (1 diff)
-
modules/base/roles_addedit.php (added)
-
modules/base/tabledefs_addedit.php (modified) (5 diffs)
-
modules/base/tabledefs_options.php (modified) (3 diffs)
-
modules/base/tabledefs_quicksearch.php (modified) (3 diffs)
-
modules/base/usersearches_edit.php (modified) (1 diff)
-
modules/base/users_addedit.php (modified) (3 diffs)
-
modules/bms/clients_attachments.php (modified) (1 diff)
-
modules/bms/include/clientemailprojects_edit_include.php (modified) (2 diffs)
-
modules/bms/include/clientemailprojects_search_functions.php (modified) (1 diff)
-
modules/bms/include/clients_addedit_include.php (modified) (1 diff)
-
modules/bms/include/discounts_addedit_include.php (modified) (1 diff)
-
modules/bms/include/invoices_addedit_include.php (modified) (2 diffs)
-
modules/bms/include/productcategories_addedit_include.php (modified) (1 diff)
-
modules/bms/include/products_addedit_include.php (modified) (4 diffs)
-
modules/bms/include/products_functions.php (modified) (1 diff)
-
modules/bms/include/tax_addedit_include.php (modified) (1 diff)
-
modules/bms/install/choices.sql (modified) (1 diff)
-
modules/bms/install/menu.sql (modified) (1 diff)
-
modules/bms/install/relationships.sql (modified) (1 diff)
-
modules/bms/install/reports.sql (modified) (1 diff)
-
modules/bms/install/tablecolumns.sql (modified) (1 diff)
-
modules/bms/install/tabledefs.sql (modified) (1 diff)
-
modules/bms/install/tablefindoptions.sql (modified) (1 diff)
-
modules/bms/install/tableoptions.sql (modified) (1 diff)
-
modules/bms/install/tablesearchablefields.sql (modified) (1 diff)
-
modules/bms/install/update.php (modified) (1 diff)
-
modules/bms/invoices_addedit.php (modified) (3 diffs)
-
modules/bms/invoices_attachments.php (modified) (1 diff)
-
modules/bms/products_attachments.php (modified) (1 diff)
-
modules/bms/products_saleshistory.php (modified) (1 diff)
-
modules/bms/report/clients_folderlabels.php (modified) (2 diffs)
-
modules/bms/report/clients_mailinglabels.php (modified) (2 diffs)
-
modules/bms/report/clients_purchasehistory.php (modified) (1 diff)
-
modules/bms/report/clients_shippinglabels.php (modified) (2 diffs)
-
modules/bms/snapshot.php (modified) (1 diff)
-
noaccess.html (deleted)
-
noaccess.php (added)
-
print.php (modified) (1 diff)
-
servefile.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/common/stylesheet/mozilla/forms.css
r162 r170 101 101 .buttonX{background:url(image/button-x.png) 0 0 no-repeat;} 102 102 .buttonTimeStamp{background:url(image/button-timestamp.png) 100% 0 no-repeat;padding-right:20px;font-size:11px;margin-right:6px;color:black;width:auto;} 103 .buttonDownload{background:url(image/button-download.png) 0 0 no-repeat;} 103 104 104 105 .buttonShowSQLUp{width:35px;background:url(image/button-sql-up.png) 0 0 no-repeat;} -
trunk/phpbms/common/stylesheet/mozilla/pages/tabledefs.css
r160 r170 6 6 #fsAttributes{float:right;width:200px;} 7 7 #id,ds-moduleid{width:98%} 8 #type{width:98%} 8 9 9 10 #leftSideDiv{margin-right:228px;padding-top:1px;} -
trunk/phpbms/common/stylesheet/mozilla/pages/users.css
r151 r170 9 9 #leftSideDiv{margin-right:228px;padding-top:1px;} 10 10 #firstnameP{float:left;} 11 12 #assignedrolesdiv{float:left; padding-right:10px;} 13 #assignedroles,#availableroles{width:150px;} 14 15 #rolebuttonsdiv{float:left;padding-top:20px;;padding-right:10px;} 16 #rolebuttonsdiv button{width:100px;} 17 18 #availablerolesdiv{} -
trunk/phpbms/include/common_functions.php
r166 r170 46 46 header("Location: ".$url); 47 47 exit; 48 } 49 50 function hasRights($roleid){ 51 $hasrights=false; 52 if($_SESSION["userinfo"]["admin"]==1) 53 $hasrights=true; 54 elseif($roleid==0) 55 $hasrights=true; 56 else 57 foreach($_SESSION["userinfo"]["roles"] as $role) 58 if($role==$roleid) 59 $hasrights=true; 60 61 return $hasrights; 62 } 63 64 function displayRights($roleid,$rolename,$dblink=false){ 65 switch($roleid){ 66 case 0: 67 echo "EVERYONE"; 68 break; 69 case -100: 70 echo "Administrators"; 71 break; 72 default: 73 if(!$rolename){ 74 if(!$dblink) 75 reportError(400,"displayRights needs a database link if rolename is not specified"); 76 $querystatement="SELECT name FROM roles WHERE id=".$roleid; 77 $queryresult=mysql_query($querystatement,$dblink); 78 if(!queryresult) reportError(400,"displayRights could not retrieve role name"); 79 $therecord=mysql_fetch_array($queryresult); 80 $rolename=$therecord["name"]; 81 } 82 echo $rolename; 83 } 48 84 } 49 85 … … 296 332 break; 297 333 case "filelink": 298 $value="<a href=\"".$_SESSION["app_path"]."servefile.php?i=".$value."\" style=\"display:block;\"><img src=\"".$_SESSION["app_path"]."common/stylesheet/".$_SESSION["stylesheet"]."/image/button-download.png\" align=\"middle\" alt=\"view\" width=\"16\" height=\"16\" border=\"0\" /></a>"; 334 $value="<button class=\"graphicButtons buttonDownload\" type=\"button\" onclick=\"document.location='".$_SESSION["app_path"]."servefile.php?i=".$value."'\"><span>download</span></button>"; 335 //$value="<a href=\"".$_SESSION["app_path"]."servefile.php?i=".$value."\" style=\"display:block;\"><img src=\"".$_SESSION["app_path"]."common/stylesheet/".$_SESSION["stylesheet"]."/image/button-download.png\" align=\"middle\" alt=\"view\" width=\"16\" height=\"16\" border=\"0\" /></a>"; 299 336 break; 300 337 case "noencoding": -
trunk/phpbms/include/fields.php
r161 r170 332 332 }//end required if 333 333 }//end function 334 335 function roles_choicelist($name,$selected,$dblink){ 336 $querystatement="SELECT name,id FROM roles WHERE inactive=0"; 337 $queryresult=mysql_query($querystatement,$dblink); 338 if(!$queryresult) reportError(310,"Error Retrieving Roles"); 339 ?><select id="<?php echo $name?>" name="<?php echo $name?>"> 340 <option value="0" <?php if($selected==0) echo "selected"?>>EVERYONE</option> 341 <?php while($therecord=mysql_fetch_array($queryresult)){ ?> 342 <option value="<?php echo $therecord["id"]?>" <?php if($selected==$therecord["id"]) echo "selected"?>><?php echo $therecord["name"]?></option> 343 <?php }?> 344 <option value="-100" <?php if($selected==-100) echo "selected"?>>Administrators</option> 345 </select><?php 346 } 334 347 ?> -
trunk/phpbms/include/login_include.php
r166 r170 40 40 $thereturn="Login Failed"; 41 41 42 $querystatement="SELECT id, firstname, lastname, accesslevel, email, phone, department, employeenumber42 $querystatement="SELECT id, firstname, lastname, email, phone, department, employeenumber, admin 43 43 FROM users 44 WHERE login=\"".$username."\" and password=ENCODE(\"".$password."\",\"".$seed."\") and revoked=0 and accesslevel>=10";44 WHERE login=\"".$username."\" and password=ENCODE(\"".$password."\",\"".$seed."\") and revoked=0 and portalaccess=0"; 45 45 $queryresult=mysql_query($querystatement,$dblink); 46 if(!$queryresult) 47 reportError(300,"Error verifing user record"); 46 if(!$queryresult) reportError(300,"Error verifing user record: ".$querystatement); 48 47 if(mysql_num_rows($queryresult)){ 49 48 //We found a record that matches in the database 50 49 // populate the session and go in 51 50 $_SESSION["userinfo"]=mysql_fetch_array($queryresult); 51 52 // Next get the users roles, and populate the session with them 53 $_SESSION["userinfo"]["roles"][]=0; 54 $querystatement="SELECT roleid FROM rolestousers WHERE userid=".$_SESSION["userinfo"]["id"]; 55 $rolesqueryresult=mysql_query($querystatement,$dblink); 56 if(!$rolesqueryresult) reportError(310,"Error obtaining user roles."); 57 while($rolerecord=mysql_fetch_array($rolesqueryresult)) 58 $_SESSION["userinfo"]["roles"][]=$rolerecord["roleid"]; 52 59 53 60 // set application location (web, not physical) -
trunk/phpbms/include/print_class.php
r166 r170 60 60 $this->maintable=$therecord["maintable"]; 61 61 62 63 $securitywhere=""; 64 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 65 $securitywhere=" AND roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 62 66 $querystatement="SELECT id,name,reportfile,type,description,displayorder FROM reports 63 WHERE (tabledefid=0 or tabledefid=".$this->tableid.") and accesslevel <= ".$_SESSION["userinfo"]["accesslevel"]." ORDER BY tabledefid desc, displayorder desc,name";67 WHERE (tabledefid=0 or tabledefid=".$this->tableid.") ".$securitywhere." ORDER BY tabledefid desc, displayorder desc,name"; 64 68 $queryresult=mysql_query($querystatement,$dblink); 65 69 if(!$queryresult) reportError(500,"Error retreving reports."); … … 80 84 global $dblink; 81 85 82 $querystring="SELECT id,name,userid FROM usersearches WHERE tabledefid=".$this->tableid." and type=\"".$type."\" and((userid=0 and accesslevel<=".$_SESSION["userinfo"]["accesslevel"].") or userid=\"".$userid."\") order by userid,name"; 86 $securitywhere=""; 87 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 88 $securitywhere=" AND roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 89 $querystring="SELECT id,name,userid FROM usersearches WHERE tabledefid=".$this->tableid." and type=\"".$type."\" and((userid=0 ".$securitywhere.") or userid=\"".$userid."\") order by userid,name"; 83 90 $thequery = mysql_query($querystring,$dblink); 84 91 return $thequery; -
trunk/phpbms/include/search_class.php
r155 r170 55 55 $querystatement="SELECT tabledefs.id,maintable,querytable,tabledefs.displayname,addfile,editfile,deletebutton,type, 56 56 defaultwhereclause,defaultsortorder,defaultsearchtype,defaultcriteriafindoptions,defaultcriteriaselection, 57 modules.name 57 modules.name,searchroleid,advsearchroleid,viewsqlroleid 58 58 FROM tabledefs inner join modules on tabledefs.moduleid=modules.id 59 59 WHERE tabledefs.id=".$id; … … 65 65 66 66 $therecord=mysql_fetch_array($queryresult); 67 68 if(!hasRights($therecord["searchroleid"])) 69 goURL($_SESSION["app_path"]."noaccess.php"); 67 70 68 71 return $therecord; … … 95 98 <th nowrap align="<?php echo $therow["align"]?>" <?php if($therow["size"]) echo "width=\"".$therow["size"]."\" ";?> > 96 99 <input name="sortit<?php echo $i?>" type="hidden" value="<?php echo $therow["name"]?>" /> 97 <a href="/" on Click="doSort(<?php echo $i?>);return false;"><?php echo $therow["name"]?></a>100 <a href="/" onclick="doSort(<?php echo $i?>);return false;"><?php echo $therow["name"]?></a> 98 101 <?php 99 102 // If sorting on this column give the option to reverse the sort order. 100 103 if ($this->querysortorder==$therow["column"] || $this->querysortorder==$therow["sortorder"]) 101 {?> <a href="/" on Click="doDescSort();return false;"><img src="<?php echo $_SESSION["app_path"]?>common/image/down_arrow.gif" alt="dn" title="dn" width="10" height="10" border="0" /></a><input name="desc" type="hidden" value="" />104 {?> <a href="/" onclick="doDescSort();return false;"><img src="<?php echo $_SESSION["app_path"]?>common/image/down_arrow.gif" alt="dn" title="dn" width="10" height="10" border="0" /></a><input name="desc" type="hidden" value="" /> 102 105 <?php } elseif ($this->querysortorder==$therow["column"]." DESC" || $this->querysortorder==$therow["sortorder"]." DESC") 103 {?> <a href="/" on Click="doSort(<?php echo $i?>);return false;"><img src="<?php echo $_SESSION["app_path"]?>common/image/up_arrow.gif" alt="up" title="up" width="10" height="10" border="0" /></a>106 {?> <a href="/" onclick="doSort(<?php echo $i?>);return false;"><img src="<?php echo $_SESSION["app_path"]?>common/image/up_arrow.gif" alt="up" title="up" width="10" height="10" border="0" /></a> 104 107 <?php } ?></th><?php 105 108 $i++; … … 337 340 338 341 $options=Array(); 339 $querystatement="SELECT name,`option`,othercommand, accesslevel342 $querystatement="SELECT name,`option`,othercommand,roleid 340 343 FROM tableoptions WHERE tabledefid=".$id; 341 344 $queryresult=mysql_query($querystatement,$dblink); … … 345 348 if($therecord["othercommand"]) { 346 349 $options["othercommands"][$therecord["name"]]["displayname"]=$therecord["option"]; 347 $options["othercommands"][$therecord["name"]][" accesslevel"]=$therecord["accesslevel"];350 $options["othercommands"][$therecord["name"]]["roleid"]=$therecord["roleid"]; 348 351 }else{ 349 352 $options[$therecord["name"]]["allowed"]=$therecord["option"]; 350 $options[$therecord["name"]][" accesslevel"]=$therecord["accesslevel"];353 $options[$therecord["name"]]["roleid"]=$therecord["roleid"]; 351 354 } 352 355 } … … 358 361 359 362 $findoptions=Array(); 360 $querystatement="SELECT name,search, accesslevel363 $querystatement="SELECT name,search,roleid 361 364 FROM tablefindoptions WHERE tabledefid=".$id." ORDER BY displayorder"; 362 365 $queryresult=mysql_query($querystatement,$dblink); … … 402 405 <ul class="tabs"> 403 406 <li id="basicSearchT" class="tabsSel"><a href="/" onClick="switchSearchTabs(this);return false">basic</a></li> 404 <?php if( $_SESSION["userinfo"]["accesslevel"]>=30){?><li id="advancedSearchT"><a href="/" onClick="switchSearchTabs(this,'<?php echo $_SESSION["app_path"]?>');return false">advanced</a></li><?php } //end accesslevel?>407 <?php if(hasRights($this->thetabledef["advsearchroleid"])){?><li id="advancedSearchT"><a href="/" onClick="switchSearchTabs(this,'<?php echo $_SESSION["app_path"]?>');return false">advanced</a></li><?php } //end access ?> 405 408 <li id="loadSearchT"><a href="/" onClick="switchSearchTabs(this,'<?php echo $_SESSION["app_path"]?>');return false">load search</a></li> 406 409 <li id="saveSearchT"><a href="/" onClick="switchSearchTabs(this,'<?php echo $_SESSION["app_path"]?>');return false">save search</a></li> … … 417 420 <?php 418 421 for($i=0;$i<count($this->findoptions);$i++) { 419 if( $this->findoptions[$i]["accesslevel"]<=$_SESSION["userinfo"]["accesslevel"]){422 if(hasRights($this->findoptions[$i]["roleid"])){ 420 423 ?><option value="<?php echo $this->findoptions[$i]["name"]?>"<?php 421 424 if($this->querytype=="search" and $this->findoptions[$i]["name"]==$this->savedfindoptions) echo "selected"; … … 469 472 </tr> 470 473 </table> 471 </div><?php if( $_SESSION["userinfo"]["accesslevel"]>=30){?><div id="advancedSearchTab" style="display:none;"></div><?php } //end accesslevel?>474 </div><?php if(hasRights($this->thetabledef["advsearchroleid"])){?><div id="advancedSearchTab" style="display:none;"></div><?php } //end access ?> 472 475 <div id="loadSearchTab" style="display:none;padding:0px;margin:0px;"></div> 473 476 <div id="saveSearchTab" style="display:none;margin:0px;padding:0px;margin:0px;"> … … 494 497 if(!isset($this->tableoptions["new"])){ 495 498 $this->tableoptions["new"]["allowed"]=0; 496 $this->tableoptions["new"][" accesslevel"]=0;499 $this->tableoptions["new"]["roleid"]=0; 497 500 } 498 501 if(!isset($this->tableoptions["select"])) { 499 502 $this->tableoptions["select"]["allowed"]=0; 500 $this->tableoptions["select"][" accesslevel"]=0;503 $this->tableoptions["select"]["roleid"]=0; 501 504 } 502 505 if(!isset($this->tableoptions["edit"])){ 503 506 $this->tableoptions["edit"]["allowed"]=0; 504 $this->tableoptions["edit"][" accesslvel"]=0;507 $this->tableoptions["edit"]["roleid"]=0; 505 508 } 506 509 if(!isset($this->tableoptions["printex"])) { 507 510 $this->tableoptions["printex"]["allowed"]=0; 508 $this->tableoptions["printex"][" accesslevel"]=0;511 $this->tableoptions["printex"]["roleid"]=0; 509 512 } 510 513 if(!isset($this->tableoptions["othercommands"])) $this->tableoptions["othercommands"]=false; 511 if( $_SESSION["userinfo"]["accesslevel"]>=90){?>514 if(hasRights($this->thetabledef["viewsqlroleid"])){?> 512 515 <div id="sqlstatement"> 513 516 <fieldset> … … 546 549 <div id="recordCommands"> 547 550 <?php 548 if ($this->tableoptions["new"]["allowed"] && $_SESSION["userinfo"]["accesslevel"]>=$this->tableoptions["new"]["accesslevel"])551 if ($this->tableoptions["new"]["allowed"] && hasRights($this->tableoptions["new"]["roleid"])) 549 552 { 550 553 ?><button type="button" accesskey="n" class="graphicButtons buttonNew" onClick="addRecord()" title="new (alt+n)"><span>new</span></button><?php … … 552 555 553 556 if($this->numrows) { 554 if ($this->tableoptions["edit"]["allowed"] && $_SESSION["userinfo"]["accesslevel"]>=$this->tableoptions["edit"]["accesslevel"]) {557 if ($this->tableoptions["edit"]["allowed"] && hasRights($this->tableoptions["edit"]["roleid"])) { 555 558 ?><button id="edit" accesskey="e" type="button" disabled="true" class="graphicButtons buttonEditDisabled" onClick="editThis()" title="edit (alt+e)"><span>edit</span></button><?php 556 559 } 557 560 558 if($this->tableoptions["printex"]["allowed"] && $_SESSION["userinfo"]["accesslevel"]>=$this->tableoptions["printex"]["accesslevel"]){561 if($this->tableoptions["printex"]["allowed"] && hasRights($this->tableoptions["printex"]["roleid"])){ 559 562 ?><button id="print" accesskey="p" type="submit" disabled="true" class="graphicButtons buttonPrintDisabled" name="doprint" title="print (alt+p)"><span>print</span></button><?php 560 563 } … … 572 575 if($this->tableoptions["othercommands"]){ 573 576 foreach($this->tableoptions["othercommands"] as $key => $value){ 574 if( $_SESSION["userinfo"]["accesslevel"]>=$value["accesslevel"]){577 if(hasRights($value["roleid"])){ 575 578 ?><option value="<?php echo $key?>"><?php echo $value["displayname"]?></option><?php 576 579 } … … 579 582 ?></select><?php 580 583 } 581 if($this->tableoptions["select"]["allowed"] && $_SESSION["userinfo"]["accesslevel"]>=$this->tableoptions["select"]["accesslevel"]){?> <select id="searchSelection" onChange="perfromToSelection(this)">584 if($this->tableoptions["select"]["allowed"] && hasRights($this->tableoptions["select"]["roleid"])){?> <select id="searchSelection" onChange="perfromToSelection(this)"> 582 585 <option class="choiceListBlank" value="">selection...</option> 583 586 <option value="">_____________</option> … … 590 593 591 594 }//end if numrows 592 if( $_SESSION["userinfo"]["accesslevel"]>=90){?><button id="showSQLButton" type="button" class="graphicButtons buttonShowSQLDown"><span>Show SQL</span></button><?php }//end accesslevel?>595 if(hasRights($this->thetabledef["viewsqlroleid"])){?><button id="showSQLButton" type="button" class="graphicButtons buttonShowSQLDown"><span>Show SQL</span></button><?php }//end rights?> 593 596 </div><script language="JavaScript" type="text/javascript"> 594 597 var addFile="<?php echo $_SESSION["app_path"].$this->thetabledef["addfile"]?>"; -
trunk/phpbms/include/session.php
r169 r170 133 133 if (!isset($_SESSION["userinfo"]) && basename($_SERVER["PHP_SELF"]) != "index.php") { 134 134 if(isset($loginNoKick)){ 135 if(!isset($loginNoDisplayError)){ 136 header("Location: ".$mainpath."noaccess.html"); 135 if(!isset($loginNoDisplayError)) 137 136 exit(); 138 }139 137 else 140 138 $dblink = openDB($_SESSION["mysql_server"],$_SESSION["mysql_user"],$_SESSION["mysql_userpass"],$_SESSION["mysql_database"]); -
trunk/phpbms/install/ updatev0.7.sql
r154 r170 13 13 ALTER TABLE tablecolumns CHANGE COLUMN `format` `format` enum('date','time','currency','boolean','datetime','filelink','noencoding') default NULL; 14 14 UPDATE tablecolumns SET format="noencoding" WHERE `column` like "%<%"; 15 UPDATE tablecolumns SET name="inherent" WHERE id=93; 15 UPDATE tablecolumns SET name="inherent" WHERE id=93; 16 ALTER TABLE users ADD COLUMN admin tinyint(4) NOT NULL DEFAULT 0; 17 ALTER TABLE users ADD COLUMN portalaccess tinyint(4) NOT NULL DEFAULT 0; 18 CREATE TABLE `roles` (`id` INTEGER UNSIGNED DEFAULT NULL AUTO_INCREMENT, `name` VARCHAR(64) NOT NULL,`description` TEXT,`inactive` tinyint(4) NOT NULL,`createdby` INTEGER UNSIGNED,`creationdate` DATETIME,`modifiedby` INTEGER UNSIGNED,`modifieddate` TIMESTAMP,PRIMARY KEY(`id`))TYPE = MyISAM; 19 INSERT INTO `roles` (`id`,`name`,`description`,`inactive`,`createdby`,`creationdate`,`modifiedby`) VALUES (10,'shipping','Basic user access only.',0,1,NOW(),1); 20 INSERT INTO `roles` (`id`,`name`,`description`,`inactive`,`createdby`,`creationdate`,`modifiedby`) VALUES (20,'sales','Power User.',0,1,NOW(),1); 21 INSERT INTO `roles` (`id`,`name`,`description`,`inactive`,`createdby`,`creationdate`,`modifiedby`) VALUES (30,'sales manager','',0,1,NOW(),1); 22 INSERT INTO `roles` (`id`,`name`,`description`,`inactive`,`createdby`,`creationdate`,`modifiedby`) VALUES (50,'upper manager','',0,1,NOW(),1); 23 CREATE TABLE `rolestousers` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `userid` INTEGER UNSIGNED NOT NULL, `roleid` INTEGER UNSIGNED NOT NULL, PRIMARY KEY(`id`)) TYPE = MYISAM; 24 UPDATE users SET admin=1 WHERE accesslevel>=90; 25 UPDATE users SET portalaccess=1 WHERE accesslevel<0; 26 UPDATE users set accesslevel=0 WHERE accesslevel<0 or accesslevel>=90; 27 ALTER TABLE menu CHANGE accesslevel roleid int(11) NOT NULL default '0'; 28 UPDATE tablecolumns SET name='access', `column`='if(menu.roleid=0,\'EVERYONE\',if(menu.roleid=-100,\'Administrators\',roles.name))',sortorder='' WHERE id=88; 29 UPDATE tabledefs SET querytable="((menu LEFT JOIN menu as parentmenu on menu.parentid=parentmenu.id) LEFT JOIN roles on menu.roleid=roles.id)" WHERE id=19; 30 UPDATE menu SET roleid=0 WHERE roleid<0; 31 UPDATE menu SET roleid=-100 WHERE roleid>=90; 32 UPDATE menu SET roleid=-100 WHERE parentid=15; 33 UPDATE menu SET roleid=0 WHERE parentid=14 or id=14; 34 ALTER TABLE tabledefs ADD COLUMN searchroleid int(11) NOT NULL DEFAULT 0; 35 ALTER TABLE tabledefs ADD COLUMN addroleid int(11) NOT NULL DEFAULT 0; 36 ALTER TABLE tabledefs ADD COLUMN editroleid int(11) NOT NULL DEFAULT 0; 37 ALTER TABLE tabledefs ADD COLUMN advsearchroleid int(11) NOT NULL DEFAULT -100; 38 ALTER TABLE tabledefs ADD COLUMN viewsqlroleid int(11) NOT NULL DEFAULT -100; 39 UPDATE tabledefs set searchroleid=-100,addroleid=-100,editroleid=-100 WHERE moduleid=1 AND id IN(21,26,19,10,11,9,200,17); 40 UPDATE tableoptions set accesslevel=0 WHERE accesslevel <0; 41 UPDATE tableoptions set accesslevel=-100 WHERE accesslevel >=90; 42 ALTER TABLE tableoptions CHANGE accesslevel roleid int(11) NOT NULL default '0'; 43 UPDATE tablefindoptions set accesslevel=0 WHERE accesslevel <0; 44 UPDATE tablefindoptions set accesslevel=0 WHERE accesslevel =11; 45 UPDATE tablefindoptions set accesslevel=-100 WHERE accesslevel >=90; 46 ALTER TABLE tablefindoptions CHANGE accesslevel roleid int(11) NOT NULL default '0'; 47 UPDATE files set accesslevel=0 WHERE accesslevel <0; 48 UPDATE files set accesslevel=-100 WHERE accesslevel >=90; 49 ALTER TABLE files CHANGE accesslevel roleid int(11) NOT NULL default '0'; 50 UPDATE usersearches set accesslevel=0 WHERE accesslevel <0; 51 UPDATE usersearches set accesslevel=-100 WHERE accesslevel >=90; 52 ALTER TABLE usersearches CHANGE accesslevel roleid int(11) NOT NULL default '0'; 53 UPDATE reports set accesslevel=0 WHERE accesslevel <0; 54 UPDATE reports set accesslevel=-100 WHERE accesslevel >=90; 55 ALTER TABLE reports CHANGE accesslevel roleid int(11) NOT NULL default '0'; 56 ALTER TABLE `phpbms`.`users` DROP COLUMN `accesslevel`; -
trunk/phpbms/install/choices.sql
r145 r170 1 INSERT INTO choices VALUES (1 05,'department','management');2 INSERT INTO choices VALUES ( 104,'department','accounting');3 INSERT INTO choices VALUES ( 103,'department','');4 INSERT INTO choices VALUES ( 130,'notestatus','cancelled');5 INSERT INTO choices VALUES ( 131,'notestatus','tenative');6 INSERT INTO choices VALUES ( 132,'notestatus','confirmed');7 INSERT INTO choices VALUES ( 129,'notestatus','');1 INSERT INTO choices VALUES (1,'department','management'); 2 INSERT INTO choices VALUES (2,'department','accounting'); 3 INSERT INTO choices VALUES (3,'department',''); 4 INSERT INTO choices VALUES (4,'notestatus','cancelled'); 5 INSERT INTO choices VALUES (5,'notestatus','tenative'); 6 INSERT INTO choices VALUES (6,'notestatus','confirmed'); 7 INSERT INTO choices VALUES (7,'notestatus',''); -
trunk/phpbms/install/createtables.sql
r146 r170 16 16 creationdate datetime NOT NULL default '0000-00-00 00:00:00', 17 17 modifieddate timestamp(14) NOT NULL, 18 accesslevelint(11) NOT NULL default '0',18 roleid int(11) NOT NULL default '0', 19 19 PRIMARY KEY (id) 20 20 ) TYPE=MyISAM; … … 81 81 ) TYPE=MyISAM PACK_KEYS=0; 82 82 83 CREATE TABLE reports ( 84 description text, 85 id int(11) NOT NULL auto_increment, 86 name varchar(64) default NULL, 87 reportfile varchar(128) default NULL, 88 type varchar(32) default NULL, 89 createdby int(11) NOT NULL default '0', 90 creationdate datetime NOT NULL default '0000-00-00 00:00:00', 91 modifiedby int(11) default NULL, 92 modifieddate timestamp(14) NOT NULL, 93 tabledefid int(11) NOT NULL default '0', 94 displayorder int(11) NOT NULL default '0', 95 accesslevel int(11) NOT NULL default '0', 96 UNIQUE KEY theid (id) 97 ) TYPE=MyISAM PACK_KEYS=0; 98 83 CREATE TABLE `reports` ( 84 `id` int(11) NOT NULL auto_increment, 85 `name` varchar(64) default NULL, 86 `type` varchar(32) default NULL, 87 `tabledefid` int(11) NOT NULL default '0', 88 `displayorder` int(11) NOT NULL default '0', 89 `roleid` int(11) NOT NULL default '0', 90 `reportfile` varchar(128) default NULL, 91 `description` text, 92 `createdby` int(11) NOT NULL default '0', 93 `creationdate` datetime NOT NULL default '0000-00-00 00:00:00', 94 `modifiedby` int(11) default NULL, 95 `modifieddate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, 96 PRIMARY KEY (`id`) 97 ) ENGINE=MyISAM 99 98 100 99 CREATE TABLE `tablecolumns` ( … … 115 114 ) TYPE=MyISAM AUTO_INCREMENT=5000; 116 115 117 CREATE TABLE `tabledefs` ( 118 `editfile` varchar(128) default NULL, 119 `displayname` varchar(64) default NULL, 120 `id` int(11) NOT NULL auto_increment, 121 `maintable` varchar(64) NOT NULL default '', 122 `createdby` int(11) NOT NULL default '0', 123 `creationdate` datetime NOT NULL default '0000-00-00 00:00:00', 124 `modifiedby` int(11) default NULL, 125 `modifieddate` timestamp(14) NOT NULL, 126 `querytable` varchar(255) NOT NULL default '', 127 `addfile` varchar(100) default '', 128 `deletebutton` varchar(32) default '', 129 `defaultwhereclause` varchar(255) default NULL, 130 `defaultsortorder` varchar(255) default '', 131 `defaultsearchtype` varchar(64) default '', 132 `defaultcriteriafindoptions` varchar(128) default '', 133 `defaultcriteriaselection` varchar(128) default '', 134 `type` varchar(16) NOT NULL default 'table', 135 `moduleid` int(11) NOT NULL default '0', 136 PRIMARY KEY (`id`) 137 ) TYPE=MyISAM AUTO_INCREMENT=1000; 116 CREATE TABLE `tabledefs` ( 117 `id` int(11) NOT NULL, 118 `displayname` varchar(64) default NULL, 119 `type` varchar(16) NOT NULL default 'table', 120 `moduleid` int(11) NOT NULL default '0', 121 `maintable` varchar(64) NOT NULL default '', 122 `querytable` varchar(255) NOT NULL default '', 123 `editfile` varchar(128) default NULL, 124 `editroleid` int(11) NOT NULL default '0', 125 `addfile` varchar(100) default '', 126 `addroleid` int(11) NOT NULL default '0', 127 `searchroleid` int(11) NOT NULL default '0', 128 `advsearchroleid` int(11) NOT NULL default '-100', 129 `viewsqlroleid` int(11) NOT NULL default '-100', 130 `deletebutton` varchar(32) default '', 131 `defaultwhereclause` varchar(255) default NULL, 132 `defaultsortorder` varchar(255) default '', 133 `defaultsearchtype` varchar(64) default '', 134 `defaultcriteriafindoptions` varchar(128) default '', 135 `defaultcriteriaselection` varchar(128) default '', 136 `createdby` int(11) NOT NULL default '0', 137 `creationdate` datetime NOT NULL default '0000-00-00 00:00:00', 138 `modifiedby` int(11) default NULL, 139 `modifieddate` timestamp NOT NULL default CURRENT_TIMESTAMP, 140 PRIMARY KEY (`id`) 141 ) ENGINE=MyISAM AUTO_INCREMENT=1000; 138 142 139 143 CREATE TABLE tablefindoptions ( … … 143 147 search varchar(255) NOT NULL default '', 144 148 displayorder int(11) NOT NULL default '0', 145 accesslevelint(11) NOT NULL default '0',149 roleid int(11) NOT NULL default '0', 146 150 PRIMARY KEY (id), 147 151 KEY tabledef (tabledefid) … … 154 158 `option` varchar(128) NOT NULL default '', 155 159 othercommand tinyint(1) NOT NULL default '0', 156 accesslevelint(11) NOT NULL default '0',160 roleid int(11) NOT NULL default '0', 157 161 PRIMARY KEY (id), 158 162 KEY tabledef (tabledefid) … … 177 181 creationdate datetime NOT NULL default '0000-00-00 00:00:00', 178 182 revoked tinyint(1) NOT NULL default '0', 179 accesslevel int(11) default '1',180 183 createdby int(11) NOT NULL default '0', 181 184 modifiedby int(11) default '0', … … 197 200 sqlclause text, 198 201 type char(3) NOT NULL default 'SCH', 199 accesslevelint(11) NOT NULL default '0',202 roleid int(11) NOT NULL default '0', 200 203 PRIMARY KEY (id), 201 204 KEY tabledefid (tabledefid), … … 221 224 `modifiedby` int(11) default '0', 222 225 `modifieddate` timestamp(14) NOT NULL, 223 ` accesslevel` int(11) NOT NULL default '0',226 `roleid` int(11) NOT NULL default '0', 224 227 PRIMARY KEY (`id`) 225 228 ) TYPE=MyISAM AUTO_INCREMENT=100; … … 239 242 KEY `thefile` (`fileid`) 240 243 ) TYPE=MyISAM; 244 245 CREATE TABLE `roles` ( 246 `id` INTEGER UNSIGNED DEFAULT NULL AUTO_INCREMENT, 247 `name` VARCHAR(64) NOT NULL, 248 `description` TEXT, 249 `inactive` tinyint(4) NOT NULL, 250 `createdby` INTEGER UNSIGNED, 251 `creationdate` DATETIME, 252 `modifiedby` INTEGER UNSIGNED, 253 `modifieddate` TIMESTAMP, 254 PRIMARY KEY(`id`) 255 ) TYPE = MyISAM; 256 257 CREATE TABLE `rolestousers` ( 258 `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 259 `userid` INTEGER UNSIGNED NOT NULL, 260 `roleid` INTEGER UNSIGNED NOT NULL, 261 PRIMARY KEY(`id`) 262 ) TYPE = MYISAM; -
trunk/phpbms/install/installxml.php
r145 r170 172 172 $thereturn.=importData("settings"); 173 173 $thereturn.=importData("files"); 174 $thereturn.=importData("roles"); 174 175 $thereturn.="\nDone Importing Data\n===========================\n"; 175 176 -
trunk/phpbms/install/menu.sql
r145 r170 1 INSERT INTO menu VALUES (14,'Organizer','',0,3,2,2,'2004-04-08 14:30:58',20051012120012,10); 2 INSERT INTO menu VALUES (15,'Admin','',0,4,2,2,'2004-04-08 14:31:36',20050209120312,90); 3 INSERT INTO menu VALUES (16,'Notes','search.php?id=12',14,1,2,2,'2005-09-09 10:09:50',20051012120012,10); 4 INSERT INTO menu VALUES (17,'Tasks','search.php?id=23',14,2,2,2,'2005-09-09 10:10:08',20051012120012,10); 5 INSERT INTO menu VALUES (18,'Events','search.php?id=24',14,3,2,2,'2005-09-09 10:10:40',20051012120012,10); 6 INSERT INTO menu VALUES (19,'Snapshot','modules/base/snapshot.php',14,0,2,2,'2005-09-16 12:19:17',20051012120012,10); 7 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('settings','modules/base/adminsettings.php',15,10,2,2,'2006-10-16 05:19:30','2006-10-19 21:32:14',90); 8 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('modules','search.php?id=21',15,99,2,2,'2006-10-16 05:20:31','2006-10-19 21:32:53',90); 9 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('menu','search.php?id=19',15,30,2,2,'2006-10-16 05:21:14','2006-10-19 21:33:14',90); 10 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('table definitions','search.php?id=11',15,80,2,2,'2006-10-16 05:21:59','2006-10-19 21:33:59',90); 11 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('files','search.php?id=26',15,30,2,2,'2006-10-16 05:22:31','2006-10-19 21:34:08',90); 12 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('users','search.php?id=9',15,20,2,2,'2006-10-16 05:23:27','2006-10-19 21:32:36',90); 13 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('----','N/A',15,15,2,2,'2006-10-19 15:26:58','2006-10-19 21:33:32',90); 14 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('reports','search.php?id=16',15,50,2,2,'2006-10-19 15:42:58','2006-10-19 21:43:19',-90); 15 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('relationships','search.php?id=10',15,60,2,2,'2006-10-19 15:44:10','2006-10-19 21:44:10',90); 16 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('Saved Searchs/Sorts','search.php?id=17',15,40,2,2,'2006-10-19 15:44:54','2006-10-19 21:44:54',90); 17 INSERT INTO `menu` (name,link,parentid,displayorder,createdby,modifiedby,creationdate,modifieddate,accesslevel) VALUES ('----','N/A',15,45,2,2,'2006-10-19 15:45:18','2006-10-19 21:45:18',90); 1 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (1,'Organizer','',0,3,1,1,NOW(),NOW(),0); 2 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (2,'Notes','search.php?id=12',1,1,1,1,NOW(),NOW(),0); 3 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (3,'Tasks','search.php?id=23',1,2,1,1,NOW(),NOW(),0); 4 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (4,'Events','search.php?id=24',1,3,1,1,NOW(),NOW(),0); 5 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (5,'Snapshot','modules/base/snapshot.php',1,0,1,1,NOW(),NOW(),0); 6 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (6,'Admin','',0,4,1,1,NOW(),NOW(),-100); 7 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (7,'settings','modules/base/adminsettings.php',6,10,1,1,NOW(),NOW(),-100); 8 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (8,'----','N/A',6,11,1,1,NOW(),NOW(),-100); 9 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (9,'users','search.php?id=9',6,20,1,1,NOW(),NOW(),-100); 10 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (10,'roles','search.php?id=200',6,21,1,1,NOW(),NOW(),-100); 11 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (11,'----','',6,22,1,1,NOW(),NOW(),-100); 12 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (12,'menu','search.php?id=19',6,30,1,1,NOW(),NOW(),-100); 13 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (13,'files','search.php?id=26',6,30,1,1,NOW(),NOW(),-100); 14 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (14,'Saved Searchs/Sorts','search.php?id=17',6,40,1,1,NOW(),NOW(),-100); 15 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (15,'----','N/A',6,45,1,1,NOW(),NOW(),-100); 16 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (16,'reports','search.php?id=16',6,50,1,1,NOW(),NOW(),-100); 17 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (17,'relationships','search.php?id=10',6,60,1,1,NOW(),NOW(),-100); 18 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (18,'table definitions','search.php?id=11',6,80,1,1,NOW(),NOW(),-100); 19 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (19,'modules','search.php?id=21',6,99,1,1,NOW(),NOW(),-100); -
trunk/phpbms/install/reports.sql
r145 r170 1 INSERT INTO reports VALUES ('This report will prints out of every field for the table for the given records. The report is displayed HTML format.',4,'Raw Table Print','report/general_tableprint.php','report',2,'2003-01-28 12:15:01',2,20051021180104,0,0,30);2 INSERT INTO reports VALUES ('This report will generate a tab-delimited text file. Values are encapsulated in quotes, and the first line lists the field names.',5,'Raw Table Export','report/general_export.php','export',2,'2003-01-28 18:10:35',2,20051021180057,0,0,30);3 INSERT INTO reports VALUES ('PDF report giving basic note information (subject,dates,content) . By deault, the notes are shown in chronological order.',19,'Note Summary','modules/base/report/notes_summary.php','PDF Report',18,'2005-03-30 16:41:39',2,20050401143706,12,50,0);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()); -
trunk/phpbms/install/tablecolumns.sql
r154 r170 1 INSERT INTO tablecolumns VALUES (100,9,'log in name','users.login','left','',2,'',0,'',NULL); 2 INSERT INTO tablecolumns VALUES (3,9,'id','users.id','left','',0,'',0,'',NULL); 3 INSERT INTO tablecolumns VALUES (5,9,'name','concat(users.firstname,\" \",users.lastname)','left','',1,'',0,'100%',NULL); 4 INSERT INTO tablecolumns VALUES (6,9,'last login','users.lastlogin','left','',4,'',0,'','datetime'); 5 INSERT INTO tablecolumns VALUES (7,9,'revoked','users.revoked','center','',3,'',0,'','boolean'); 6 INSERT INTO tablecolumns VALUES (20,10,'name','relationships.name','left','',3,'',0,'100%',NULL); 7 INSERT INTO tablecolumns VALUES (92,10,'to field','relationships.tofield','left','',5,'',0,'',NULL); 8 INSERT INTO tablecolumns VALUES (91,10,'from field','relationships.fromfield','left','',2,'',0,'',NULL); 9 INSERT INTO tablecolumns VALUES (90,10,'to table','totable.displayname','left','',4,'',0,'',NULL); 10 INSERT INTO tablecolumns VALUES (89,10,'from table','fromtable.displayname','left','',1,'',0,'',NULL); 11 INSERT INTO tablecolumns VALUES (93,10,'inherent','relationships.inherint','center','',6,'',0,'','boolean'); 12 INSERT INTO tablecolumns VALUES (19,10,'id','relationships.id','center','',0,'',0,'',NULL); 13 INSERT INTO tablecolumns VALUES (8,11,'id','tabledefs.id','center','',0,'',0,'',NULL); 14 INSERT INTO tablecolumns VALUES (9,11,'main table','tabledefs.maintable','left','',4,'',0,'100%',NULL); 15 INSERT INTO tablecolumns VALUES (10,11,'display','concat(\"<strong>\",tabledefs.displayname,\"</strong>\")','left','',3,'tabledefs.displayname',0,'','noencoding'); 16 INSERT INTO tablecolumns VALUES (43,11,'type','tabledefs.type','center','',2,'',0,'',NULL); 17 INSERT INTO tablecolumns VALUES (96,11,'module','modules.name','left','',1,'',0,'',NULL); 18 INSERT INTO tablecolumns VALUES (121,12,'category','notes.category','left','',3,'',0,'',NULL); 19 INSERT INTO tablecolumns VALUES (120,12,'done','notes.completed','center','',5,'',0,'','boolean'); 20 INSERT INTO tablecolumns VALUES (131,12,'type','concat(\"<B>\",notes.type,\"</B>\")','center','',2,'',0,'','noencoding'); 21 INSERT INTO tablecolumns VALUES (39,12,'title','notes.subject','left','',4,'',1,'90%',NULL); 22 INSERT INTO tablecolumns VALUES (34,12,'id','notes.id','center','',0,'',0,'',NULL); 23 INSERT INTO tablecolumns VALUES (119,12,'!','ELT(notes.importance+3,\" \",\"·\",\"-\",\"*\",\"!\",\"<b style=\'color:blue\'>!</b>\")','center','',1,'notes.importance',0,'','noencoding'); 24 INSERT INTO tablecolumns VALUES (26,16,'id','reports.id','center','',0,'',0,'',NULL); 25 INSERT INTO tablecolumns VALUES (28,16,'name','concat(\"<strong>\",reports.name,\"</strong>\")','left','reports.name',2,'',0,'','noencoding'); 26 INSERT INTO tablecolumns VALUES (29,16,'type','reports.type','left','',4,'',0,'100%',NULL); 27 INSERT INTO tablecolumns VALUES (111,16,'order','reports.displayorder','center','',3,'',0,'',NULL); 28 INSERT INTO tablecolumns VALUES (94,16,'table','if(tabledefs.displayname is null,\"<b>global</b>\",tabledefs.displayname)','left','',1,'',0,'','noencoding'); 29 INSERT INTO tablecolumns VALUES (30,17,'id','usersearches.id','center','',0,'',0,'',NULL); 30 INSERT INTO tablecolumns VALUES (31,17,'name','usersearches.name','left','',1,'',0,'100%',NULL); 31 INSERT INTO tablecolumns VALUES (32,17,'user','if(usersearches.userid=0,\"<b>global</b>\",concat(users.lastname,\", \",users.firstname))','left','',2,'',0,'','noencoding'); 32 INSERT INTO tablecolumns VALUES (33,17,'table','tabledefs.maintable','left','',4,'',0,'',NULL); 33 INSERT INTO tablecolumns VALUES (101,17,'type','if(usersearches.type=\"SCH\",\"Search\",\"Sort\")','left','',3,'usersearches.type',0,'',NULL); 34 INSERT INTO tablecolumns VALUES (82,19,'id','menu.id','center','',0,'',0,'',NULL); 35 INSERT INTO tablecolumns VALUES (84,19,'link','menu.link','left','',2,'',1,'',NULL); 36 INSERT INTO tablecolumns VALUES (88,19,'access level','concat(\" \",menu.accesslevel)','center','',3,'menu.accesslevel',0,'',NULL); 37 INSERT INTO tablecolumns VALUES (86,19,'Item','concat(if(parentmenu.name is null,\"\",concat(parentmenu.name,\" :: \")),menu.name)','left','',1,'',0,'100%',NULL); 38 INSERT INTO tablecolumns VALUES (95,21,'id','modules.id','center','',0,'',0,'',NULL); 39 INSERT INTO tablecolumns VALUES (97,21,'name','modules.displayname','left','',1,'',1,'100%',NULL); 40 INSERT INTO tablecolumns VALUES (98,21,'version','modules.version','left','',2,'',0,'',NULL); 41 INSERT INTO tablecolumns VALUES (122,23,'!','ELT(notes.importance+3,\" \",\"·\",\"-\",\"*\",\"!\",\"<b style=\'color:blue\'>!</b>\")','center','',1,'notes.importance',0,'','noencoding'); 42 INSERT INTO tablecolumns VALUES (123,23,'category','notes.category','left','',4,'',0,'',NULL); 43 INSERT INTO tablecolumns VALUES (115,24,'id','notes.id','left','',0,'',0,'',NULL); 44 INSERT INTO tablecolumns VALUES (116,24,'start','if(notes.starttime,concat(notes.startdate,\" \",notes.starttime),notes.startdate)','left','',2,'concat(notes.startdate,\" \",notes.starttime)',0,'','datetime'); 45 INSERT INTO tablecolumns VALUES (114,23,'complete','notes.completed','center','',2,'',0,'','boolean'); 46 INSERT INTO tablecolumns VALUES (112,23,'id','notes.id','left','',0,'',0,'',NULL); 47 INSERT INTO tablecolumns VALUES (113,23,'title','notes.subject','left','',5,'',1,'90%',NULL); 48 INSERT INTO tablecolumns VALUES (124,23,'repeat','notes.repeat+if(notes.parentid is null, 0,1)','center','',3,'',0,'','boolean'); 49 INSERT INTO tablecolumns VALUES (130,23,'due date','if(notes.endtime is not null,concat(notes.enddate,\" \",notes.endtime),notes.enddate)','left','',6,'',0,'','datetime'); 50 INSERT INTO tablecolumns VALUES (117,24,'end','if(notes.endtime,concat(notes.enddate,\" \",notes.endtime),notes.enddate)','left','',3,'concat(notes.enddate,\" \",notes.endtime)',0,'','datetime'); 51 INSERT INTO tablecolumns VALUES (118,24,'title','notes.subject','left','',5,'',1,'90%',NULL); 52 INSERT INTO tablecolumns VALUES (126,24,'status','notes.status','left','',6,'',0,'',NULL); 53 INSERT INTO tablecolumns VALUES (125,24,'!','ELT(notes.importance+3,\" \",\"·\",\"-\",\"*\",\"!\",\"<b style=\'color:blue\'>!</b>\")','center','',4,'',0,'','noencoding'); 54 INSERT INTO tablecolumns VALUES (127,24,'category','notes.category','left','',7,'',1,'',NULL); 55 INSERT INTO tablecolumns VALUES (128,24,'location','notes.category','left','',8,'',1,'',NULL); 56 INSERT INTO tablecolumns VALUES (129,24,'rpt.','notes.`repeat`','center','',1,'notes.repeat',0,'','boolean'); 57 INSERT INTO tablecolumns VALUES (141,26,'id','files.id','left','',0,'',0,'',NULL); 58 INSERT INTO tablecolumns VALUES (142,26,'description','files.description','left','',2,'',1,'99%',NULL); 59 INSERT INTO tablecolumns VALUES (144,26,'file','files.name','left','',1,'',0,'',NULL); 60 INSERT INTO tablecolumns VALUES (151,26,'download','files.id','center','',3,'',0,'','filelink'); 61 INSERT INTO tablecolumns VALUES (148,27,'attached','attachments.creationdate','left','',2,'',0,'','datetime'); 62 INSERT INTO tablecolumns VALUES (147,27,'file','concat(\"<b>\",files.name,\"</b>\")','left','',0,'files.name',0,'','noencoding'); 63 INSERT INTO tablecolumns VALUES (150,27,'download','files.id','center','',3,'',0,'','filelink'); 64 INSERT INTO tablecolumns VALUES (149,27,'description','files.description','left','',1,'',1,'100%',NULL); 1 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (100,9,'log in name','users.login','left','',2,'',0,'',NULL); 2 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (3,9,'id','users.id','left','',0,'',0,'',NULL); 3 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (5,9,'name','concat(users.firstname,\" \",users.lastname)','left','',1,'',0,'100%',NULL); 4 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (6,9,'last login','users.lastlogin','left','',4,'',0,'','datetime'); 5 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (7,9,'revoked','users.revoked','center','',3,'',0,'','boolean'); 6 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (20,10,'name','relationships.name','left','',3,'',0,'100%',NULL); 7 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (92,10,'to field','relationships.tofield','left','',5,'',0,'',NULL); 8 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (91,10,'from field','relationships.fromfield','left','',2,'',0,'',NULL); 9 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (90,10,'to table','totable.displayname','left','',4,'',0,'',NULL); 10 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (89,10,'from table','fromtable.displayname','left','',1,'',0,'',NULL); 11 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (93,10,'inherent','relationships.inherint','center','',6,'',0,'','boolean'); 12 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (19,10,'id','relationships.id','center','',0,'',0,'',NULL); 13 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (8,11,'id','tabledefs.id','center','',0,'',0,'',NULL); 14 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (9,11,'main table','tabledefs.maintable','left','',4,'',0,'100%',NULL); 15 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (10,11,'display','concat(\"<strong>\",tabledefs.displayname,\"</strong>\")','left','',3,NULL,0,'','noencoding'); 16 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (43,11,'type','tabledefs.type','center','',2,'',0,'',NULL); 17 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (96,11,'module','modules.name','left','',1,'',0,'',NULL); 18 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (121,12,'category','notes.category','left','',3,'',0,'',NULL); 19 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (120,12,'done','notes.completed','center','',5,'',0,'','boolean'); 20 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (131,12,'type','concat(\"<B>\",notes.type,\"</B>\")','center','',2,NULL,0,'','noencoding'); 21 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (39,12,'title','notes.subject','left','',4,'',1,'90%',NULL); 22 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (34,12,'id','notes.id','center','',0,'',0,'',NULL); 23 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (119,12,'!','ELT(notes.importance+3,\" \",\"·\",\"-\",\"*\",\"!\",\"<b style=\'color:blue\'>!</b>\")','center','',1,'notes.importance',0,'','noencoding'); 24 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (26,16,'id','reports.id','center','',0,'',0,'',NULL); 25 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (28,16,'name','concat(\"<strong>\",reports.name,\"</strong>\")','left','',2,'',0,'','noencoding'); 26 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (29,16,'type','reports.type','left','',4,'',0,'100%',NULL); 27 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (111,16,'order','reports.displayorder','center','',3,'',0,'',NULL); 28 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (94,16,'table','if(tabledefs.displayname is null,\"<b>global</b>\",tabledefs.displayname)','left','',1,NULL,0,'','noencoding'); 29 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (30,17,'id','usersearches.id','center','',0,'',0,'',NULL); 30 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (31,17,'name','usersearches.name','left','',1,'',0,'100%',NULL); 31 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (32,17,'user','if(usersearches.userid=0,\"<b>global</b>\",concat(users.lastname,\", \",users.firstname))','left','',2,NULL,0,'','noencoding'); 32 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (33,17,'table','tabledefs.maintable','left','',4,'',0,'',NULL); 33 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (101,17,'type','if(usersearches.type=\"SCH\",\"Search\",\"Sort\")','left','',3,'usersearches.type',0,'',NULL); 34 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (82,19,'id','menu.id','center','',0,'',0,'',NULL); 35 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (84,19,'link','menu.link','left','',2,'',1,'',NULL); 36 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (88,19,'access','if(menu.roleid=0,\'EVERYONE\',if(menu.roleid=-100,\'Administrators\',roles.name))','center','',3,'',0,'',NULL); 37 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (86,19,'Item','concat(if(parentmenu.name is null,\"\",concat(parentmenu.name,\" :: \")),menu.name)','left','',1,'',0,'100%',NULL); 38 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (95,21,'id','modules.id','center','',0,'',0,'',NULL); 39 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (97,21,'name','modules.displayname','left','',1,'',1,'100%',NULL); 40 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (98,21,'version','modules.version','left','',2,'',0,'',NULL); 41 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (122,23,'!','ELT(notes.importance+3,\" \",\"·\",\"-\",\"*\",\"!\",\"<b style=\'color:blue\'>!</b>\")','center','',1,NULL,0,'','noencoding'); 42 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (123,23,'category','notes.category','left','',4,'',0,'',NULL); 43 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (115,24,'id','notes.id','left','',0,'',0,'',NULL); 44 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (116,24,'start','if(notes.starttime,concat(notes.startdate,\" \",notes.starttime),notes.startdate)','left','',2,'concat(notes.startdate,\" \",notes.starttime)',0,'','datetime'); 45 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (114,23,'complete','notes.completed','center','',2,'',0,'','boolean'); 46 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (112,23,'id','notes.id','left','',0,'',0,'',NULL); 47 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (113,23,'title','notes.subject','left','',5,'',1,'90%',NULL); 48 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (124,23,'repeat','notes.repeat+if(notes.parentid is null, 0,1)','center','',3,'',0,'','boolean'); 49 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (130,23,'due date','if(notes.endtime is not null,concat(notes.enddate,\" \",notes.endtime),notes.enddate)','left','',6,'',0,'','datetime'); 50 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (117,24,'end','if(notes.endtime,concat(notes.enddate,\" \",notes.endtime),notes.enddate)','left','',3,'concat(notes.enddate,\" \",notes.endtime)',0,'','datetime'); 51 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (118,24,'title','notes.subject','left','',5,'',1,'90%',NULL); 52 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (126,24,'status','notes.status','left','',6,'',0,'',NULL); 53 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (125,24,'!','ELT(notes.importance+3,\" \",\"·\",\"-\",\"*\",\"!\",\"<b style=\'color:blue\'>!</b>\")','center','',4,NULL,0,'','noencoding'); 54 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (127,24,'category','notes.category','left','',7,'',1,'',NULL); 55 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (128,24,'location','notes.category','left','',8,'',1,'',NULL); 56 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (129,24,'rpt.','notes.`repeat`','center','',1,'notes.repeat',0,'','boolean'); 57 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (141,26,'id','files.id','left','',0,'',0,'',NULL); 58 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (142,26,'description','files.description','left','',2,'',1,'99%',NULL); 59 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (144,26,'file','files.name','left','',1,'',0,'',NULL); 60 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (151,26,'download','files.id','center','',3,'',0,'','filelink'); 61 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (148,27,'attached','attachments.creationdate','left','',2,'',0,'','datetime'); 62 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (147,27,'file','concat(\"<b>\",files.name,\"</b>\")','left','',0,NULL,0,'','noencoding'); 63 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (150,27,'download','files.id','center','',3,'',0,'','filelink'); 64 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (149,27,'description','files.description','left','',1,'',1,'100%',NULL); 65 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (5001,200,'name','roles.name','left','',1,'',0,'99%',NULL); 66 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (5002,200,'inactive','roles.inactive','center','',2,'',0,'','boolean'); 67 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (5000,200,'id','roles.id','left','',0,'',0,'',NULL); -
trunk/phpbms/install/tabledefs.sql
r145 r170 1 INSERT INTO tabledefs VALUES ('modules/base/users_addedit.php','Users',9,'users',2,'2004-03-04 14:50:45',2,20040413102940,'users','modules/base/users_addedit.php','revoke','users.id !=0','users.id','','','','system',1); 2 INSERT INTO tabledefs VALUES ('modules/base/relationships_addedit.php','Relationships',10,'relationships',2,'2004-03-04 14:51:18',2,20040413102940,'(relationships inner join tabledefs as fromtable on relationships.fromtableid=fromtable.id) inner join tabledefs as totable on relationships.totableid=totable.id','modules/base/relationships_addedit.php','delete','relationships.id != 0','fromtable.displayname, name','','','','system',1); 3 INSERT INTO tabledefs VALUES ('modules/base/tabledefs_addedit.php','Table Definitions',11,'tabledefs',2,'2004-03-04 14:52:21',2,20051006143406,'tabledefs left join modules on tabledefs.moduleid=modules.id','modules/base/tabledefs_addedit.php','delete','tabledefs.id != 0','modules.name, tabledefs.displayname','','','','system',1); 4 INSERT INTO tabledefs VALUES ('modules/base/notes_addedit.php','Notes',12,'notes',2,'2004-03-04 14:54:49',2,20051021170130,'notes','modules/base/notes_addedit.php','delete','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0','notes.category,notes.type,notes.importance DESC,notes.creationdate','search','My Unread Notes','new','table',1); 5 INSERT INTO tabledefs VALUES ('modules/base/notes_addedit.php?backurl=../../search.php?id=23','Tasks',23,'notes',2,'2005-09-15 17:25:10',2,20050928190020,'((notes left join users as assignedto on assignedto.id= notes.assignedtoid) left join users as assignedby on assignedby.id=notes.assignedbyid)','modules/base/notes_addedit.php?ty=TS&backurl=../../search.php?id=23','delete','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0','notes.category,notes.enddate,notes.endtime,notes.startdate,notes.starttime,notes.importance DESC,notes.subject','search','My Uncompleted Tasks','','view',1); 6 INSERT INTO tabledefs VALUES ('modules/base/usersearches_edit.php','Saved Searches/Sorts',17,'usersearches',2,'2004-04-06 18:10:00',2,20050222114515,'(usersearches left join users on usersearches.userid = users.id) inner join tabledefs on usersearches.tabledefid=tabledefs.id','N/A','delete','usersearches.id != 0','usersearches.name','','','','system',1); 7 INSERT INTO tabledefs VALUES ('modules/base/reports_addedit.php','Reports',16,'reports',2,'2004-04-06 17:56:37',2,20051006112919,'reports left join tabledefs on reports.tabledefid=tabledefs.id','modules/base/reports_addedit.php','delete','reports.id != 0','tabledefid,displayorder DESC, reports.name','','','','system',1); 8 INSERT INTO tabledefs VALUES ('modules/base/menu_addedit.php','Menu',19,'menu',2,'2004-04-07 14:17:24',2,20040413102940,'(menu LEFT JOIN menu as parentmenu on menu.parentid=parentmenu.id)','modules/base/menu_addedit.php','delete','menu.id!=0','concat(if(parentmenu.name is null,\"\",concat(parentmenu.displayorder,\"-\")),menu.displayorder)','','','','system',1); 9 INSERT INTO tabledefs VALUES ('modules/base/modules_view.php','Installed Modules',21,'modules',2,'2004-04-12 14:29:21',2,20040413102940,'modules','modules/base/modules_view.php','NA','modules.id!=0','modules.name','','','','system',1); 10 INSERT INTO tabledefs VALUES ('modules/base/notes_addedit.php?backurl=../../search.php?id=24','Events',24,'notes',2,'2005-09-20 15:27:29',2,20051116162057,'((notes left join users as assignedto on assignedto.id= notes.assignedtoid) left join users as assignedby on assignedby.id=notes.assignedbyid)','modules/base/notes_addedit.php?ty=EV&backurl=../../search.php?id=24','delete','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.`repeat`=1)','notes.repeat DESC,notes.startdate DESC,notes.starttime DESC,notes.enddate DESC,notes.endtime DESC,notes.importance','search','','','view',1); 11 INSERT INTO tabledefs VALUES ('modules/base/files_addedit.php','Files',26,'files',2,'2005-11-17 21:44:07',2,20051117214436,'files','modules/base/files_addedit.php','delete','files.id=-1','files.name','search','','','table',1); 12 INSERT INTO tabledefs VALUES ('modules/base/files_addedit.php','Attachments',27,'attachments',2,'2005-11-22 11:38:15',2,20051122125549,'(attachments INNER JOIN files on attachments.fileid=files.id)','modules/base/files_addedit.php','delete','attachments.id!=0','attachments.creationdate DESC','search','','','table',1); 1 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (9,'Users','system',1,'users','users','modules/base/users_addedit.php',-100,'modules/base/users_addedit.php',-100,-100,-100,-100,'revoke','users.id !=0','users.id','','','',1,NOW(),1,NOW()); 2 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (10,'Relationships','system',1,'relationships','(relationships inner join tabledefs as fromtable on relationships.fromtableid=fromtable.id) inner join tabledefs as totable on relationships.totableid=totable.id','modules/base/relationships_addedit.php',-100,'modules/base/relationships_addedit.php',-100,-100,-100,-100,'delete','relationships.id != 0','fromtable.displayname, name','','','',1,NOW(),1,NOW()); 3 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (11,'Table Definitions','system',1,'tabledefs','tabledefs left join modules on tabledefs.moduleid=modules.id','modules/base/tabledefs_addedit.php',-100,'modules/base/tabledefs_addedit.php',-100,-100,-100,-100,'delete','tabledefs.id != 0','modules.name, tabledefs.displayname','','','',1,NOW(),1,NOW()); 4 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (12,'Notes','table',1,'notes','notes','modules/base/notes_addedit.php',0,'modules/base/notes_addedit.php',0,0,-100,-100,'delete','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0','notes.category,notes.type,notes.importance DESC,notes.creationdate','search','My Unread Notes','new',1,NOW(),1,NOW()); 5 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (23,'Tasks','view',1,'notes','((notes left join users as assignedto on assignedto.id= notes.assignedtoid) left join users as assignedby on assignedby.id=notes.assignedbyid)','modules/base/notes_addedit.php?backurl=../../search.php?id=23',0,'modules/base/notes_addedit.php?ty=TS&backurl=../../search.php?id=23',0,0,-100,-100,'delete','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0','notes.category,notes.enddate,notes.endtime,notes.startdate,notes.starttime,notes.importance DESC,notes.subject','search','My Uncompleted Tasks','',2,'2005-09-15 17:25:10',1,NOW(),1,NOW()); 6 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (17,'Saved Searches/Sorts','system',1,'usersearches','(usersearches left join users on usersearches.userid = users.id) inner join tabledefs on usersearches.tabledefid=tabledefs.id','modules/base/usersearches_edit.php',-100,'N/A',-100,-100,-100,-100,'delete','usersearches.id != 0','usersearches.name','','','',1,NOW(),1,NOW()); 7 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (16,'Reports','system',1,'reports','reports left join tabledefs on reports.tabledefid=tabledefs.id','modules/base/reports_addedit.php',-100,'modules/base/reports_addedit.php',-100,-100,-100,-100,'delete','reports.id != 0','tabledefid,displayorder DESC, reports.name','','','',2,'2004-04-06 17:56:37',1,NOW(),1,NOW()); 8 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (19,'Menu','system',1,'menu','((menu LEFT JOIN menu as parentmenu on menu.parentid=parentmenu.id) LEFT JOIN roles on menu.roleid=roles.id)','modules/base/menu_addedit.php',-100,'modules/base/menu_addedit.php',-100,-100,-100,-100,'delete','menu.id!=0','concat(if(parentmenu.name is null,\"\",concat(parentmenu.displayorder,\"-\")),menu.displayorder)','','','',1,NOW(),1,NOW()); 9 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (21,'Installed Modules','system',1,'modules','modules','modules/base/modules_view.php',-100,'modules/base/modules_view.php',-100,-100,-100,-100,'NA','modules.id!=0','modules.name','','','',1,NOW(),1,NOW()); 10 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (24,'Events','view',1,'notes','((notes left join users as assignedto on assignedto.id= notes.assignedtoid) left join users as assignedby on assignedby.id=notes.assignedbyid)','modules/base/notes_addedit.php?backurl=../../search.php?id=24',0,'modules/base/notes_addedit.php?ty=EV&backurl=../../search.php?id=24',0,0,-100,-100,'delete','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.`repeat`=1)','notes.repeat DESC,notes.startdate DESC,notes.starttime DESC,notes.enddate DESC,notes.endtime DESC,notes.importance','search','','',1,NOW(),1,NOW()); 11 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (26,'Files','table',1,'files','files','modules/base/files_addedit.php',-100,'modules/base/files_addedit.php',-100,-100,-100,-100,'delete','files.id=-1','files.name','search','','',1,NOW(),1,NOW()); 12 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (27,'Attachments','table',1,'attachments','(attachments INNER JOIN files on attachments.fileid=files.id)','modules/base/files_addedit.php',0,'modules/base/files_addedit.php',0,0,-100,-100,'delete','attachments.id!=0','attachments.creationdate DESC','search','','',1,NOW(),1,NOW()); 13 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (200,'Roles','table',1,'roles','roles','modules/base/roles_addedit.php',-100,'modules/base/roles_addedit.php',-100,-100,-100,-100,'inactivate','roles.id!=-1','name','search','','',1,NOW(),1,NOW()); 14 15 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (9,'Users','system',1,'users','users','modules/base/users_addedit.php',0,'modules/base/users_addedit.php',0,0,-100,-100,'revoke','users.id !=0','users.id','','','',1,NOW(),1,NOW()); 16 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (10,'Relationships','system',1,'relationships','(relationships inner join tabledefs as fromtable on relationships.fromtableid=fromtable.id) inner join tabledefs as totable on relationships.totableid=totable.id','modules/base/relationships_addedit.php',0,'modules/base/relationships_addedit.php',0,0,-100,-100,'delete','relationships.id != 0','fromtable.displayname, name','','','',1,NOW(),1,NOW()); 17 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (11,'Table Definitions','system',1,'tabledefs','tabledefs left join modules on tabledefs.moduleid=modules.id','modules/base/tabledefs_addedit.php',-100,'modules/base/tabledefs_addedit.php',-100,-100,-100,-100,'delete','tabledefs.id != 0','modules.name, tabledefs.displayname','','','',1,NOW(),1,NOW()); 18 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (12,'Notes','table',1,'notes','notes','modules/base/notes_addedit.php',0,'modules/base/notes_addedit.php',0,0,-100,-100,'delete','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0','notes.category,notes.type,notes.importance DESC,notes.creationdate','search','My Unread Notes','new',1,NOW(),1,NOW()); 19 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (23,'Tasks','view',1,'notes','((notes left join users as assignedto on assignedto.id= notes.assignedtoid) left join users as assignedby on assignedby.id=notes.assignedbyid)','modules/base/notes_addedit.php?backurl=../../search.php?id=23',0,'modules/base/notes_addedit.php?ty=TS&backurl=../../search.php?id=23',0,0,-100,-100,'delete','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0','notes.category,notes.enddate,notes.endtime,notes.startdate,notes.starttime,notes.importance DESC,notes.subject','search','My Uncompleted Tasks','',1,NOW(),1,NOW()); 20 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (17,'Saved Searches/Sorts','system',1,'usersearches','(usersearches left join users on usersearches.userid = users.id) inner join tabledefs on usersearches.tabledefid=tabledefs.id','modules/base/usersearches_edit.php',0,'N/A',0,0,-100,-100,'delete','usersearches.id != 0','usersearches.name','','','',1,NOW(),1,NOW()); 21 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (16,'Reports','system',1,'reports','reports left join tabledefs on reports.tabledefid=tabledefs.id','modules/base/reports_addedit.php',0,'modules/base/reports_addedit.php',0,0,-100,-100,'delete','reports.id != 0','tabledefid,displayorder DESC, reports.name','','','',1,NOW(),1,NOW()); 22 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (19,'Menu','system',1,'menu','((menu LEFT JOIN menu as parentmenu on menu.parentid=parentmenu.id) LEFT JOIN roles on menu.roleid=roles.id)','modules/base/menu_addedit.php',-100,'modules/base/menu_addedit.php',-100,-100,-100,-100,'delete','menu.id!=0','concat(if(parentmenu.name is null,\"\",concat(parentmenu.displayorder,\"-\")),menu.displayorder)','','','',1,NOW(),1,NOW()); 23 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (21,'Installed Modules','system',1,'modules','modules','modules/base/modules_view.php',0,'modules/base/modules_view.php',0,0,-100,-100,'NA','modules.id!=0','modules.name','','','',1,NOW(),1,NOW()); 24 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (24,'Events','view',1,'notes','((notes left join users as assignedto on assignedto.id= notes.assignedtoid) left join users as assignedby on assignedby.id=notes.assignedbyid)','modules/base/notes_addedit.php?backurl=../../search.php?id=24',0,'modules/base/notes_addedit.php?ty=EV&backurl=../../search.php?id=24',0,0,-100,-100,'delete','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.`repeat`=1)','notes.repeat DESC,notes.startdate DESC,notes.starttime DESC,notes.enddate DESC,notes.endtime DESC,notes.importance','search','','',1,NOW(),1,NOW()); 25 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (26,'Files','table',1,'files','files','modules/base/files_addedit.php',0,'modules/base/files_addedit.php',0,-100,-100,-100,'delete','files.id=-1','files.name','search','','',1,NOW(),1,NOW()); 26 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (27,'Attachments','table',1,'attachments','(attachments INNER JOIN files on attachments.fileid=files.id)','modules/base/files_addedit.php',0,'modules/base/files_addedit.php',0,0,-100,-100,'delete','attachments.id!=0','attachments.creationdate DESC','search','','',1,NOW(),1,NOW()); 27 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (200,'Roles','table',1,'roles','roles','modules/base/roles_addedit.php',-100,'modules/base/roles_addedit.php',-100,-100,-100,-100,'inactivate','roles.id!=-1','name','search','','',1,NOW(),1,NOW()); -
trunk/phpbms/install/tablefindoptions.sql
r145 r170 1 INSERT INTO tablefindoptions VALUES (3,9,'All Users','users.id!=0',1,0); 2 INSERT INTO tablefindoptions VALUES (4,9,'Revoked Users','users.revoked=1',1,0); 3 INSERT INTO tablefindoptions VALUES (13,10,'All Records','relationships.id !=0',1,0); 4 INSERT INTO tablefindoptions VALUES (5,11,'All Records','tabledefs.id !=0',1,0); 5 INSERT INTO tablefindoptions VALUES (70,12,'Unread Notes Assigned By Me','notes.type=\'NT\' and notes.assignedbyid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',3,0); 6 INSERT INTO tablefindoptions VALUES (69,12,'Unread Notes Assigned To Me','notes.type=\'NT\' and notes.assignedtoid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',2,0); 7 INSERT INTO tablefindoptions VALUES (20,12,'My Notes','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}}',1,0); 8 INSERT INTO tablefindoptions VALUES (21,12,'All Viewable Notes and System Notes','notes.type=\'SM\' OR ( notes.type=\'NT\' AND !(notes.private=1 AND notes.createdby!={{$_SESSION[\'userinfo\'][\'id\']}}))',7,0); 9 INSERT INTO tablefindoptions VALUES (14,16,'All Reports','reports.id != 0',1,0); 10 INSERT INTO tablefindoptions VALUES (15,17,'All Records','usersearches.id != 0',1,0); 11 INSERT INTO tablefindoptions VALUES (42,19,'All Records','menu.id!=0',1,0); 12 INSERT INTO tablefindoptions VALUES (43,21,'All Records','modules.id!=0',1,0); 13 INSERT INTO tablefindoptions VALUES (71,12,'System Messages','notes.type=\"SM\"',4,-10); 14 INSERT INTO tablefindoptions VALUES (72,12,'Public Notes','notes.type=\'NT\' AND notes.private=0',6,0); 15 INSERT INTO tablefindoptions VALUES (73,12,'My Unread Notes','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0',0,0); 16 INSERT INTO tablefindoptions VALUES (74,12,'Public Unread Notes','notes.type=\'NT\' AND notes.private=0 AND notes.completed=0',5,0); 17 INSERT INTO tablefindoptions VALUES (76,23,'My Uncompleted Tasks','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0',0,0); 18 INSERT INTO tablefindoptions VALUES (77,23,'My Tasks','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}}',1,0); 19 INSERT INTO tablefindoptions VALUES (78,23,'Uncomplete Tasks Assigned To Me','notes.type=\'TS\' and notes.assignedtoid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',2,0); 20 INSERT INTO tablefindoptions VALUES (79,23,'Uncomplete Tasks Assigned By Me','notes.type=\'NT\' and notes.assignedbyid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',3,0); 21 INSERT INTO tablefindoptions VALUES (80,23,'Public Uncomplete Tasks','notes.type=\'TS\' AND notes.private=0 AND notes.completed=0',4,0); 22 INSERT INTO tablefindoptions VALUES (81,23,'Public Tasks','notes.type=\'NT\' AND notes.private=0',5,0); 23 INSERT INTO tablefindoptions VALUES (82,23,'All Viewable Tasks','notes.type=\'TS\' AND !(notes.private=1 AND notes.createdby!={{$_SESSION[\'userinfo\'][\'id\']}})',6,0); 24 INSERT INTO tablefindoptions VALUES (83,24,'My Events','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}}',0,0); 25 INSERT INTO tablefindoptions VALUES (84,24,'Public Events','notes.type=\'EV\' AND notes.private=0',8,0); 26 INSERT INTO tablefindoptions VALUES (85,24,'Undone Events Assigned To Me','notes.type=\'EV\' and notes.assignedtoid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',17,0); 27 INSERT INTO tablefindoptions VALUES (86,24,'Undone Events Assigned By Me','notes.type=\'NT\' and notes.assignedbyid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',16,0); 28 INSERT INTO tablefindoptions VALUES (87,24,'All Viewable Events','notes.type=\'EV\' AND !(notes.private=1 AND notes.createdby!={{$_SESSION[\'userinfo\'][\'id\']}})',18,0); 29 INSERT INTO tablefindoptions VALUES (88,24,'My Events - Today','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = curdate()) OR notes.`repeat`=1)',1,-10); 30 INSERT INTO tablefindoptions VALUES (89,24,'My Events - Yesterday','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = date_sub(curdate(),INTERVAL 1 DAY)) OR notes.`repeat`=1)',2,-10); 31 INSERT INTO tablefindoptions VALUES (90,24,'My Events - This Week','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.repeat=1)',4,0); 32 INSERT INTO tablefindoptions VALUES (91,24,'My Events - This Month','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and month(notes.startdate)=month(curdate())) OR notes.repeat=1)',6,0); 33 INSERT INTO tablefindoptions VALUES (92,24,'My Events - Tomorrow','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND (notes.startdate = date_add(curdate(),INTERVAL 1 DAY) OR notes.repeat=1)',3,0); 34 INSERT INTO tablefindoptions VALUES (93,24,'My Events - Next Month','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 MONTH)) and month(notes.startdate)=month(date_add(curdate(),INTERVAL 1 MONTH))) OR notes.repeat=1)',7,0); 35 INSERT INTO tablefindoptions VALUES (94,24,'My Events - Next Week','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 WEEK)) and week(notes.startdate)=week(date_add(curdate(),INTERVAL 1 WEEK))) OR notes.repeat=1)',5,0); 36 INSERT INTO tablefindoptions VALUES (95,24,'Public Events - Today','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = curdate()) OR notes.repeat=1)',9,0); 37 INSERT INTO tablefindoptions VALUES (96,24,'Public Events - Yesterday','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = date_sub(curdate(),INTERVAL 1 DAY)) OR notes.repeat=1)',10,0); 38 INSERT INTO tablefindoptions VALUES (97,24,'Public Events - Tomorrow','notes.type=\'EV\' AND notes.private=0 AND (notes.startdate = date_add(curdate(),INTERVAL 1 DAY) OR notes.repeat=1)',11,0); 39 INSERT INTO tablefindoptions VALUES (98,24,'Public Events - This Week','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.repeat=1)',12,0); 40 INSERT INTO tablefindoptions VALUES (99,24,'Public Events - Next Week','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 WEEK)) and week(notes.startdate)=week(date_add(curdate(),INTERVAL 1 WEEK))) OR notes.repeat=1)',13,0); 41 INSERT INTO tablefindoptions VALUES (100,24,'Public Events - This Month','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = year(notes.startdate)=year(curdate()) and month(notes.startdate)=month(curdate())) OR notes.repeat=1)',14,0); 42 INSERT INTO tablefindoptions VALUES (101,24,'Public Events - Next Month','notes.type=\'EV\' notes.private=0 AND ((year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 MONTH)) and month(notes.startdate)=month(date_add(curdate(),INTERVAL 1 MONTH))) OR notes.repeat=1)',15,0); 43 INSERT INTO tablefindoptions VALUES (108,26,'All Records','files.id!=0',0,-10); 1 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (3,9,'All Users','users.id!=0',1,0); 2 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (4,9,'Revoked Users','users.revoked=1',1,0); 3 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (13,10,'All Records','relationships.id !=0',1,0); 4 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (5,11,'All Records','tabledefs.id !=0',1,0); 5 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (70,12,'Unread Notes Assigned By Me','notes.type=\'NT\' and notes.assignedbyid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',3,0); 6 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (69,12,'Unread Notes Assigned To Me','notes.type=\'NT\' and notes.assignedtoid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',2,0); 7 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (20,12,'My Notes','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}}',1,0); 8 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (21,12,'All Viewable Notes and System Notes','notes.type=\'SM\' OR ( notes.type=\'NT\' AND !(notes.private=1 AND notes.createdby!={{$_SESSION[\'userinfo\'][\'id\']}}))',7,0); 9 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (14,16,'All Reports','reports.id != 0',1,0); 10 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (15,17,'All Records','usersearches.id != 0',1,0); 11 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (42,19,'All Records','menu.id!=0',1,0); 12 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (43,21,'All Records','modules.id!=0',1,0); 13 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (71,12,'System Messages','notes.type=\"SM\"',4,0); 14 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (72,12,'Public Notes','notes.type=\'NT\' AND notes.private=0',6,0); 15 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (73,12,'My Unread Notes','notes.type=\'NT\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0',0,0); 16 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (74,12,'Public Unread Notes','notes.type=\'NT\' AND notes.private=0 AND notes.completed=0',5,0); 17 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (76,23,'My Uncompleted Tasks','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND completed=0',0,0); 18 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (77,23,'My Tasks','notes.type=\'TS\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}}',1,0); 19 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (78,23,'Uncomplete Tasks Assigned To Me','notes.type=\'TS\' and notes.assignedtoid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',2,0); 20 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (79,23,'Uncomplete Tasks Assigned By Me','notes.type=\'NT\' and notes.assignedbyid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',3,0); 21 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (80,23,'Public Uncomplete Tasks','notes.type=\'TS\' AND notes.private=0 AND notes.completed=0',4,0); 22 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (81,23,'Public Tasks','notes.type=\'NT\' AND notes.private=0',5,0); 23 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (82,23,'All Viewable Tasks','notes.type=\'TS\' AND !(notes.private=1 AND notes.createdby!={{$_SESSION[\'userinfo\'][\'id\']}})',6,0); 24 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (83,24,'My Events','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}}',0,0); 25 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (84,24,'Public Events','notes.type=\'EV\' AND notes.private=0',8,0); 26 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (85,24,'Undone Events Assigned To Me','notes.type=\'EV\' and notes.assignedtoid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',17,0); 27 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (86,24,'Undone Events Assigned By Me','notes.type=\'NT\' and notes.assignedbyid={{$_SESSION[\'userinfo\'][\'id\']}} and notes.completed=0',16,0); 28 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (87,24,'All Viewable Events','notes.type=\'EV\' AND !(notes.private=1 AND notes.createdby!={{$_SESSION[\'userinfo\'][\'id\']}})',18,0); 29 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (88,24,'My Events - Today','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = curdate()) OR notes.`repeat`=1)',1,0); 30 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (89,24,'My Events - Yesterday','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = date_sub(curdate(),INTERVAL 1 DAY)) OR notes.`repeat`=1)',2,0); 31 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (90,24,'My Events - This Week','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.repeat=1)',4,0); 32 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (91,24,'My Events - This Month','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(curdate()) and month(notes.startdate)=month(curdate())) OR notes.repeat=1)',6,0); 33 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (92,24,'My Events - Tomorrow','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND (notes.startdate = date_add(curdate(),INTERVAL 1 DAY) OR notes.repeat=1)',3,0); 34 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (93,24,'My Events - Next Month','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 MONTH)) and month(notes.startdate)=month(date_add(curdate(),INTERVAL 1 MONTH))) OR notes.repeat=1)',7,0); 35 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (94,24,'My Events - Next Week','notes.type=\'EV\' AND notes.createdby = {{$_SESSION[\'userinfo\'][\'id\']}} AND ((notes.startdate = year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 WEEK)) and week(notes.startdate)=week(date_add(curdate(),INTERVAL 1 WEEK))) OR notes.repeat=1)',5,0); 36 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (95,24,'Public Events - Today','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = curdate()) OR notes.repeat=1)',9,0); 37 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (96,24,'Public Events - Yesterday','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = date_sub(curdate(),INTERVAL 1 DAY)) OR notes.repeat=1)',10,0); 38 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (97,24,'Public Events - Tomorrow','notes.type=\'EV\' AND notes.private=0 AND (notes.startdate = date_add(curdate(),INTERVAL 1 DAY) OR notes.repeat=1)',11,0); 39 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (98,24,'Public Events - This Week','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = year(notes.startdate)=year(curdate()) and week(notes.startdate)=week(curdate())) OR notes.repeat=1)',12,0); 40 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (99,24,'Public Events - Next Week','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 WEEK)) and week(notes.startdate)=week(date_add(curdate(),INTERVAL 1 WEEK))) OR notes.repeat=1)',13,0); 41 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (100,24,'Public Events - This Month','notes.type=\'EV\' AND notes.private=0 AND ((notes.startdate = year(notes.startdate)=year(curdate()) and month(notes.startdate)=month(curdate())) OR notes.repeat=1)',14,0); 42 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (101,24,'Public Events - Next Month','notes.type=\'EV\' notes.private=0 AND ((year(notes.startdate)=year(date_add(curdate(),INTERVAL 1 MONTH)) and month(notes.startdate)=month(date_add(curdate(),INTERVAL 1 MONTH))) OR notes.repeat=1)',15,0); 43 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (108,26,'All Records','files.id!=0',0,0); 44 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (200,200,'Active Roles','roles.inactive=0',0,0); 45 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (201,200,'Inactive Roles','roles.inactive=1',1,0); 46 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (202,200,'All Records','roles.id!=-100',2,0); -
trunk/phpbms/install/tableoptions.sql
r145 r170 1 INSERT INTO tableoptions VALUES (8,9,'new','1',0,0); 2 INSERT INTO tableoptions VALUES (9,9,'edit','1',0,0); 3 INSERT INTO tableoptions VALUES (10,9,'select','1',0,0); 4 INSERT INTO tableoptions VALUES (16,10,'new','1',0,0); 5 INSERT INTO tableoptions VALUES (17,10,'select','1',0,0); 6 INSERT INTO tableoptions VALUES (18,10,'edit','1',0,0); 7 INSERT INTO tableoptions VALUES (11,11,'new','1',0,0); 8 INSERT INTO tableoptions VALUES (12,11,'select','1',0,0); 9 INSERT INTO tableoptions VALUES (13,11,'edit','1',0,0); 10 INSERT INTO tableoptions VALUES (24,12,'new','1',0,0); 11 INSERT INTO tableoptions VALUES (25,12,'edit','1',0,0); 12 INSERT INTO tableoptions VALUES (26,12,'select','1',0,0); 13 INSERT INTO tableoptions VALUES (62,12,'printex','1',0,0); 14 INSERT INTO tableoptions VALUES (27,12,'mark_asread','mark as read',1,0); 15 INSERT INTO tableoptions VALUES (19,16,'new','1',0,0); 16 INSERT INTO tableoptions VALUES (20,16,'select','1',0,0); 17 INSERT INTO tableoptions VALUES (21,16,'edit','1',0,0); 18 INSERT INTO tableoptions VALUES (22,17,'select','1',0,0); 19 INSERT INTO tableoptions VALUES (23,17,'edit','1',0,0); 20 INSERT INTO tableoptions VALUES (56,19,'new','1',0,0); 21 INSERT INTO tableoptions VALUES (57,19,'edit','1',0,0); 22 INSERT INTO tableoptions VALUES (58,19,'select','1',0,0); 23 INSERT INTO tableoptions VALUES (59,21,'edit','1',0,0); 24 INSERT INTO tableoptions VALUES (60,21,'select','1',0,0); 25 INSERT INTO tableoptions VALUES (69,23,'new','1',0,0); 26 INSERT INTO tableoptions VALUES (70,23,'edit','1',0,0); 27 INSERT INTO tableoptions VALUES (71,23,'select','1',0,0); 28 INSERT INTO tableoptions VALUES (72,23,'printex','1',0,0); 29 INSERT INTO tableoptions VALUES (77,23,'mark_asread','mark completed',1,0); 30 INSERT INTO tableoptions VALUES (73,24,'new','1',0,0); 31 INSERT INTO tableoptions VALUES (74,24,'edit','1',0,0); 32 INSERT INTO tableoptions VALUES (75,24,'select','1',0,0); 33 INSERT INTO tableoptions VALUES (76,24,'printex','1',0,0); 34 INSERT INTO tableoptions VALUES (78,24,'mark_asread','mark done',1,0); 35 INSERT INTO tableoptions VALUES (83,26,'new','1',0,-10); 36 INSERT INTO tableoptions VALUES (84,26,'select','1',0,-10); 37 INSERT INTO tableoptions VALUES (85,26,'edit','1',0,-10); 38 INSERT INTO tableoptions VALUES (86,27,'new','1',0,-10); 39 INSERT INTO tableoptions VALUES (87,27,'select','1',0,-10); 40 INSERT INTO tableoptions VALUES (88,27,'edit','1',0,-10); 1 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (8,9,'new','1',0,0); 2 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (9,9,'edit','1',0,0); 3 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (10,9,'select','1',0,0); 4 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (16,10,'new','1',0,0); 5 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (17,10,'select','1',0,0); 6 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (18,10,'edit','1',0,0); 7 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (11,11,'new','1',0,0); 8 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (12,11,'select','1',0,0); 9 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (13,11,'edit','1',0,0); 10 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (24,12,'new','1',0,0); 11 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (25,12,'edit','1',0,0); 12 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (26,12,'select','1',0,0); 13 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (62,12,'printex','1',0,0); 14 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (27,12,'mark_asread','mark as read',1,0); 15 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (19,16,'new','1',0,0); 16 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (20,16,'select','1',0,0); 17 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (21,16,'edit','1',0,0); 18 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (22,17,'select','1',0,0); 19 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (23,17,'edit','1',0,0); 20 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (56,19,'new','1',0,0); 21 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (57,19,'edit','1',0,0); 22 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (58,19,'select','1',0,0); 23 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (59,21,'edit','1',0,0); 24 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (60,21,'select','1',0,0); 25 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (69,23,'new','1',0,0); 26 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (70,23,'edit','1',0,0); 27 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (71,23,'select','1',0,0); 28 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (72,23,'printex','1',0,0); 29 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (77,23,'mark_asread','mark completed',1,0); 30 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (73,24,'new','1',0,0); 31 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (74,24,'edit','1',0,0); 32 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (75,24,'select','1',0,0); 33 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (76,24,'printex','1',0,0); 34 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (78,24,'mark_asread','mark done',1,0); 35 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (83,26,'new','1',0,0); 36 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (84,26,'select','1',0,0); 37 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (85,26,'edit','1',0,0); 38 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (86,27,'new','1',0,0); 39 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (87,27,'select','1',0,0); 40 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (88,27,'edit','1',0,0); 41 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (200,200,'new','1',0,0); 42 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,200,'select','1',0,0); 43 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,200,'edit','1',0,0); -
trunk/phpbms/install/tablesearchablefields.sql
r145 r170 1 INSERT INTO tablesearchablefields VALUES (3,9,'(users.lastname like \"{{value}}%\" or users.firstname like \"{{value}}%\" )','name',0,'whereclause'); 2 INSERT INTO tablesearchablefields VALUES (5,9,'users.accesslevel','access level',2,'field'); 3 INSERT INTO tablesearchablefields VALUES (6,9,'users.login','log in name',1,'field'); 4 INSERT INTO tablesearchablefields VALUES (7,9,'users.id','id',3,'field'); 5 INSERT INTO tablesearchablefields VALUES (26,10,'relationships.id','id',0,'field'); 6 INSERT INTO tablesearchablefields VALUES (8,11,'tabledefs.maintable','main table',0,'field'); 7 INSERT INTO tablesearchablefields VALUES (9,11,'tabledefs.displayname','display',1,'field'); 8 INSERT INTO tablesearchablefields VALUES (10,11,'tabledefs.id','id',2,'field'); 9 INSERT INTO tablesearchablefields VALUES (35,12,'notes.subject','title',0,'field'); 10 INSERT INTO tablesearchablefields VALUES (36,12,'notes.content','content',2,'field'); 11 INSERT INTO tablesearchablefields VALUES (37,12,'assignedto.firstname like \"{{value}}%\"or assignedto.lastname like \"{{value}}%\"','assigned to',3,'whereclause'); 12 INSERT INTO tablesearchablefields VALUES (38,12,'assignedby.firstname like \"{{value}}%\"or assignedby.lastname like \"{{value}}%\"','assigned by',4,'whereclause'); 13 INSERT INTO tablesearchablefields VALUES (39,12,'notes.id','id',5,'field'); 14 INSERT INTO tablesearchablefields VALUES (81,12,'notes.category','category',1,'field'); 15 INSERT INTO tablesearchablefields VALUES (27,16,'reports.name','name',0,'field'); 16 INSERT INTO tablesearchablefields VALUES (28,16,'reports.reporttable','table',1,'field'); 17 INSERT INTO tablesearchablefields VALUES (29,16,'reports.type','type',2,'field'); 18 INSERT INTO tablesearchablefields VALUES (30,16,'reports.id','id',3,'field'); 19 INSERT INTO tablesearchablefields VALUES (31,17,'usersearches.name','name',0,'field'); 20 INSERT INTO tablesearchablefields VALUES (32,17,'({{value]]=\"global\" or users.firstname like \"{{value}}%\" or users.lastname like \"{{value}}%\")','user',1,'whereclause'); 21 INSERT INTO tablesearchablefields VALUES (33,17,'usersearches.table','table',2,'field'); 22 INSERT INTO tablesearchablefields VALUES (34,17,'usersearches.id','id',3,'field'); 23 INSERT INTO tablesearchablefields VALUES (67,19,'menu.name','name',0,'field'); 24 INSERT INTO tablesearchablefields VALUES (68,19,'parentmenu.name','parent name',1,'field'); 25 INSERT INTO tablesearchablefields VALUES (69,19,'menu.id','id',2,'field'); 26 INSERT INTO tablesearchablefields VALUES (70,21,'modules.id','id',0,'field'); 27 INSERT INTO tablesearchablefields VALUES (83,23,'notes.subject','title',0,'field'); 28 INSERT INTO tablesearchablefields VALUES (84,23,'notes.category','category',1,'field'); 29 INSERT INTO tablesearchablefields VALUES (85,23,'notes.content','content',2,'field'); 30 INSERT INTO tablesearchablefields VALUES (86,23,'assignedto.firstname like \"{{value}}%\"or assignedto.lastname like \"{{value}}%\"','assigned to',3,'whereclause'); 31 INSERT INTO tablesearchablefields VALUES (87,23,'assignedby.firstname like \"{{value}}%\"or assignedby.lastname like \"{{value}}%\"','assigned by',4,'whereclause'); 32 INSERT INTO tablesearchablefields VALUES (88,23,'notes.id','id',5,'field'); 33 INSERT INTO tablesearchablefields VALUES (89,24,'notes.subject','title',0,'field'); 34 INSERT INTO tablesearchablefields VALUES (90,24,'notes.category','category',1,'field'); 35 INSERT INTO tablesearchablefields VALUES (91,24,'notes.content','content',2,'field'); 36 INSERT INTO tablesearchablefields VALUES (92,24,'assignedto.firstname like \"{{value}}%\"or assignedto.lastname like \"{{value}}%\"','assigned to',3,'whereclause'); 37 INSERT INTO tablesearchablefields VALUES (93,24,'assignedby.firstname like','assigned by',4,'whereclause'); 38 INSERT INTO tablesearchablefields VALUES (94,24,'notes.id','id',5,'field'); 39 INSERT INTO tablesearchablefields VALUES (96,26,'files.name','name',0,'field'); 1 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (3,9,'(users.lastname like \"{{value}}%\" or users.firstname like \"{{value}}%\" )','name',0,'whereclause'); 2 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (5,9,'users.accesslevel','access level',2,'field'); 3 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (6,9,'users.login','log in name',1,'field'); 4 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (7,9,'users.id','id',3,'field'); 5 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (26,10,'relationships.id','id',0,'field'); 6 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (8,11,'tabledefs.maintable','main table',0,'field'); 7 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (9,11,'tabledefs.displayname','display',1,'field'); 8 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (10,11,'tabledefs.id','id',2,'field'); 9 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (35,12,'notes.subject','title',0,'field'); 10 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (36,12,'notes.content','content',2,'field'); 11 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (37,12,'assignedto.firstname like \"{{value}}%\"or assignedto.lastname like \"{{value}}%\"','assigned to',3,'whereclause'); 12 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (38,12,'assignedby.firstname like \"{{value}}%\"or assignedby.lastname like \"{{value}}%\"','assigned by',4,'whereclause'); 13 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (39,12,'notes.id','id',5,'field'); 14 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (81,12,'notes.category','category',1,'field'); 15 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (27,16,'reports.name','name',0,'field'); 16 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (28,16,'reports.reporttable','table',1,'field'); 17 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (29,16,'reports.type','type',2,'field'); 18 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (30,16,'reports.id','id',3,'field'); 19 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (31,17,'usersearches.name','name',0,'field'); 20 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (32,17,'({{value]]=\"global\" or users.firstname like \"{{value}}%\" or users.lastname like \"{{value}}%\")','user',1,'whereclause'); 21 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (33,17,'usersearches.table','table',2,'field'); 22 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (34,17,'usersearches.id','id',3,'field'); 23 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (67,19,'menu.name','name',0,'field'); 24 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (68,19,'parentmenu.name','parent name',1,'field'); 25 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (69,19,'menu.id','id',2,'field'); 26 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (70,21,'modules.id','id',0,'field'); 27 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (83,23,'notes.subject','title',0,'field'); 28 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (84,23,'notes.category','category',1,'field'); 29 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (85,23,'notes.content','content',2,'field'); 30 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (86,23,'assignedto.firstname like \"{{value}}%\"or assignedto.lastname like \"{{value}}%\"','assigned to',3,'whereclause'); 31 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (87,23,'assignedby.firstname like \"{{value}}%\"or assignedby.lastname like \"{{value}}%\"','assigned by',4,'whereclause'); 32 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (88,23,'notes.id','id',5,'field'); 33 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (89,24,'notes.subject','title',0,'field'); 34 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (90,24,'notes.category','category',1,'field'); 35 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (91,24,'notes.content','content',2,'field'); 36 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (92,24,'assignedto.firstname like \"{{value}}%\"or assignedto.lastname like \"{{value}}%\"','assigned to',3,'whereclause'); 37 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (93,24,'assignedby.firstname like','assigned by',4,'whereclause'); 38 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (94,24,'notes.id','id',5,'field'); 39 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (96,26,'files.name','name',0,'field'); 40 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (200,200,'roles.name','name',0,'field'); -
trunk/phpbms/install/updatexml.php
r168 r170 157 157 global $vars; 158 158 159 $querystatement="SELECT id FROM users WHERE login=\"".$user."\" AND password=encode(\"".$pass."\",\"".$vars["encryption_seed"]."\") AND a ccesslevel>=90";159 $querystatement="SELECT id FROM users WHERE login=\"".$user."\" AND password=encode(\"".$pass."\",\"".$vars["encryption_seed"]."\") AND admin=1"; 160 160 $queryresult=mysql_query($querystatement,$dblink); 161 161 if(!$queryresult){ … … 309 309 //Processing Data Structure Changes 310 310 $thereturn.=processSQLfile("updatev0.7.sql"); 311 312 $querystatement="SELECT id,accesslevel FROM users WHERE accesslevel!=0"; 313 $queryresult=mysql_query($querystatement,$dblink); 314 while($therecord=mysql_fetch_array($queryresult)){ 315 while($therecord["accesslevel"]>1){ 316 if($therecord["accesslevel"]==40) 317 $therecord["accesslevel"]=$therecord["accesslevel"]-10; 318 $querystatement="INSERT INTO rolestousers (userid,roleid) VALUES (".$therecord["id"].",".$therecord["accesslevel"].")"; 319 $insertresult=mysql_query($querystatement,$dblink); 320 $therecord["accesslevel"]=$therecord["accesslevel"]-10; 321 } 322 } 323 $thereturn.=" - Connverted user access levels to roles.\n"; 311 324 312 325 //Updating Module Table -
trunk/phpbms/install/users.sql
r145 r170 1 INSERT INTO users VALUES (1,'nologin','Tá-Gó','EXTERNAL','',NOW(),0,-10,2,2,Now(),Now(),'','','','');2 INSERT INTO users VALUES (2,'admin',encode('phpbms','freeble'),'Administrator','',Now(),0,90,2,2,Now(),Now(),'','','','');1 INSERT INTO `users` (`id`, `login`, `password`, `firstname`, `lastname`, `creationdate`, `revoked`, `createdby`, `modifiedby`, `lastlogin`, `modifieddate`, `email`, `phone`, `department`, `employeenumber`, `admin`, `portalaccess`) VALUES (1,'nologin','Tá-Gó','phpBMS','Install',NOW(),1,1,1,NOW(),NULL,'','','','',0,1); 2 INSERT INTO `users` (`id`, `login`, `password`, `firstname`, `lastname`, `creationdate`, `revoked`, `createdby`, `modifiedby`, `lastlogin`, `modifieddate`, `email`, `phone`, `department`, `employeenumber`, `admin`, `portalaccess`) VALUES (2,'admin',encode('phpbms','freeble'),'Administrator',' ',NOW(),0,1,1,NOW(),NULL,'','','','',1,0); -
trunk/phpbms/loadsearch.php
r155 r170 38 38 */ 39 39 require("include/session.php"); 40 require("include/common_functions.php"); 40 41 41 42 function deleteSearch($id){ … … 108 109 }//end function 109 110 110 function showLoad($tabledefid,$basepath,$userid,$ accesslevel){111 function showLoad($tabledefid,$basepath,$userid,$securitywhere){ 111 112 global $dblink; 112 113 113 114 $querystatement="SELECT id,name,userid FROM usersearches 114 WHERE tabledefid=".$tabledefid." AND type=\"SCH\" AND ((userid=0 and accesslevel<=".$accesslevel.") OR userid=\"".$userid."\") ORDER BY userid, name";115 WHERE tabledefid=".$tabledefid." AND type=\"SCH\" AND ((userid=0 ".$securitywhere.") OR userid=\"".$userid."\") ORDER BY userid, name"; 115 116 $queryresult = mysql_query($querystatement,$dblink); 116 117 if(!$queryresult) reportError(500,"Cannot retrieve saved search infromation"); 117 118 119 120 $querystatement="SELECT advsearchroleid FROM tabledefs WHERE id=".$tabledefid ; 121 $tabledefresult = mysql_query($querystatement,$dblink); 122 if(!$tabledefresult) reportError(500,"Cannot retrieve table definition information."); 123 $tableinfo=mysql_fetch_array($tabledefresult); 118 124 119 125 ?> … … 132 138 </p> 133 139 <p> 134 <textarea id="LSSQL" rows="8" cols="10" <?php if( $_SESSION["userinfo"]["accesslevel"]<30) echo " readonly=\"readonly\""?>></textarea>140 <textarea id="LSSQL" rows="8" cols="10" <?php if(!hasRights($tableinfo["advsearchroleid"])) echo " readonly=\"readonly\""?>></textarea> 135 141 </p> 136 142 </td> … … 148 154 switch($_GET["cmd"]){ 149 155 case "show": 150 showLoad($_GET["tid"],$_GET["base"],$_SESSION["userinfo"]["id"],$_SESSION["userinfo"]["accesslevel"]); 156 $securitywhere=""; 157 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 158 $securitywhere=" AND roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 159 showLoad($_GET["tid"],$_GET["base"],$_SESSION["userinfo"]["id"],$securitywhere); 151 160 break; 152 161 case "getsearch": -
trunk/phpbms/menu.php
r166 r170 38 38 */ 39 39 40 function getMenu(){ 41 global $dblink; 42 43 $querystatement="SELECT id,name,link,accesslevel FROM menu WHERE parentid=0 ORDER BY displayorder"; 40 function getMenu($dblink){ 41 $querystatement="SELECT id,name,link,roleid FROM menu WHERE parentid=0 ORDER BY displayorder"; 44 42 $queryresult=mysql_query($querystatement,$dblink); 45 43 if(!$queryresult) reportError(1,"Error Retrieving Menu"); … … 51 49 global $dblink; 52 50 53 $querystatement="SELECT id,name,link, accesslevelFROM menu WHERE parentid=".$parentid." ORDER BY displayorder";51 $querystatement="SELECT id,name,link,roleid FROM menu WHERE parentid=".$parentid." ORDER BY displayorder"; 54 52 $queryresult=mysql_query($querystatement,$dblink); 55 53 if(!$queryresult) reportError(1,"Error Retrieving Menu"); … … 58 56 } 59 57 60 $menus=getMenu( );58 $menus=getMenu($dblink); 61 59 $nummenus=mysql_num_rows($menus); 62 60 … … 75 73 $submenustring=""; 76 74 while($menurecord=mysql_fetch_array($menus)){ 77 if( $_SESSION["userinfo"]["accesslevel"]>=$menurecord["accesslevel"]){75 if(hasRights($menurecord["roleid"])){ 78 76 if($menurecord["link"]) { 79 77 if(strpos($menurecord["link"],"http")!==0) … … 90 88 $sep=true; 91 89 else{ 92 if( $_SESSION["userinfo"]["accesslevel"]>=$subrecord["accesslevel"]){90 if(hasRights($menurecord["roleid"])){ 93 91 if(strpos($subrecord["link"],"http")!==0) 94 92 $subrecord["link"]=$_SESSION["app_path"].$subrecord["link"]; -
trunk/phpbms/modules/base/files_addedit.php
r164 r170 86 86 <input id="id" name="id" type="text" value="<?php echo $therecord["id"]; ?>" size="5" maxlength="5" readonly="true" class="uneditable" /> 87 87 </p> 88 <p id="accesslevellabel"> 89 <label for="accesslevel">access level</label><br /> 90 <?php 91 $choices=array(); 92 switch(TRUE){ 93 case ($_SESSION["userinfo"]["accesslevel"]>=90): 94 $choices[]=array("value"=>"90","name"=>"Administrator"); 95 case ($_SESSION["userinfo"]["accesslevel"]>=50): 96 $choices[]=array("value"=>"50","name"=>"Upper Manager"); 97 case ($_SESSION["userinfo"]["accesslevel"]>=30): 98 $choices[]=array("value"=>"30","name"=>"Manager (sales manager)"); 99 case ($_SESSION["userinfo"]["accesslevel"]>=20): 100 $choices[]=array("value"=>"20","name"=>"Power User (sales)"); 101 case ($_SESSION["userinfo"]["accesslevel"]>=10): 102 $choices[]=array("value"=>"10","name"=>"basic user (shipping)"); 103 } 104 basic_choicelist("accesslevel",$therecord["accesslevel"],$choices,Array("class"=>"important","tabindex"=>"10")); 105 ?><br /><span class="notes">The minimum access level required to view this attachment.</span> 88 <p id="roleidP"> 89 <label for="roleid">access (role)</label><br /> 90 <?php roles_choicelist("roleid",$therecord["roleid"],$dblink)?> 106 91 </p> 107 92 </fieldset> … … 142 127 <p id="fileidlabel"> 143 128 <label for="fileid-ds" >existing file name</label><br /> 144 <?php autofill("fileid","",26,"files.id","files.name","if(length(files.description)>20,concat(left(files.description,17),\"...\"),files.description)","files.id!=1 AND files.accesslevel<=".$_SESSION["userinfo"]["accesslevel"],Array("size"=>"40","maxlength"=>"128","style"=>"",false)) ?> 129 <?php 130 131 $securitywhere=""; 132 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 133 $securitywhere=" AND files.roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 134 autofill("fileid","",26,"files.id","files.name","if(length(files.description)>20,concat(left(files.description,17),\"...\"),files.description)","files.id!=1 ".$securitywhere,Array("size"=>"40","maxlength"=>"128","style"=>"",false)) 135 ?> 145 136 </p> 146 137 <?php }?> -
trunk/phpbms/modules/base/include/adminsettings_include.php
r145 r170 116 116 117 117 //process commands 118 if(!hasRights(-100)) 119 goURL($_SESSION["app_path"]."noaccess.php"); 120 118 121 if (isset($_POST["command"])) { 119 122 switch($_POST["command"]){ -
trunk/phpbms/modules/base/include/attachments_addedit_include.php
r166 r170 58 58 59 59 $querystatement="SELECT 60 files.id,attachments.id as attachmentid,name,description,type, accesslevel,ISNULL(file) as nofile,60 files.id,attachments.id as attachmentid,name,description,type,roleid,ISNULL(file) as nofile, 61 61 62 62 attachments.createdby, attachments.creationdate, … … 80 80 $therecord["description"]=""; 81 81 $therecord["type"]=""; 82 $therecord[" accesslevel"]=0;82 $therecord["roleid"]=0; 83 83 84 84 $therecord["createdby"]=$_SESSION["userinfo"]["id"]; … … 100 100 $name=$variables["name"]; 101 101 $querystatement.="description=\"".$variables["description"]."\", "; 102 $querystatement.=" accesslevel=".$variables["accesslevel"].", ";102 $querystatement.="roleid=".$variables["roleid"].", "; 103 103 if($_FILES['upload']["name"]){ 104 104 $name=$_FILES['upload']["name"]; … … 141 141 $querystatement="INSERT INTO files "; 142 142 143 $querystatement.="(name,description, accesslevel,type,file,143 $querystatement.="(name,description,roleid,type,file, 144 144 createdby,creationdate,modifiedby) VALUES ("; 145 145 146 146 $querystatement.="\"".$_FILES['upload']["name"]."\", "; 147 147 $querystatement.="\"".$variables["description"]."\", "; 148 $querystatement.=$variables[" accesslevel"].", ";148 $querystatement.=$variables["roleid"].", "; 149 149 $querystatement.="\"".$_FILES['upload']['type']."\", "; 150 150 $querystatement.="\"".$file."\", "; … … 186 186 //================================================================== 187 187 if(!isset($_POST["command"])){ 188 if(isset($_GET["id"])) 188 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 189 $tableresult=mysql_query($querystatement,$dblink); 190 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 191 $tablerecord=mysql_fetch_array($tableresult); 192 193 if(isset($_GET["id"])){ 194 //editing 195 if(!hasRights($tablerecord["editroleid"])) 196 goURL($_SESSION["app_path"]."noaccess.php"); 189 197 $therecord=getRecords((integer) $_GET["id"]); 190 else 198 } else { 199 if(!hasRights($tablerecord["addroleid"])) 200 goURL($_SESSION["app_path"]."noaccess.php"); 191 201 $therecord=setRecordDefaults(); 202 } 192 203 $createdby=getUserName($therecord["createdby"]); 193 204 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/files_addedit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 // These following functions and processing are similar for all pages … … 52 52 53 53 $querystatement="SELECT 54 id,name,description,type, accesslevel,54 id,name,description,type,roleid, 55 55 56 56 createdby, creationdate, … … 73 73 $therecord["description"]=""; 74 74 $therecord["type"]=""; 75 $therecord[" accesslevel"]=0;75 $therecord["roleid"]=0; 76 76 77 77 $therecord["createdby"]=$_SESSION["userinfo"]["id"]; … … 93 93 $name=$variables["name"]; 94 94 $querystatement.="description=\"".$variables["description"]."\", "; 95 $querystatement.=" accesslevel=".$variables["accesslevel"].", ";95 $querystatement.="roleid=".$variables["roleid"].", "; 96 96 if($_FILES['upload']["name"]){ 97 97 $name=$_FILES['upload']["name"]; … … 132 132 $querystatement="INSERT INTO files "; 133 133 134 $querystatement.="(name,description, accesslevel,type,file,134 $querystatement.="(name,description,roleid,type,file, 135 135 createdby,creationdate,modifiedby) VALUES ("; 136 136 137 137 $querystatement.="\"".$_FILES['upload']["name"]."\", "; 138 138 $querystatement.="\"".$variables["description"]."\", "; 139 $querystatement.=$variables[" accesslevel"].", ";139 $querystatement.=$variables["roleid"].", "; 140 140 $querystatement.="\"".$_FILES['upload']['type']."\", "; 141 141 $querystatement.="\"".$file."\", "; … … 158 158 //================================================================== 159 159 if(!isset($_POST["command"])){ 160 if(isset($_GET["id"])) 160 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 161 $tableresult=mysql_query($querystatement,$dblink); 162 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 163 $tablerecord=mysql_fetch_array($tableresult); 164 165 if(isset($_GET["id"])){ 166 //editing 167 if(!hasRights($tablerecord["editroleid"])) 168 goURL($_SESSION["app_path"]."noaccess.php"); 161 169 $therecord=getRecords((integer) $_GET["id"]); 162 else 170 } else { 171 if(!hasRights($tablerecord["addroleid"])) 172 goURL($_SESSION["app_path"]."noaccess.php"); 163 173 $therecord=setRecordDefaults(); 174 } 164 175 $createdby=getUserName($therecord["createdby"]); 165 176 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/menu_addedit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 function displayTableDropDown($selectedlink){ … … 85 85 global $dblink; 86 86 87 $querystatement="SELECT id, name, link, parentid, displayorder, accesslevel,87 $querystatement="SELECT id, name, link, parentid, displayorder, roleid, 88 88 createdby, creationdate, 89 89 modifiedby, modifieddate … … 104 104 $therecord["parentid"]=0; 105 105 $therecord["displayorder"]=0; 106 $therecord[" accesslevel"]=0;106 $therecord["roleid"]=0; 107 107 108 108 $therecord["createdby"]=$_SESSION["userinfo"]["id"]; … … 140 140 } 141 141 $querystatement.="displayorder=".$variables["displayorder"].", "; 142 $querystatement.=" accesslevel=".$variables["accesslevel"].", ";142 $querystatement.="roleid=".$variables["roleid"].", "; 143 143 144 144 //==== Almost all records should have this ========= … … 157 157 $querystatement="INSERT INTO menu "; 158 158 159 $querystatement.="(name,link,parentid,displayorder, accesslevel,159 $querystatement.="(name,link,parentid,displayorder,roleid, 160 160 createdby,creationdate,modifiedby) VALUES ("; 161 161 … … 177 177 } 178 178 $querystatement.=$variables["displayorder"].", "; 179 $querystatement.=$variables[" accesslevel"].", ";179 $querystatement.=$variables["roleid"].", "; 180 180 181 181 //==== Almost all records should have this ========= … … 195 195 //================================================================== 196 196 if(!isset($_POST["command"])){ 197 if(isset($_GET["id"])) 197 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 198 $tableresult=mysql_query($querystatement,$dblink); 199 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 200 $tablerecord=mysql_fetch_array($tableresult); 201 202 if(isset($_GET["id"])){ 203 //editing 204 if(!hasRights($tablerecord["editroleid"])) 205 goURL($_SESSION["app_path"]."noaccess.php"); 198 206 $therecord=getRecords((integer) $_GET["id"]); 199 else 207 } else { 208 if(!hasRights($tablerecord["addroleid"])) 209 goURL($_SESSION["app_path"]."noaccess.php"); 200 210 $therecord=setRecordDefaults(); 211 } 201 212 $createdby=getUserName($therecord["createdby"]); 202 213 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/notes_addedit_include.php
r166 r170 397 397 //================================================================== 398 398 if(!isset($_POST["command"])){ 399 if(isset($_GET["id"])) 399 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 400 $tableresult=mysql_query($querystatement,$dblink); 401 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 402 $tablerecord=mysql_fetch_array($tableresult); 403 404 if(isset($_GET["id"])){ 405 //editing 406 if(!hasRights($tablerecord["editroleid"])) 407 goURL($_SESSION["app_path"]."noaccess.php"); 400 408 $therecord=getRecords((integer) $_GET["id"]); 401 else 409 } else { 410 if(!hasRights($tablerecord["addroleid"])) 411 goURL($_SESSION["app_path"]."noaccess.php"); 402 412 $therecord=setRecordDefaults(); 413 } 403 414 $createdby=getUserName($therecord["createdby"]); 404 415 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/notes_search_functions.php
r145 r170 81 81 if (!$repeatqueryresult) reportError(300,"Couldn't Delete: ".mysql_error($dblink)."<BR>\n SQL STATEMENT [".$querystatement."]"); 82 82 83 $querystatement = "DELETE FROM notes WHERE ((notes.createdby=".$_SESSION["userinfo"]["id"]." or notes.assignedtoid=".$_SESSION["userinfo"]["id"].") OR (".$_SESSION["userinfo"]["a ccesslevel"]." >=90)) and (".$whereclause.") and (notes.`repeat`!=1);";83 $querystatement = "DELETE FROM notes WHERE ((notes.createdby=".$_SESSION["userinfo"]["id"]." or notes.assignedtoid=".$_SESSION["userinfo"]["id"].") OR (".$_SESSION["userinfo"]["admin"]." =1)) and (".$whereclause.") and (notes.`repeat`!=1);"; 84 84 $queryresult = mysql_query($querystatement,$dblink); 85 85 if (!$queryresult) reportError(300,"Couldn't Delete: ".mysql_error($dblink)."<BR>\n SQL STATEMENT [".$querystatement."]"); -
trunk/phpbms/modules/base/include/relationships_addedit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 function displayTables($fieldname,$selectedid){ … … 162 162 //================================================================== 163 163 if(!isset($_POST["command"])){ 164 if(isset($_GET["id"])) 164 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 165 $tableresult=mysql_query($querystatement,$dblink); 166 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 167 $tablerecord=mysql_fetch_array($tableresult); 168 169 if(isset($_GET["id"])){ 170 //editing 171 if(!hasRights($tablerecord["editroleid"])) 172 goURL($_SESSION["app_path"]."noaccess.php"); 165 173 $therecord=getRecords((integer) $_GET["id"]); 166 else 174 } else { 175 if(!hasRights($tablerecord["addroleid"])) 176 goURL($_SESSION["app_path"]."noaccess.php"); 167 177 $therecord=setRecordDefaults(); 178 } 168 179 $createdby=getUserName($therecord["createdby"]); 169 180 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/reports_addedit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 function displayTables($fieldname,$selectedid){ … … 75 75 76 76 $querystatement="SELECT 77 id,name,type,reportfile,tabledefid,description,displayorder, accesslevel,77 id,name,type,reportfile,tabledefid,description,displayorder,roleid, 78 78 79 79 createdby, creationdate, … … 98 98 $therecord["reportfile"]=""; 99 99 $therecord["displayorder"]=0; 100 $therecord[" accesslevel"]=10;100 $therecord["roleid"]=0; 101 101 $therecord["description"]=""; 102 102 … … 123 123 $querystatement.="description=\"".$variables["description"]."\", "; 124 124 $querystatement.="displayorder=".$variables["displayorder"].", "; 125 $querystatement.=" accesslevel=".$variables["accesslevel"].", ";125 $querystatement.="roleid=".$variables["roleid"].", "; 126 126 127 127 //==== Almost all records should have this ========= … … 140 140 $querystatement="INSERT INTO reports "; 141 141 142 $querystatement.="(name,type,tabledefid,reportfile,description,displayorder, accesslevel,142 $querystatement.="(name,type,tabledefid,reportfile,description,displayorder,roleid, 143 143 createdby,creationdate,modifiedby) VALUES ("; 144 144 … … 149 149 $querystatement.="\"".$variables["description"]."\", "; 150 150 $querystatement.=$variables["displayorder"].", "; 151 $querystatement.=$variables[" accesslevel"].", ";151 $querystatement.=$variables["roleid"].", "; 152 152 153 153 //==== Almost all records should have this ========= … … 168 168 //================================================================== 169 169 if(!isset($_POST["command"])){ 170 if(isset($_GET["id"])) 170 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 171 $tableresult=mysql_query($querystatement,$dblink); 172 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 173 $tablerecord=mysql_fetch_array($tableresult); 174 175 if(isset($_GET["id"])){ 176 //editing 177 if(!hasRights($tablerecord["editroleid"])) 178 goURL($_SESSION["app_path"]."noaccess.php"); 171 179 $therecord=getRecords((integer) $_GET["id"]); 172 else 180 } else { 181 if(!hasRights($tablerecord["addroleid"])) 182 goURL($_SESSION["app_path"]."noaccess.php"); 173 183 $therecord=setRecordDefaults(); 184 } 174 185 $createdby=getUserName($therecord["createdby"]); 175 186 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/tabledefs_addedit_include.php
r166 r170 41 41 //======================================================================================== 42 42 //======================================================================================== 43 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 43 44 44 45 45 //set table id … … 53 53 id,maintable,displayname,querytable,addfile,editfile,deletebutton,type,moduleid, 54 54 defaultwhereclause,defaultsortorder,defaultsearchtype,defaultcriteriafindoptions,defaultcriteriaselection, 55 searchroleid,addroleid,editroleid,advsearchroleid,viewsqlroleid, 55 56 56 57 createdby, creationdate, … … 76 77 $therecord["addfile"]=""; 77 78 $therecord["editfile"]=""; 79 $therecord["addroleid"]=0; 80 $therecord["editroleid"]=0; 78 81 $therecord["moduleid"]=1; 79 82 … … 81 84 $therecord["type"]="table"; 82 85 86 $therecord["searchroleid"]=0; 87 $therecord["advsearchroleid"]=-100; 88 $therecord["viewsqlroleid"]=-100; 83 89 $therecord["defaultwhereclause"]=""; 84 90 $therecord["defaultcriteriafindoptions"]=""; … … 86 92 $therecord["defaultsortorder"]=""; 87 93 88 $therecord["defaultsearchtype"]=" search";94 $therecord["defaultsearchtype"]=""; 89 95 90 96 $therecord["createdby"]=$_SESSION["userinfo"]["id"]; … … 120 126 $querystatement.="defaultcriteriafindoptions=\"".$variables["defaultcriteriafindoptions"]."\", "; 121 127 $querystatement.="defaultcriteriaselection=\"".$variables["defaultcriteriaselection"]."\", "; 128 129 $querystatement.="searchroleid=".$variables["searchroleid"].", "; 130 $querystatement.="addroleid=".$variables["addroleid"].", "; 131 $querystatement.="editroleid=".$variables["editroleid"].", "; 132 $querystatement.="advsearchroleid=".$variables["advsearchroleid"].", "; 133 $querystatement.="viewsqlroleid=".$variables["viewsqlroleid"].", "; 122 134 123 135 //==== Almost all records should have this ========= … … 137 149 138 150 $querystatement.="(maintable,querytable,displayname,type,moduleid,addfile,editfile,deletebutton, 139 defaultwhereclause,defaultsortorder,defaultsearchtype,defaultcriteriafindoptions,defaultcriteriaselection, 151 defaultwhereclause,defaultsortorder,defaultsearchtype,defaultcriteriafindoptions,defaultcriteriaselection,\ 152 searchroleid,addroleid,editroleid,advsearchroleid,viewsqlroleid, 153 140 154 createdby,creationdate,modifiedby) VALUES ("; 141 155 … … 156 170 $querystatement.="\"".$variables["defaultcriteriafindoptions"]."\", "; 157 171 $querystatement.="\"".$variables["defaultcriteriaselection"]."\", "; 172 173 $querystatement.=$variables["searchroleid"].", "; 174 $querystatement.=$variables["addroleid"].", "; 175 $querystatement.=$variables["editroleid"].", "; 176 $querystatement.=$variables["advsearchroleid"].", "; 177 $querystatement.=$variables["viewsqlroleid"].", "; 158 178 159 179 //==== Almost all records should have this ========= … … 174 194 //================================================================== 175 195 if(!isset($_POST["command"])){ 176 if(isset($_GET["id"])) 196 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 197 $tableresult=mysql_query($querystatement,$dblink); 198 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 199 $tablerecord=mysql_fetch_array($tableresult); 200 201 if(isset($_GET["id"])){ 202 //editing 203 if(!hasRights($tablerecord["editroleid"])) 204 goURL($_SESSION["app_path"]."noaccess.php"); 177 205 $therecord=getRecords((integer) $_GET["id"]); 178 else 206 } else { 207 if(!hasRights($tablerecord["addroleid"])) 208 goURL($_SESSION["app_path"]."noaccess.php"); 179 209 $therecord=setRecordDefaults(); 210 } 180 211 $createdby=getUserName($therecord["createdby"]); 181 212 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/include/tabledefs_columns_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 function setColumnDefaults(){ -
trunk/phpbms/modules/base/include/tabledefs_functions.php
r166 r170 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 40 // access level to admin area41 if($_SESSION["userinfo"]["accesslevel"]<90)42 goURL("noaccess.html");43 44 39 //format tabs for user admin. 45 40 function tabledefs_tabs($selected="none",$id=0) { -
trunk/phpbms/modules/base/include/tabledefs_options_include.php
r166 r170 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html");39 40 40 function setOptionDefaults(){ 41 41 $therecord["id"]=NULL; … … 43 43 $therecord["option"]=""; 44 44 $therecord["othercommand"]=0; 45 $therecord[" accesslevel"]=0;45 $therecord["roleid"]=0; 46 46 47 47 return $therecord; … … 51 51 global $dblink; 52 52 53 $querystatement="SELECT id, name, `option`, othercommand, accesslevel54 FROM tableoptions 53 $querystatement="SELECT tableoptions.id, tableoptions.name, tableoptions.option, tableoptions.othercommand, tableoptions.roleid, roles.name as rolename 54 FROM tableoptions LEFT JOIN roles ON tableoptions.roleid=roles.id 55 55 WHERE tabledefid=".$tabledefid; 56 if($optionid) $querystatement.=" AND id=".$optionid;57 $querystatement.=" ORDER BY othercommand, id";56 if($optionid) $querystatement.=" AND tableoptions.id=".$optionid; 57 $querystatement.=" ORDER BY othercommand, tableoptions.id"; 58 58 59 59 $queryresult=mysql_query($querystatement,$dblink); … … 66 66 function addOption($variables,$tabledefid){ 67 67 global $dblink; 68 $querystatement="INSERT INTO tableoptions (tabledefid, accesslevel, name, `option`, othercommand)68 $querystatement="INSERT INTO tableoptions (tabledefid, roleid, name, `option`, othercommand) 69 69 values ("; 70 70 $querystatement.=$tabledefid.", "; 71 $querystatement.=$variables[" accesslevel"].", ";71 $querystatement.=$variables["roleid"].", "; 72 72 if($variables["othercommand"]==1) { 73 73 $querystatement.="\"".$variables["name"]."\", "; … … 88 88 $querystatement="UPDATE tableoptions set "; 89 89 $querystatement.="othercommand=".$variables["othercommand"].", "; 90 $querystatement.=" accesslevel=".$variables["accesslevel"].", ";90 $querystatement.="roleid=".$variables["roleid"].", "; 91 91 if($variables["othercommand"]==1) { 92 92 $querystatement.="name=\"".$variables["name"]."\", "; -
trunk/phpbms/modules/base/include/tabledefs_quicksearch_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html");40 41 41 function setDefaultQuickSearch(){ 42 42 $therecord["id"]=NULL; … … 44 44 45 45 $therecord["name"]=""; 46 $therecord[" accesslevel"]=11;46 $therecord["roleid"]=0; 47 47 $therecord["search"]=""; 48 48 … … 52 52 function getQuicksearchs($tabledefid,$quicksearchid=false){ 53 53 global $dblink; 54 $querystatement="SELECT id, name, `search`, displayorder, accesslevel 55 FROM tablefindoptions 56 WHERE tabledefid=".$tabledefid; 57 if($quicksearchid) $querystatement.=" AND id=".$quicksearchid; 58 $querystatement.=" ORDER BY displayorder"; 54 $querystatement="SELECT tablefindoptions.id, tablefindoptions.name, tablefindoptions.search, tablefindoptions.displayorder, roleid, 55 roles.name as rolename 56 FROM tablefindoptions LEFT JOIN roles ON tablefindoptions.roleid=roles.id 57 WHERE tablefindoptions.tabledefid=".$tabledefid; 58 if($quicksearchid) $querystatement.=" AND tablefindoptions.id=".$quicksearchid; 59 $querystatement.=" ORDER BY tablefindoptions.displayorder"; 59 60 60 61 $thequery=mysql_query($querystatement) or $thequery=mysql_error($dblink)." -- ".$querystatement; … … 65 66 function addQuicksearch($variables,$tabledefid){ 66 67 global $dblink; 67 $querystatement="INSERT INTO tablefindoptions (tabledefid, name, `search`, accesslevel, displayorder)68 $querystatement="INSERT INTO tablefindoptions (tabledefid, name, `search`, roleid, displayorder) 68 69 values ("; 69 70 $querystatement.=$tabledefid.", "; 70 71 $querystatement.="\"".$variables["name"]."\", "; 71 72 $querystatement.="\"".$variables["search"]."\", "; 72 $querystatement.="\"".$variables[" accesslevel"]."\", ";73 $querystatement.="\"".$variables["roleid"]."\", "; 73 74 $querystatement.="\"".$variables["displayorder"]."\")"; 74 75 if(mysql_query($querystatement)) $thereturn ="Quick Search Item Added"; else $thereturn=mysql_error($dblink)." -- ".$querystatement; … … 82 83 $querystatement="UPDATE tablefindoptions set "; 83 84 $querystatement.="name=\"".$variables["name"]."\", "; 84 $querystatement.=" accesslevel=\"".$variables["accesslevel"]."\", ";85 $querystatement.="roleid=\"".$variables["roleid"]."\", "; 85 86 $querystatement.="`search`=\"".$variables["search"]."\" "; 86 87 $querystatement.="WHERE id=".$variables["quicksearchid"]; -
trunk/phpbms/modules/base/include/tabledefs_searchfields_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 function setDefaultSearchField(){ 42 42 $therecord["id"]=NULL; -
trunk/phpbms/modules/base/include/usersearches_edit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 function displayTables($fieldname,$selectedid){ … … 67 67 68 68 $querystatement="SELECT 69 id, name, userid, tabledefid, sqlclause, type, accesslevel69 id, name, userid, tabledefid, sqlclause, type, roleid 70 70 71 71 FROM usersearches … … 87 87 $therecord["tabledefid"]=NULL; 88 88 $therecord["sqlclause"]=""; 89 $therecord[" accesslevel"]=10;89 $therecord["roleid"]=0; 90 90 $therecord["type"]=""; 91 91 … … 108 108 $querystatement.="name=\"".$variables["name"]."\", "; 109 109 $querystatement.="tabledefid=\"".$variables["tabledefid"]."\", "; 110 if(isset($variables[" accesslevel"]))$querystatement.="accesslevel=\"".$variables["accesslevel"]."\", ";110 if(isset($variables["roleid"]))$querystatement.="roleid=\"".$variables["roleid"]."\", "; 111 111 if(isset($variables["type"]))$querystatement.="type=\"".$variables["type"]."\", "; 112 112 $querystatement.="sqlclause=\"".$variables["sqlclause"]."\" "; … … 126 126 //================================================================== 127 127 if(!isset($_POST["command"])){ 128 if(isset($_GET["id"])) 128 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 129 $tableresult=mysql_query($querystatement,$dblink); 130 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 131 $tablerecord=mysql_fetch_array($tableresult); 132 133 if(isset($_GET["id"])){ 134 //editing 135 if(!hasRights($tablerecord["editroleid"])) 136 goURL($_SESSION["app_path"]."noaccess.php"); 129 137 $therecord=getRecords((integer) $_GET["id"]); 130 else 138 } else { 139 if(!hasRights($tablerecord["addroleid"])) 140 goURL($_SESSION["app_path"]."noaccess.php"); 131 141 $therecord=setRecordDefaults(); 142 } 132 143 $username=getUserName($therecord["userid"]); 133 144 if(!$username) $username="global"; -
trunk/phpbms/modules/base/include/users_addedit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 42 42 // These following functions and processing are similar for all pages … … 47 47 $tableid=9; 48 48 49 function assignRoles($id,$roles,$dblink){ 50 $querystatement="DELETE FROM rolestousers WHERE userid=".$id; 51 $queryresult=mysql_query($querystatement,$dblink); 52 if(!$queryresult) reportError(300,"Could not remove existing user roles: ".$querystatement); 53 $newroles=explode(",",$roles); 54 foreach($newroles as $therole) 55 if($therole!=""){ 56 $querystatement="INSERT INTO rolestousers (userid,roleid) VALUES(".$id.",".$therole.")"; 57 $queryresult=mysql_query($querystatement,$dblink); 58 if(!$queryresult) reportError(300,"Could not add new role."); 59 } 60 } 61 62 function displayRoles($id,$type,$dblink){ 63 $querystatement="SELECT roles.id,roles.name 64 FROM roles INNER JOIN rolestousers ON rolestousers.roleid=roles.id 65 WHERE rolestousers.userid=".$id; 66 $assignedquery=mysql_query($querystatement,$dblink); 67 if(!$assignedquery) reportError(300,"Could not retrieve assigned roles ".mysql_query($dblink)); 68 $thelist=array(); 69 70 if($type=="available"){ 71 $excludelist=array(); 72 while($therecord=mysql_fetch_array($assignedquery)) 73 $excludelist[]=$therecord["id"]; 74 75 $querystatement="SELECT id,name FROM roles WHERE inactive=0"; 76 $availablequery=mysql_query($querystatement,$dblink); 77 if(!$availablequery) reportError(300,"Could not retrieve available roles"); 78 while($therecord=mysql_fetch_array($availablequery)) 79 if(!in_array($therecord["id"],$excludelist)) 80 $thelist[]=$therecord; 81 } else 82 while($therecord=mysql_fetch_array($assignedquery)) 83 $thelist[]=$therecord; 84 85 foreach($thelist as $theoption){ 86 ?> <option value="<?php echo $theoption["id"]?>"><?php echo htmlQuotes($theoption["name"])?></option> 87 <?php 88 } 89 } 90 49 91 function getRecords($id){ 50 92 //======================================================================================== 51 93 global $dblink; 52 94 53 $querystatement="select id, login, firstname, lastname, a ccesslevel,95 $querystatement="select id, login, firstname, lastname, admin,portalaccess, 54 96 date_Format(lastlogin,\"%c/%e/%Y %T\") as lastlogin, revoked, 55 97 email,phone,department,employeenumber, … … 81 123 82 124 $therecord["revoked"]=0; 83 $therecord["accesslevel"]=10; 125 $therecord["admin"]=0; 126 $therecord["portalaccess"]=0; 84 127 $therecord["lastlogin"]=NULL; 85 128 … … 109 152 $querystatement.="employeenumber=\"".$variables["employeenumber"]."\", "; 110 153 111 $querystatement.="accesslevel=".$variables["accesslevel"].", "; 154 if($variables["password"]) $querystatement.="password=encode(\"".$variables["password"]."\",\"".$_SESSION["encryption_seed"]."\"), "; 155 112 156 if(isset($variables["revoked"])) $querystatement.="revoked=1, "; else $querystatement.="revoked=0, "; 113 114 if( $variables["password"]) $querystatement.="password=encode(\"".$variables["password"]."\",\"".$_SESSION["encryption_seed"]."\"), ";157 if(isset($variables["admin"])) $querystatement.="admin=1, "; else $querystatement.="admin=0, "; 158 if(isset($variables["portalaccess"])) $querystatement.="portalaccess=1, "; else $querystatement.="portalaccess=0, "; 115 159 116 160 //==== Almost all records should have this ========= … … 120 164 $thequery = mysql_query($querystatement,$dblink); 121 165 if(!$thequery) reportError(300,"Update Failed: ".mysql_error($dblink)." -- ".$querystatement); 166 167 if($variables["roleschanged"]==1) 168 assignRoles($variables["id"],$variables["newroles"],$dblink); 122 169 }// end function 123 170 … … 130 177 131 178 $querystatement.="(login,lastname,firstname,email,phone,department,employeenumber, 132 password, accesslevel,revoked,179 password,revoked,admin,portalaccess, 133 180 createdby,creationdate,modifiedby) VALUES ("; 134 181 … … 143 190 144 191 $querystatement.="encode(\"".$variables["password"]."\",\"".$_SESSION["encryption_seed"]."\"), "; 145 $querystatement.=$variables["accesslevel"].", ";146 192 if(isset($variables["revoked"])) $querystatement.="1, "; else $querystatement.="0, "; 193 if(isset($variables["admin"])) $querystatement.="1, "; else $querystatement.="0, "; 194 if(isset($variables["portalaccess"])) $querystatement.="1, "; else $querystatement.="0, "; 147 195 148 196 //==== Almost all records should have this ========= … … 153 201 $thequery = mysql_query($querystatement,$dblink); 154 202 if(!$thequery) die ("Insert Failed: ".mysql_error($dblink)." -- ".$querystatement); 155 return mysql_insert_id($dblink); 203 204 $newid=mysql_insert_id($dblink); 205 206 return $newid; 156 207 } 157 208 … … 162 213 //================================================================== 163 214 if(!isset($_POST["command"])){ 164 if(isset($_GET["id"])) 215 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 216 $tableresult=mysql_query($querystatement,$dblink); 217 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 218 $tablerecord=mysql_fetch_array($tableresult); 219 220 if(isset($_GET["id"])){ 221 //editing 222 if(!hasRights($tablerecord["editroleid"])) 223 goURL($_SESSION["app_path"]."noaccess.php"); 165 224 $therecord=getRecords((integer) $_GET["id"]); 166 else 225 } else { 226 if(!hasRights($tablerecord["addroleid"])) 227 goURL($_SESSION["app_path"]."noaccess.php"); 167 228 $therecord=setRecordDefaults(); 229 } 168 230 $createdby=getUserName($therecord["createdby"]); 169 231 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/base/javascript/file.js
r145 r170 42 42 var newlabel=getObjectFromID("fileidlabel"); 43 43 var existinglabel=getObjectFromID("uploadlabel"); 44 var accesslevel=getObjectFromID("accesslevellabel");44 var roleid=getObjectFromID("roleidP"); 45 45 var descriptionlabel=getObjectFromID("descriptionlabel"); 46 46 … … 48 48 newlabel.style.display="none"; 49 49 existinglabel.style.display="block"; 50 accesslevel.style.display="block";50 roleid.style.display="block"; 51 51 descriptionlabel.style.display="block"; 52 52 } else { 53 53 newlabel.style.display="block"; 54 54 existinglabel.style.display="none"; 55 accesslevel.style.display="none";55 roleid.style.display="none"; 56 56 descriptionlabel.style.display="none"; 57 57 } -
trunk/phpbms/modules/base/menu_addedit.php
r155 r170 52 52 <link href="../../common/stylesheet/<?php echo $_SESSION["stylesheet"] ?>/pages/menus.css" rel="stylesheet" type="text/css" /> 53 53 <script language="JavaScript" src="../../common/javascript/fields.js" type="text/javascript"></script> 54 <script language="JavaScript" src="javascript/menu.js"></script>55 54 </head> 56 55 <body><?php include("../../menu.php")?> … … 71 70 <p> 72 71 <label for="displayorder">display order</label><br /> 73 <?php field_text("displayorder",$therecord["displayorder"],1,"Display order cannot be blank and must be a valid integer.","integer",Array("size"=>"9","maxlength"=>"3")); ?><br >72 <?php field_text("displayorder",$therecord["displayorder"],1,"Display order cannot be blank and must be a valid integer.","integer",Array("size"=>"9","maxlength"=>"3")); ?><br /> 74 73 <span class="notes"><strong>Note:</strong> Lower numbers are displayed first.</span> 75 74 </p> 76 75 77 76 <p> 78 <label for=" accesslevel">access level</label><br />79 <?php basic_choicelist("accesslevel",$therecord["accesslevel"],array(array("value"=>"-10","name"=>"portal access only"),array("value"=>"10","name"=>"basic user (shipping)"),array("value"=>"20","name"=>"Power User (sales)"),array("value"=>"30","name"=>"Manager (sales manager)"),array("value"=>"50","name"=>"Upper Manager"),array("value"=>"90","name"=>"Administrator")),Array("class"=>"important"));?>77 <label for="roleid">access (role)</label><br /> 78 <?php roles_choicelist("roleid",$therecord["roleid"],$dblink)?> 80 79 </p> 81 80 </fieldset> … … 94 93 <br /> 95 94 <input type="radio" id="type1" value="cat" <?php if($therecord["link"]=="") echo "checked" ?> name="radio" onClick="showTypeDetails();" class="radiochecks" /><label for="type1">category</label><br /> 96 <img src="menu-example-category.png" width="150" height="72" class="typeImage" >95 <img src="menu-example-category.png" width="150" height="72" class="typeImage" alt="category" /> 97 96 </p> 98 97 … … 100 99 <br /> 101 100 <input type="radio" id="type2" value="search" <?php if(strpos($therecord["link"],"search.php?id=")!==false) echo "checked" ?> name="radio" onClick="showTypeDetails();" class="radiochecks" /><label for="type2">table definition search</label><br /> 102 <img src="menu-example-tabledef.png" width="150" height="72" class="typeImage" >101 <img src="menu-example-tabledef.png" width="150" height="72" class="typeImage" alt="table definition search" /> 103 102 </p> 104 103 … … 106 105 <br /> 107 106 <input type="radio" id="type3" value="link" <?php if(strpos($therecord["link"],"search.php?id=")===false && $therecord["link"]!="") echo "checked" ?> name="radio" onClick="showTypeDetails();" class="radiochecks" /><label for="type3">page link</label><br /> 108 <img src="menu-example-link.png" width="150" height="72" class="typeImage" >107 <img src="menu-example-link.png" width="150" height="72" class="typeImage" alt="page link" /> 109 108 </p> 110 109 </fieldset> -
trunk/phpbms/modules/base/notes_addedit.php
r166 r170 264 264 </fieldset> 265 265 <?php include("../../include/createmodifiedby.php"); ?> 266 <?php if ($_SESSION["userinfo"]["id"] != $therecord["createdby"] && $therecord["createdby"]!="" && $_SESSION["userinfo"]["id"] != $therecord["assignedtoid"] && $_SESSION["userinfo"]["accesslevel"]<90)267 echo "<SCRIPT language=\"javascript\">disableSave()</SCRIPT>";?>268 266 </div> 269 267 <?php include("../../footer.php")?> -
trunk/phpbms/modules/base/reports_addedit.php
r155 r170 80 80 </p> 81 81 <p> 82 <label for=" accesslevel" >access<br /></label>83 <?php basic_choicelist("accesslevel",$therecord["accesslevel"],array(array("value"=>"-10","name"=>"portal access only"),array("value"=>"10","name"=>"basic user (shipping)"),array("value"=>"20","name"=>"Power User (sales)"),array("value"=>"30","name"=>"Manager (sales manager)"),array("value"=>"50","name"=>"Upper Manager"),array("value"=>"90","name"=>"Administrator")),Array("class"=>"important","tabindex"=>"30"));?>82 <label for="roleid" >access (role)</label><br /> 83 <?php roles_choicelist("roleid",$therecord["roleid"],$dblink)?> 84 84 </p> 85 85 </fieldset> -
trunk/phpbms/modules/base/tabledefs_addedit.php
r159 r170 55 55 <script language="JavaScript" src="../../common/javascript/fields.js" type="text/javascript"></script> 56 56 <script language="JavaScript" src="../../common/javascript/autofill.js" type="text/javascript"></script> 57 <script language="JavaScript" src="javascript/tabledefs.js" type="text/javascript"></script> 57 58 </head> 58 59 <body><?php include("../../menu.php")?> … … 81 82 <?php autofill("moduleid",$therecord["moduleid"],21,"modules.id","modules.name","concat('v',modules.version)","",Array("size"=>"20","maxlength"=>"32"),true,"Module is requred.") ?> 82 83 </div> 83 <p>84 <label for="deletebutton">delete button name</label><br />85 <input id="deletebutton" name="deletebutton" type="text" value="<?php echo htmlQuotes($therecord["deletebutton"])?>" size="20" maxlength="20" /><br />86 </p>87 84 </fieldset> 88 85 … … 92 89 <p> 93 90 <br /> 94 <?php field_text("displayname",$therecord["displayname"],1,"Display Name cannot be blank.","",Array("size"=>" 40","maxlength"=>"64","class"=>"important")); ?>91 <?php field_text("displayname",$therecord["displayname"],1,"Display Name cannot be blank.","",Array("size"=>"50","maxlength"=>"64","class"=>"important")); ?> 95 92 </p> 96 93 </fieldset> … … 100 97 <p> 101 98 <label for="maintable">primary table name</label><br /> 102 <?php field_text("maintable",$therecord["maintable"],1,"Primary table name cannot be blank.","",Array("size"=>" 32","maxlength"=>"64","class"=>"")); ?>99 <?php field_text("maintable",$therecord["maintable"],1,"Primary table name cannot be blank.","",Array("size"=>"50","maxlength"=>"64","class"=>"")); ?> 103 100 </p> 104 101 <p> … … 114 111 </p> 115 112 </fieldset> 113 114 <fieldset> 115 <legend>add/edit options</legend> 116 <p> 117 <label for="addfile">add record file</label><br /> 118 <?php field_text("addfile",$therecord["addfile"],1,"Add file name cannot be blank.","",Array("size"=>"100","maxlength"=>"128")); ?><br /> 119 <span class="notes">file name, including path from application root, that is used for creating new records.</span> 120 </p> 121 <p> 122 add access (role)<br /> 123 <?php roles_choicelist("addroleid",$therecord["addroleid"],$dblink)?> 124 </p> 125 <p> </p> 126 <p> 127 <label for="editfile">edit record file </label><br /> 128 <?php field_text("editfile",$therecord["editfile"],1,"Edit file name cannot be blank.","",Array("size"=>"100","maxlength"=>"128")); ?><br /> 129 <span class="notes">file name, including path from application root, that is used for editing existing records.</span> 130 </p> 131 <p> 132 edit access (role)<br /> 133 <?php roles_choicelist("editroleid",$therecord["editroleid"],$dblink)?> 134 </p> 135 </fieldset> 136 137 <fieldset> 138 <legend>search screen options</legend> 139 <p> 140 <label for="searchroleid">search access (role)</label><br /> 141 <?php roles_choicelist("searchroleid",$therecord["searchroleid"],$dblink)?> 142 </p> 143 <p> 144 <label for="advsearchroleid">advanced search access (role)</label><br /> 145 <?php roles_choicelist("advsearchroleid",$therecord["advsearchroleid"],$dblink)?> 146 </p> 147 <p> 148 <label for="viewsqlroleid">view sql access (role)</label><br /> 149 <?php roles_choicelist("viewsqlroleid",$therecord["viewsqlroleid"],$dblink)?> 150 </p> 151 <p> 152 <label for="deletebutton">delete button name</label><br /> 153 <input id="deletebutton" name="deletebutton" type="text" value="<?php echo htmlQuotes($therecord["deletebutton"])?>" size="20" maxlength="20" /><br /> 154 </p> 155 <p> 156 <label for="defaultwhereclause">default search</label> <span class="notes">SQL WHERE clause</span><br /> 157 <textarea id="defaultwhereclause" name="defaultwhereclause" cols="32" rows="4"><?php echo htmlQuotes($therecord["defaultwhereclause"])?></textarea> 158 <script language="JavaScript" type="text/javascript">requiredArray[requiredArray.length]=new Array('defaultwhereclause','default search cannot be blank.');</script> 159 </p> 160 161 <p> 162 <label for="defaultsortorder">default sort order</label> <span class="notes">SQL ORDER BY clause</span><br /> 163 <textarea id="defaultsortorder" name="defaultsortorder" cols="32" rows="4"><?php echo htmlQuotes($therecord["defaultsortorder"])?></textarea> 164 <script language="JavaScript" type="text/javascript">requiredArray[requiredArray.length]=new Array('defaultsortorder','default sort order cannot be blank.');</script> 165 </p> 166 <p> 167 Does the default search (above) correspond to a quick search (find drop down) item?<br /> 168 <input type="radio" id="defaultsearchtypeNone" name="defaultsearchtype" class="radiochecks" value="" <?php if($therecord["defaultsearchtype"]=="") echo "checked=\"checked\""?> onchange="toggleDefaultSearch()" /> 169 <label for="defaultsearchtypeNone">no</label> 170 171 <input type="radio" id="defaultsearchtypeSearch" name="defaultsearchtype" class="radiochecks" value="search" <?php if($therecord["defaultsearchtype"]=="search") echo "checked=\"checked\""?> onchange="toggleDefaultSearch()" /> 172 <label for="defaultsearchtypeNone">yes</label> 173 </p> 174 <div id="defaultQuickSearch" <?php if($therecord["defaultsearchtype"]=="") echo "style=\"display:none;\""?>> 175 <p> 176 <label for="defaultcriteriafindoptions">critera: selected find option</label> <span class="notes">(quick search)</span><br/> 177 <textarea id="defaultcriteriafindoptions" name="defaultcriteriafindoptions" cols="32" rows="2"><?php echo htmlQuotes($therecord["defaultcriteriafindoptions"])?></textarea> 178 179 </p> 180 <p> 181 <label for="defaultcriteriaselection">criteria: selected search field</label><br /> 182 <textarea id="defaultcriteriaselection" name="defaultcriteriaselection" cols="32" rows="2" ><?php echo htmlQuotes($therecord["defaultcriteriaselection"])?></textarea> 183 </p> 184 </div> 185 </fieldset> 116 186 </div> 117 118 <fieldset>119 <legend>file references</legend>120 <p>121 <label for="addfile">add new record file name</label><br />122 <?php field_text("addfile",$therecord["addfile"],1,"Add file name cannot be blank.","",Array("size"=>"100","maxlength"=>"128")); ?>123 </p>124 <p>125 <label for="editfile">edit record file name</label><br />126 <?php field_text("editfile",$therecord["editfile"],1,"Edit file name cannot be blank.","",Array("size"=>"100","maxlength"=>"128")); ?>127 </p>128 <p class="notes">129 Location of add and edit files, including path from phpBMS root. In most cases, they should be the same.130 </p>131 </fieldset>132 133 <fieldset>134 <legend>search/display defaults</legend>135 <p>136 <label for="defaultwhereclause">default search</label> <span class="notes">SQL WHERE clause</span><br />137 <textarea id="defaultwhereclause" name="defaultwhereclause" cols="32" rows="4"><?php echo htmlQuotes($therecord["defaultwhereclause"])?></textarea>138 <script language="JavaScript" type="text/javascript">requiredArray[requiredArray.length]=new Array('defaultwhereclause','default search cannot be blank.');</script>139 </p>140 141 <p>142 <label for="defaultsortorder">default sort order</label> <span class="notes">SQL ORDER BY clause</span><br />143 <textarea id="defaultsortorder" name="defaultsortorder" cols="32" rows="4"><?php echo htmlQuotes($therecord["defaultsortorder"])?></textarea>144 <script language="JavaScript" type="text/javascript">requiredArray[requiredArray.length]=new Array('defaultsortorder','default sort order cannot be blank.');</script>145 </p>146 <p>147 Is default search a quick search item?<br />148 <input type="radio" id="defaultsearchtypeNone" name="defaultsearchtype" class="radiochecks" value="" <?php if($therecord["defaultsearchtype"]=="") echo "checked=\"checked\""?> />149 <label for="defaultsearchtypeNone">no</label> 150 151 <input type="radio" id="defaultsearchtypeSearch" name="defaultsearchtype" class="radiochecks" value="search" <?php if($therecord["defaultsearchtype"]=="search") echo "checked=\"checked\""?> />152 <label for="defaultsearchtypeNone">yes</label> 153 </p>154 155 <p>156 If yes to the above question:157 </p>158 <p>159 <label for="defaultcriteriafindoptions">critera: selected find option</label> <span class="notes">(quick search)</span><br/>160 <textarea id="defaultcriteriafindoptions" name="defaultcriteriafindoptions" cols="32" rows="4"><?php echo htmlQuotes($therecord["defaultcriteriafindoptions"])?></textarea>161 162 </p>163 <p>164 <label for="defaultcriteriaselection">criteria: selected search field</label><br />165 <textarea id="defaultcriteriaselection" name="defaultcriteriaselection" cols="32" rows="4" ><?php echo htmlQuotes($therecord["defaultcriteriaselection"])?></textarea>166 </p>167 </fieldset>168 187 169 188 <?php include("../../include/createmodifiedby.php"); ?> -
trunk/phpbms/modules/base/tabledefs_options.php
r160 r170 115 115 <th nowrap align="left">name</th> 116 116 <th nowrap align="left">option / function</th> 117 <th nowrap align="center"> restricted</th>117 <th nowrap align="center">access</th> 118 118 <th nowrap> </th> 119 119 </tr> … … 139 139 } 140 140 ?></td> 141 <td nowrap align="center"><?php if ($therecord["accesslevel"]>10) echo "X"; else echo "·";?></td>141 <td nowrap align="center"><?php displayRights($therecord["roleid"],$therecord["rolename"])?></td> 142 142 143 143 <td nowrap valign="top"> … … 191 191 </div> 192 192 <p> 193 <label for=" accesslevel">access level</label><br />194 <?php basic_choicelist("accesslevel",$theoption["accesslevel"],array(array("value"=>"-10","name"=>"portal access only"),array("value"=>"10","name"=>"basic user (shipping)"),array("value"=>"20","name"=>"Power User (sales)"),array("value"=>"30","name"=>"Manager (sales manager)"),array("value"=>"50","name"=>"Upper Manager"),array("value"=>"90","name"=>"Administrator")),Array("class"=>"important"));?>193 <label for="roleid">access (role)</label><br /> 194 <?php roles_choicelist("roleid",$theoption["roleid"],$dblink)?> 195 195 </p> 196 196 -
trunk/phpbms/modules/base/tabledefs_quicksearch.php
r160 r170 104 104 <th nowrap align="left">Name</th> 105 105 <th width="100%" nowrap align="left">Search</th> 106 <th width="100%" nowrap class="queryheader" align="left">Access Level</th>106 <th width="100%" nowrap class="queryheader" align="left">Access</th> 107 107 <th nowrap> </th> 108 108 </tr> … … 122 122 <td nowrap valign="top"><strong><?php echo htmlQuotes($therecord["name"])?></strong></td> 123 123 <td valign="top" class="small"><?php echo htmlQuotes($therecord["search"])?></td> 124 <td valign="top" align=center class="small" ><?php echo htmlQuotes($therecord["accesslevel"])?></td>124 <td valign="top" align=center class="small" nowrap><?php echo displayRights($therecord["roleid"],$therecord["rolename"])?></td> 125 125 <td nowrap valign="top"> 126 126 <button id="edit<?php echo $therecord["id"]?>" type="button" onclick="document.location='<?php echo $_SERVER["PHP_SELF"]."?id=".$_GET["id"]."&command=edit&quicksearchid=".$therecord["id"]?>';" class="graphicButtons buttonEdit"><span>edit</span></button> … … 148 148 </p> 149 149 <p> 150 <label for=" accesslevel">access level</label><br />151 <?php basic_choicelist("accesslevel",$thequicksearch["accesslevel"],array(array("value"=>"-10","name"=>"portal access only"),array("value"=>"10","name"=>"basic user (shipping)"),array("value"=>"20","name"=>"Power User (sales)"),array("value"=>"30","name"=>"Manager (sales manager)"),array("value"=>"50","name"=>"Upper Manager"),array("value"=>"90","name"=>"Administrator")));?>150 <label for="roleid">access (role)</label><br /> 151 <?php roles_choicelist("roleid",$thequicksearch["roleid"],$dblink)?> 152 152 </p> 153 153 <p> -
trunk/phpbms/modules/base/usersearches_edit.php
r157 r170 90 90 <?php } else {?> 91 91 <p> 92 <label for=" accesslevel">access level</label><br />93 <?php basic_choicelist("accesslevel",$therecord["accesslevel"],array(array("value"=>"-10","name"=>"portal access only"),array("value"=>"10","name"=>"basic user (shipping)"),array("value"=>"20","name"=>"Power User (sales)"),array("value"=>"30","name"=>"Manager (sales manager)"),array("value"=>"50","name"=>"Upper Manager"),array("value"=>"90","name"=>"Administrator")),Array("class"=>"important"));?>92 <label for="roleid">access (role)</label><br /> 93 <?php roles_choicelist("roleid",$therecord["roleid"],$dblink)?> 94 94 </p> 95 95 <?php } ?> -
trunk/phpbms/modules/base/users_addedit.php
r155 r170 54 54 <script language="JavaScript" src="../../common/javascript/fields.js" type="text/javascript"></script> 55 55 <script language="JavaScript" src="../../common/javascript/choicelist.js" type="text/javascript"></script> 56 <script language="JavaScript" type="text/javascript"> 57 function checkPassword(theform){ 58 if(theform["password"].value!=theform["password2"].value && theform["command"].value!="cancel"){ 59 alert("Passwords did not match."); 60 return false; 61 } 62 return true; 63 } 64 </script> 56 <script language="JavaScript" src="javascript/users.js" type="text/javascript"></script> 65 57 </head> 66 58 <body><?php include("../../menu.php")?> 67 <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record" onSubmit="return (validateForm(this) && checkPassword(this));"><div id="dontSubmit"><input type="submit" value=" " onClick="return false;" /></div>59 <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record" onSubmit="return submitForm(this);"><div id="dontSubmit"><input type="submit" value=" " onClick="return false;" /></div> 68 60 <div class="bodyline"> 69 61 <div id="topButtons"><?php showSaveCancel(1); ?></div> … … 78 70 </p> 79 71 80 <p> 81 <label for="accesslevel" class="important">access level</label><br /> 82 <?php basic_choicelist("accesslevel",$therecord["accesslevel"],array(array("value"=>"-10","name"=>"portal access only"),array("value"=>"10","name"=>"basic user (shipping)"),array("value"=>"20","name"=>"Power User (sales)"),array("value"=>"30","name"=>"Manager (sales manager)"),array("value"=>"50","name"=>"Upper Manager"),array("value"=>"90","name"=>"Administrator")),Array("class"=>"important"));?> 72 <p><?php field_checkbox("admin",$therecord["admin"])?><label for="admin">administrator</label></p> 73 74 75 <p><?php field_checkbox("revoked",$therecord["revoked"])?><label for="revoked">revoke access</label></p> 76 77 <p> 78 <?php field_checkbox("portalaccess",$therecord["portalaccess"])?><label for="admin">portal access</label><br /> 79 <span class="notes"> 80 user accounts marked as portal access cannot login to phpBMS, but are used by external applications 81 when creating/modifiying information from outside the application for recording purposes. 82 </span> 83 83 </p> 84 85 <p><?php field_checkbox("revoked",$therecord["revoked"])?><label for="revoked">revoke access</label></p>86 84 </fieldset> 87 85 … … 141 139 </p> 142 140 </fieldset> 141 <?php if($therecord["id"]){?> 142 <fieldset> 143 <legend>roles</legend> 144 <input type="hidden" name="roleschanged" id="roleschanged" value="0" /> 145 <input type="hidden" name="newroles" id="newroles" value="" /> 146 <div class="fauxP"> 147 <div id="assignedrolesdiv"> 148 assigned roles<br /> 149 <select id="assignedroles" size="10" multiple> 150 <?php displayRoles($therecord["id"],"assigned",$dblink)?> 151 </select> 152 </div> 153 <div id="rolebuttonsdiv"> 154 <p> 155 <button type="button" class="Buttons" onclick="moveRole('availableroles','assignedroles')">< add role</button> 156 </p> 157 <p> 158 <button type="button" class="Buttons" onclick="moveRole('assignedroles','availableroles')">remove role ></button> 159 </p> 160 </div> 161 <div id="availablerolesdiv"> 162 available roles<br /> 163 <select id="availableroles" size="10" multiple> 164 <?php displayRoles($therecord["id"],"available",$dblink)?> 165 </select> 166 </div> 167 </div> 168 </fieldset> 169 <?php }?> 143 170 </div> 144 171 -
trunk/phpbms/modules/bms/clients_attachments.php
r145 r170 48 48 $tabledefid=2; 49 49 $refid=(integer) $_GET["refid"]; 50 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid." AND files.accesslevel<=".$_SESSION["userinfo"]["accesslevel"]; 50 51 $securitywhere=""; 52 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 53 $securitywhere=" AND files.roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 54 55 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid.$securitywhere; 51 56 $backurl="../bms/clients_attachments.php"; 52 57 $base="../../"; -
trunk/phpbms/modules/bms/include/clientemailprojects_edit_include.php
r166 r170 38 38 */ 39 39 40 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 40 41 41 function getEmailInfo($id){ 42 42 global $dblink; … … 131 131 //================================================================== 132 132 if(!isset($_POST["command"])){ 133 if(isset($_GET["id"])) 133 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 134 $tableresult=mysql_query($querystatement,$dblink); 135 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 136 $tablerecord=mysql_fetch_array($tableresult); 137 138 if(isset($_GET["id"])){ 139 //editing 140 if(!hasRights($tablerecord["editroleid"])) 141 goURL($_SESSION["app_path"]."noaccess.php"); 134 142 $therecord=getRecords((integer) $_GET["id"]); 135 else 143 } else { 144 if(!hasRights($tablerecord["addroleid"])) 145 goURL($_SESSION["app_path"]."noaccess.php"); 136 146 $therecord=setRecordDefaults(); 147 } 137 148 $username=getUserName($therecord["userid"]); 138 149 if(!$username) $username="global"; -
trunk/phpbms/modules/bms/include/clientemailprojects_search_functions.php
r166 r170 41 41 //functions 42 42 //============================================= 43 if($_SESSION["userinfo"]["accesslevel"]<90) goURL($_SESSION["app_path"]."noaccess.html"); 43 44 44 45 45 //delete -
trunk/phpbms/modules/bms/include/clients_addedit_include.php
r166 r170 285 285 //================================================================== 286 286 if(!isset($_POST["command"])){ 287 if(isset($_GET["id"])) 287 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 288 $tableresult=mysql_query($querystatement,$dblink); 289 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 290 $tablerecord=mysql_fetch_array($tableresult); 291 292 if(isset($_GET["id"])){ 293 //editing 294 if(!hasRights($tablerecord["editroleid"])) 295 goURL($_SESSION["app_path"]."noaccess.php"); 288 296 $therecord=getRecords((integer) $_GET["id"]); 289 else 297 } else { 298 if(!hasRights($tablerecord["addroleid"])) 299 goURL($_SESSION["app_path"]."noaccess.php"); 290 300 $therecord=setRecordDefaults(); 301 } 291 302 $createdby=getUserName($therecord["createdby"]); 292 303 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/bms/include/discounts_addedit_include.php
r166 r170 179 179 //================================================================== 180 180 if(!isset($_POST["command"])){ 181 if(isset($_GET["id"])) 181 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 182 $tableresult=mysql_query($querystatement,$dblink); 183 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 184 $tablerecord=mysql_fetch_array($tableresult); 185 186 if(isset($_GET["id"])){ 187 //editing 188 if(!hasRights($tablerecord["editroleid"])) 189 goURL($_SESSION["app_path"]."noaccess.php"); 182 190 $therecord=getRecords((integer) $_GET["id"]); 183 else 191 } else { 192 if(!hasRights($tablerecord["addroleid"])) 193 goURL($_SESSION["app_path"]."noaccess.php"); 184 194 $therecord=setRecordDefaults(); 195 } 185 196 $stats=getTotals($therecord["id"]); 186 197 $createdby=getUserName($therecord["createdby"]); -
trunk/phpbms/modules/bms/include/invoices_addedit_include.php
r166 r170 318 318 $querystatement.="trackingno=\"".$variables["trackingno"]."\", "; 319 319 320 if( $_SESSION["userinfo"]["accesslevel"]>=20){320 if(hasRights(20)){ 321 321 $querystatement.="paymentmethod=\"".$variables["paymentmethod"]."\", "; 322 322 $querystatement.="checkno=\"".$variables["checkno"]."\", "; … … 495 495 496 496 if(!isset($_POST["command"])){ 497 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 498 $tableresult=mysql_query($querystatement,$dblink); 499 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 500 $tablerecord=mysql_fetch_array($tableresult); 501 497 502 if(isset($_GET["id"])){ 503 //editing 504 if(!hasRights($tablerecord["editroleid"])) 505 goURL($_SESSION["app_path"]."noaccess.php"); 498 506 $therecord=getRecords((integer) $_GET["id"]); 499 //invoice specific 507 } else { 508 if(!hasRights($tablerecord["addroleid"])) 509 goURL($_SESSION["app_path"]."noaccess.php"); 510 $therecord=setRecordDefaults(); 500 511 } 501 else502 $therecord=setRecordDefaults();503 512 $createdby=getUserName($therecord["createdby"]); 504 513 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/bms/include/productcategories_addedit_include.php
r166 r170 136 136 //================================================================== 137 137 if(!isset($_POST["command"])){ 138 if(isset($_GET["id"])) 138 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 139 $tableresult=mysql_query($querystatement,$dblink); 140 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 141 $tablerecord=mysql_fetch_array($tableresult); 142 143 if(isset($_GET["id"])){ 144 //editing 145 if(!hasRights($tablerecord["editroleid"])) 146 goURL($_SESSION["app_path"]."noaccess.php"); 139 147 $therecord=getRecords((integer) $_GET["id"]); 140 else 148 } else { 149 if(!hasRights($tablerecord["addroleid"])) 150 goURL($_SESSION["app_path"]."noaccess.php"); 141 151 $therecord=setRecordDefaults(); 152 } 142 153 $createdby=getUserName($therecord["createdby"]); 143 154 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/bms/include/products_addedit_include.php
r166 r170 119 119 120 120 $querystatement="UPDATE products SET "; 121 if( $_SESSION["userinfo"]["accesslevel"]>=20){121 if(hasRights(20)){ 122 122 $querystatement.="partnumber=\"".$variables["partnumber"]."\", "; 123 123 $querystatement.="partname=\"".$variables["partname"]."\", "; … … 148 148 $querystatement.="packagesperitem=".$variables["packagesperitem"].", "; 149 149 150 if( $_SESSION["userinfo"]["accesslevel"]>=20){150 if(hasRights(20)){ 151 151 if(isset($variables["webenabled"])) $querystatement.="webenabled=1, "; else $querystatement.="webenabled=0, "; 152 152 … … 186 186 } 187 187 } 188 }//end access levelcheck188 }//end access check 189 189 190 190 //==== Almost all records should have this ========= … … 298 298 //================================================================== 299 299 if(!isset($_POST["command"])){ 300 if(isset($_GET["id"])) 300 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 301 $tableresult=mysql_query($querystatement,$dblink); 302 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 303 $tablerecord=mysql_fetch_array($tableresult); 304 305 if(isset($_GET["id"])){ 306 //editing 307 if(!hasRights($tablerecord["editroleid"])) 308 goURL($_SESSION["app_path"]."noaccess.php"); 301 309 $therecord=getRecords((integer) $_GET["id"]); 302 else 310 } else { 311 if(!hasRights($tablerecord["addroleid"])) 312 goURL($_SESSION["app_path"]."noaccess.php"); 303 313 $therecord=setRecordDefaults(); 314 } 304 315 $createdby=getUserName($therecord["createdby"]); 305 316 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/bms/include/products_functions.php
r145 r170 64 64 ); 65 65 66 if( $_SESSION["userinfo"]["accesslevel"]>=30){66 if(hasRights(30)){ 67 67 array_push($thetabs,array( 68 68 "name"=>"Sales History", -
trunk/phpbms/modules/bms/include/tax_addedit_include.php
r166 r170 131 131 //================================================================== 132 132 if(!isset($_POST["command"])){ 133 if(isset($_GET["id"])) 133 $querystatement="SELECT addroleid,editroleid FROM tabledefs WHERE id=".$tableid; 134 $tableresult=mysql_query($querystatement,$dblink); 135 if(!$tableresult) reportError(200,"Could Not retrieve Table Definition for id ".$tableid); 136 $tablerecord=mysql_fetch_array($tableresult); 137 138 if(isset($_GET["id"])){ 139 //editing 140 if(!hasRights($tablerecord["editroleid"])) 141 goURL($_SESSION["app_path"]."noaccess.php"); 134 142 $therecord=getRecords((integer) $_GET["id"]); 135 else 143 } else { 144 if(!hasRights($tablerecord["addroleid"])) 145 goURL($_SESSION["app_path"]."noaccess.php"); 136 146 $therecord=setRecordDefaults(); 147 } 137 148 $createdby=getUserName($therecord["createdby"]); 138 149 $modifiedby=getUserName($therecord["modifiedby"]); -
trunk/phpbms/modules/bms/install/choices.sql
r145 r170 1 INSERT INTO choices VALUES (1 28,'leadsource','Search Engine');2 INSERT INTO choices VALUES (1 27,'leadsource','Referral');3 INSERT INTO choices VALUES (10 6,'department','sales');4 INSERT INTO choices VALUES (1 26,'leadsource','Other');5 INSERT INTO choices VALUES (1 25,'leadsource','Internet');6 INSERT INTO choices VALUES (1 24,'leadsource','Friend');7 INSERT INTO choices VALUES (1 23,'leadsource','Book');8 INSERT INTO choices VALUES ( 210,'paymentmethod','Personal Check');9 INSERT INTO choices VALUES ( 209,'paymentmethod','Money Order');10 INSERT INTO choices VALUES ( 208,'paymentmethod','Master Card');11 INSERT INTO choices VALUES ( 207,'paymentmethod','Discover Card');12 INSERT INTO choices VALUES ( 206,'paymentmethod','Cashiers Check');13 INSERT INTO choices VALUES ( 211,'paymentmethod','VISA');14 INSERT INTO choices VALUES ( 212,'paymentmethod','VISA - Debit');15 INSERT INTO choices VALUES ( 213,'paymentmethod','Cash');16 INSERT INTO choices VALUES ( 204,'paymentmethod','');17 INSERT INTO choices VALUES (1 21,'shippingmethod','UPS Ground (Res)');18 INSERT INTO choices VALUES (1 22,'shippingmethod','UPS Next Day Air');19 INSERT INTO choices VALUES (1 20,'shippingmethod','UPS Ground (Com)');20 INSERT INTO choices VALUES (1 19,'shippingmethod','UPS 3 Day Select');21 INSERT INTO choices VALUES (1 17,'shippingmethod','FedEx Standard Overnight');22 INSERT INTO choices VALUES ( 205,'paymentmethod','American Express');23 INSERT INTO choices VALUES (1 18,'shippingmethod','UPS 2nd Day Air');24 INSERT INTO choices VALUES (1 16,'shippingmethod','FedEx Priority Overnight AM');25 INSERT INTO choices VALUES (1 15,'shippingmethod','');1 INSERT INTO choices VALUES (101,'leadsource','Search Engine'); 2 INSERT INTO choices VALUES (102,'leadsource','Referral'); 3 INSERT INTO choices VALUES (103,'department','sales'); 4 INSERT INTO choices VALUES (104,'leadsource','Other'); 5 INSERT INTO choices VALUES (105,'leadsource','Internet'); 6 INSERT INTO choices VALUES (106,'leadsource','Friend'); 7 INSERT INTO choices VALUES (107,'leadsource','Book'); 8 INSERT INTO choices VALUES (108,'paymentmethod','Personal Check'); 9 INSERT INTO choices VALUES (109,'paymentmethod','Money Order'); 10 INSERT INTO choices VALUES (110,'paymentmethod','Master Card'); 11 INSERT INTO choices VALUES (111,'paymentmethod','Discover Card'); 12 INSERT INTO choices VALUES (112,'paymentmethod','Cashiers Check'); 13 INSERT INTO choices VALUES (113,'paymentmethod','VISA'); 14 INSERT INTO choices VALUES (114,'paymentmethod','VISA - Debit'); 15 INSERT INTO choices VALUES (115,'paymentmethod','Cash'); 16 INSERT INTO choices VALUES (116,'paymentmethod',''); 17 INSERT INTO choices VALUES (117,'shippingmethod','UPS Ground (Res)'); 18 INSERT INTO choices VALUES (118,'shippingmethod','UPS Next Day Air'); 19 INSERT INTO choices VALUES (119,'shippingmethod','UPS Ground (Com)'); 20 INSERT INTO choices VALUES (120,'shippingmethod','UPS 3 Day Select'); 21 INSERT INTO choices VALUES (121,'shippingmethod','FedEx Standard Overnight'); 22 INSERT INTO choices VALUES (122,'paymentmethod','American Express'); 23 INSERT INTO choices VALUES (123,'shippingmethod','UPS 2nd Day Air'); 24 INSERT INTO choices VALUES (124,'shippingmethod','FedEx Priority Overnight AM'); 25 INSERT INTO choices VALUES (125,'shippingmethod',''); -
trunk/phpbms/modules/bms/install/menu.sql
r145 r170 1 INSERT INTO menu VALUES (1,'Clients/Prospects','search.php?id=2',2,10,2,2,'0000-00-00 00:00:00',20051012120056,10);2 INSERT INTO menu VALUES (2,'Client','',0,0,2,2,'0000-00-00 00:00:00',20051021174922,20);3 INSERT INTO menu VALUES (3,'Check for Duplicates','search.php?id=18',2,20,2,2,'0000-00-00 00:00:00',20051012120049,10);4 INSERT INTO menu VALUES (6,'Sales','',0,1,2,2,'2004-04-08 14:17:54',20051012120012,10);5 INSERT INTO menu VALUES (7,'Orders/Invoices','search.php?id=3',6,0,2,2,'2004-04-08 14:19:54',20051012120012,10);6 INSERT INTO menu VALUES (8,'Item Analysis','search.php?id=5',6,1,2,2,'2004-04-08 14:28:35',20051006194014,30);7 INSERT INTO menu VALUES (9,'Tax Areas','search.php?id=6',6,20,2,2,'2004-04-08 14:28:55',20051021175119,50);8 INSERT INTO menu VALUES (10,'Product','',0,2,2,2,'2004-04-08 14:29:20',20051012120012,10);9 INSERT INTO menu VALUES (11,'Products','search.php?id=4',10,0,2,2,'2004-04-08 14:29:46',20051012120012,10);10 INSERT INTO menu VALUES (12,'Product Categories','search.php?id=7',10,1,2,2,'2004-04-08 14:30:02',20051021175150,30);11 INSERT INTO menu VALUES (13,'Prerequisites','search.php?id=8',10,2,2,2,'2004-04-08 14:30:21',20051021175206,20);12 INSERT INTO menu VALUES (21,'Quick View','modules/bms/quickview.php',2,0,2,2,'2005-10-12 11:58:55',20051012204127,20);13 INSERT INTO menu VALUES (23,'Discounts/Promotions','search.php?id=25',6,10,2,2,'2005-10-20 17:42:55',20051021175020,30);1 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (200,'Client','',0,0,1,1,NOW(),NOW(),20); 2 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (201,'Quick View','modules/bms/quickview.php',200,0,1,1,NOW(),NOW(),20); 3 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (202,'Clients/Prospects','search.php?id=2',200,10,1,1,NOW(),NOW(),10); 4 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (203,'Check for Duplicates','search.php?id=18',200,20,1,1,NOW(),NOW(),10); 5 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (204,'Sales','',0,1,1,1,NOW(),NOW(),10); 6 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (205,'Orders/Invoices','search.php?id=3',204,0,1,1,NOW(),NOW(),10); 7 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (206,'Item Analysis','search.php?id=5',204,1,1,1,NOW(),NOW(),30); 8 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (207,'Discounts/Promotions','search.php?id=25',204,10,1,1,NOW(),NOW(),30); 9 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (208,'Tax Areas','search.php?id=6',204,20,1,1,NOW(),NOW(),50); 10 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (209,'Product','',0,2,1,1,NOW(),NOW(),10); 11 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (210,'Products','search.php?id=4',209,0,1,1,NOW(),NOW(),10); 12 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (211,'Product Categories','search.php?id=7',209,1,1,1,NOW(),NOW(),30); 13 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (212,'Prerequisites','search.php?id=8',209,2,1,1,NOW(),NOW(),20); -
trunk/phpbms/modules/bms/install/relationships.sql
r145 r170 1 INSERT INTO relationships VALUES (1,'id','sales managers','salesmanagerid',2,9,2,'2004-04-09 15:11:47',2,20040413103005,0);2 INSERT INTO relationships VALUES (4,'clientid','invoices','id',2,3,2,'2004-04-09 15:30:34',2,20040413103005,1);3 INSERT INTO relationships VALUES (5,'id','clients','clientid',3,2,2,'2004-04-10 13:20:37',2,20040413103005,0);4 INSERT INTO relationships VALUES (6,'id','tax areas','taxareaid',3,6,2,'2004-04-10 13:33:27',2,20040413103005,0);5 INSERT INTO relationships VALUES (7,'id','invoices','invoiceid',5,3,2,'2004-04-10 13:34:11',2,20040413103005,0);6 INSERT INTO relationships VALUES (8,'id','products','productid',5,4,2,'2004-04-10 13:34:53',2,20040413103005,0);7 INSERT INTO relationships VALUES (9,'id','parent products','parentid',8,4,2,'2004-04-10 13:36:24',2,20040413103005,0);8 INSERT INTO relationships VALUES (10,'id','child products','childid',8,4,2,'2004-04-10 13:36:50',2,20040413103005,0);9 INSERT INTO relationships VALUES (11,'categoryid','products','id',7,4,2,'2004-04-10 13:37:27',2,20040413103005,1);10 INSERT INTO relationships VALUES (12,'productid','invoice line items','id',4,5,2,'2004-04-10 13:37:58',2,20040413103005,1);11 INSERT INTO relationships VALUES (13,'parentid','prerequisites','id',4,8,2,'2004-04-10 13:39:16',2,20040413103005,1);12 INSERT INTO relationships VALUES (14,'taxareaid','invoices','id',6,3,2,'2004-04-10 13:39:43',2,20040413103005,0);13 INSERT INTO relationships VALUES (15,'salesmanagerid','sales manager for clients','id',9,2,2,'2004-04-10 13:40:31',2,20040413103005,0);14 INSERT INTO relationships VALUES (16,'createdby','created clients','id',9,2,2,'2004-04-10 13:41:06',2,20040413103005,0);15 INSERT INTO relationships VALUES (17,'modifiedby','modified clients','id',9,2,2,'2004-04-10 13:41:21',2,20040413103005,0);16 INSERT INTO relationships VALUES (18,'createdby','created invoices','id',9,3,2,'2004-04-10 13:41:34',2,20040413103005,0);17 INSERT INTO relationships VALUES (19,'modifiedby','modified invoices','id',9,3,2,'2004-04-10 13:41:52',2,20040413103005,0);18 INSERT INTO relationships VALUES (20,'invoiceid','line items','id',3,5,2,'2004-04-10 13:45:08',2,20050330111955,1);19 INSERT INTO relationships VALUES (21,'discountid','Invoices','id',25,3,2,'2005-10-21 19:22:00',2,20051021192200,0);20 INSERT INTO relationships VALUES (22,'id','Discounts','discountid',3,25,2,'2005-10-21 19:22:33',2,20051021192233,0);1 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (1,'id','sales managers','salesmanagerid',2,9,1,NOW(),1,NOW(),0); 2 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (4,'clientid','invoices','id',2,3,1,NOW(),1,NOW(),1); 3 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (5,'id','clients','clientid',3,2,1,NOW(),1,NOW(),0); 4 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (6,'id','tax areas','taxareaid',3,6,1,NOW(),1,NOW(),0); 5 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (7,'id','invoices','invoiceid',5,3,1,NOW(),1,NOW(),0); 6 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (8,'id','products','productid',5,4,1,NOW(),1,NOW(),0); 7 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (9,'id','parent products','parentid',8,4,1,NOW(),1,NOW(),0); 8 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (10,'id','child products','childid',8,4,1,NOW(),1,NOW(),0); 9 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (11,'categoryid','products','id',7,4,1,NOW(),1,NOW(),1); 10 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (12,'productid','invoice line items','id',4,5,1,NOW(),1,NOW(),1); 11 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (13,'parentid','prerequisites','id',4,8,1,NOW(),1,NOW(),1); 12 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (14,'taxareaid','invoices','id',6,3,1,NOW(),1,NOW(),0); 13 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (15,'salesmanagerid','sales manager for clients','id',9,2,1,NOW(),1,NOW(),0); 14 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (16,'createdby','created clients','id',9,2,1,NOW(),1,NOW(),0); 15 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (17,'modifiedby','modified clients','id',9,2,1,NOW(),1,NOW(),0); 16 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (18,'createdby','created invoices','id',9,3,1,NOW(),1,NOW(),0); 17 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (19,'modifiedby','modified invoices','id',9,3,1,NOW(),1,NOW(),0); 18 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (20,'invoiceid','line items','id',3,5,1,NOW(),1,NOW(),1); 19 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (21,'discountid','Invoices','id',25,3,1,NOW(),1,NOW(),0); 20 INSERT INTO `relationships` (`id`, `tofield`, `name`, `fromfield`, `fromtableid`, `totableid`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`, `inherint`) VALUES (22,'id','Discounts','discountid',3,25,1,NOW(),1,NOW(),0); -
trunk/phpbms/modules/bms/install/reports.sql
r145 r170 1 INSERT INTO reports VALUES ('This report will gerneate and display an invoice in PDF format (which can be printed or saved). The PDF file will contain one page per invoice.',6,'Invoice','modules/bms/report/invoices_pdfinvoice.php','PDF Report',2,'2003-01-29 09:26:05',2,20050330124703,3,100,0);2 INSERT INTO reports VALUES ('This report will gerneate and display a work order in PDF format (which can be printed or saved). The PDF file will contain one page per work order.',7,'Work Order','modules/bms/report/invoices_pdfworkorder.php','PDF Report',2,'2003-02-10 15:42:07',2,20051011112615,3,100,20);3 INSERT INTO reports VALUES ('This report will gerneate and display an invoice packing list in PDF format (which can be printed or saved). The PDF file will contain one page per invoice packing list.',8,'Packing List','modules/bms/report/invoices_pdfpackinglist.php','PDF Report',2,'2003-02-11 13:44:12',2,20050330124732,3,100,0);4 INSERT INTO reports VALUES ('Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',9,'Labels - Folder','modules/bms/report/clients_folderlabels.php','PDF Report',2,'2003-02-28 10:48:49',2,20050403144824,2,50,0);5 INSERT INTO reports VALUES ('Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',12,'Labels - Mailing','modules/bms/report/clients_mailinglabels.php','PDF Report',2,'2005-02-17 13:38:47',2,20050403144831,2,50,0);6 INSERT INTO reports VALUES ('Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',13,'Labels - Shipping','modules/bms/report/clients_shippinglabels.php','PDF Report',2,'2005-02-17 15:41:37',2,20050403141925,2,50,0);7 INSERT INTO reports VALUES ('Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',14,'Labels - Shipping','modules/bms/report/invoices_shippinglabels.php','PDF Report',2,'2005-02-18 10:54:55',2,20050403144840,3,60,0);8 INSERT INTO reports VALUES ('Creater your own custom invoice totaling report, specify groupings, totals, averages and whether to display summary, invoice, and invoice detail information.',15,'Totals - Custom','modules/bms/report/invoices_totals.php','report',2,'2005-02-25 10:51:11',2,20051006113147,3,50,30);9 INSERT INTO reports VALUES ('Basic totals report. Shows invoice total, subtotal and amount due fields and displaying indidivdual invoice information.',16,'Totals - Amt. w/ Invoices','modules/bms/report/invoices_totals_amtwinv.php','report',2,'2005-03-30 13:01:24',2,20051006113047,3,50,30);10 INSERT INTO reports VALUES ('Basic totals report. Shows invoice total, subtotal and amount due fields and displaying indidivdual invoice and line item information.',17,'Totals - Amt. w/ Invoices + Line Items','modules/bms/report/invoices_totals_amtwinvlineitems.php','report',2,'2005-03-30 13:02:30',2,20051006113059,3,50,30);11 INSERT INTO reports VALUES ('Totals report grouping by client account manager',18,'Totals - Grouped by Acct. Manager','modules/bms/report/invoices_totals_acctmngers.php','report',2,'2005-03-30 16:26:07',2,20051006113147,3,50,30);12 INSERT INTO reports VALUES ('Totals report including shipping ammount grouped by shipping method',20,'Totals - Grouped by Shipping Method','modules/bms/report/invoices_totals_shippingmethod.php','report',2,'2005-03-30 17:47:51',2,20051006113147,3,50,30);13 INSERT INTO reports VALUES ('Totals report grouped by payment method.',21,'Totals - Grouped by Payment Method','modules/bms/report/invoices_totals_payment.php','report',2,'2005-03-30 17:50:49',2,20051006113147,3,50,30);14 INSERT INTO reports VALUES ('Totals - Grouped by invoice lead source',22,'Totals - Grouped by Invoice Lead Source','modules/bms/report/invoices_totals_leadsource.php','report',2,'2005-03-30 17:53:41',2,20051006113147,3,50,30);15 INSERT INTO reports VALUES ('PDF report for quote. Does not include amount due.',23,'Quote','modules/bms/report/invoices_pdfquote.php','PDF Report',2,'2005-03-30 17:58:55',2,20051011112828,3,100,20);16 INSERT INTO reports VALUES ('Sales History for product including costs, average price and quantities.',24,'Sales History','modules/bms/report/products_saleshistory.php','report',2,'2005-03-31 10:28:04',2,20051006113218,4,100,30);17 INSERT INTO reports VALUES ('Client purchase history',25,'Purchase History','modules/bms/report/clients_purchasehistory.php','report',2,'2005-03-31 14:24:39',2,20050331142502,2,10,0);18 INSERT INTO reports VALUES ('Creater your own custom line item totaling report, specify groupings, totals, averages and whether to display summary, invoice, and invoice detail information.',26,'Totals - Custom','modules/bms/report/lineitems_totals.php','report',2,'2005-03-31 16:08:46',2,20051006113147,5,50,30);19 INSERT INTO reports VALUES ('Totals report grouped first by product category and then by product.',27,'Totals - Product Categories','modules/bms/report/lineitems_totals_productcategories.php','report',2,'2005-03-31 17:18:23',2,20051006113147,5,50,30);20 INSERT INTO reports VALUES ('Totals report grouped by product displaying line items',28,'Totals - Product','modules/bms/report/lineitems_totals_products.php','report',2,'2005-03-31 17:25:34',2,20051006113147,5,50,30);21 INSERT INTO reports VALUES ('Totals grouped by invoice lead source and product',29,'Totals - Lead Source','modules/bms/report/lineitems_totals_leadsource.php','report',2,'2005-03-31 17:31:29',2,20051006113147,5,50,30);22 INSERT INTO reports VALUES ('Print all notes associated with the client and any notes associated with client invoices.',30,'Client Notes Summary','modules/bms/report/clients_notesummary.php','PDF Report',2,'2005-04-03 13:07:00',2,20050405105038,2,10,0);1 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (200,'Invoice','PDF Report',3,100,0,'modules/bms/report/invoices_pdfinvoice.php','This report will gerneate and display an invoice in PDF format (which can be printed or saved). The PDF file will contain one page per invoice.',1,NOW(),1,NOW()); 2 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (201,'Work Order','PDF Report',3,100,20,'modules/bms/report/invoices_pdfworkorder.php','This report will gerneate and display a work order in PDF format (which can be printed or saved). The PDF file will contain one page per work order.',1,NOW(),1,NOW()); 3 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (202,'Packing List','PDF Report',3,100,0,'modules/bms/report/invoices_pdfpackinglist.php','This report will gerneate and display an invoice packing list in PDF format (which can be printed or saved). The PDF file will contain one page per invoice packing list.',1,NOW(),1,NOW()); 4 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (203,'Labels - Folder','PDF Report',2,50,0,'modules/bms/report/clients_folderlabels.php','Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',1,NOW(),1,NOW()); 5 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (204,'Labels - Mailing','PDF Report',2,50,0,'modules/bms/report/clients_mailinglabels.php','Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',1,NOW(),1,NOW()); 6 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (205,'Labels - Shipping','PDF Report',2,50,0,'modules/bms/report/clients_shippinglabels.php','Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',1,NOW(),1,NOW()); 7 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (206,'Labels - Shipping','PDF Report',3,60,0,'modules/bms/report/invoices_shippinglabels.php','Avery 5160 or compatible (3x10) Instructor Folder labels. \r\n\r\n **MAKE SURE when printing the pdf file, to TURN OFF the option \"shrink oversized pages to paper size\".**',1,NOW(),1,NOW()); 8 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (207,'Totals - Custom','report',3,50,30,'modules/bms/report/invoices_totals.php','Creater your own custom invoice totaling report, specify groupings, totals, averages and whether to display summary, invoice, and invoice detail information.',1,NOW(),1,NOW()); 9 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (208,'Totals - Amt. w/ Invoices','report',3,50,30,'modules/bms/report/invoices_totals_amtwinv.php','Basic totals report. Shows invoice total, subtotal and amount due fields and displaying indidivdual invoice information.',1,NOW(),1,NOW()); 10 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (209,'Totals - Amt. w/ Invoices + Line Items','report',3,50,30,'modules/bms/report/invoices_totals_amtwinvlineitems.php','Basic totals report. Shows invoice total, subtotal and amount due fields and displaying indidivdual invoice and line item information.',1,NOW(),1,NOW()); 11 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (210,'Totals - Grouped by Acct. Manager','report',3,50,30,'modules/bms/report/invoices_totals_acctmngers.php','Totals report grouping by client account manager',1,NOW(),1,NOW()); 12 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (211,'Totals - Grouped by Shipping Method','report',3,50,30,'modules/bms/report/invoices_totals_shippingmethod.php','Totals report including shipping ammount grouped by shipping method',1,NOW(),1,NOW()); 13 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (212,'Totals - Grouped by Payment Method','report',3,50,30,'modules/bms/report/invoices_totals_payment.php','Totals report grouped by payment method.',1,NOW(),1,NOW()); 14 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (213,'Totals - Grouped by Invoice Lead Source','report',3,50,30,'modules/bms/report/invoices_totals_leadsource.php','Totals - Grouped by invoice lead source',1,NOW(),1,NOW()); 15 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (214,'Quote','PDF Report',3,100,20,'modules/bms/report/invoices_pdfquote.php','PDF report for quote. Does not include amount due.',1,NOW(),1,NOW()); 16 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (215,'Sales History','report',4,100,30,'modules/bms/report/products_saleshistory.php','Sales History for product including costs, average price and quantities.',1,NOW(),1,NOW()); 17 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (216,'Purchase History','report',2,10,0,'modules/bms/report/clients_purchasehistory.php','Client purchase history',1,NOW(),1,NOW()); 18 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (217,'Totals - Custom','report',5,50,30,'modules/bms/report/lineitems_totals.php','Creater your own custom line item totaling report, specify groupings, totals, averages and whether to display summary, invoice, and invoice detail information.',1,NOW(),1,NOW()); 19 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (218,'Totals - Product Categories','report',5,50,30,'modules/bms/report/lineitems_totals_productcategories.php','Totals report grouped first by product category and then by product.',1,NOW(),1,NOW()); 20 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (219,'Totals - Product','report',5,50,30,'modules/bms/report/lineitems_totals_products.php','Totals report grouped by product displaying line items',1,NOW(),1,NOW()); 21 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (220,'Totals - Lead Source','report',5,50,30,'modules/bms/report/lineitems_totals_leadsource.php','Totals grouped by invoice lead source and product',1,NOW(),1,NOW()); 22 INSERT INTO `reports` (`id`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (221,'Client Notes Summary','PDF Report',2,10,0,'modules/bms/report/clients_notesummary.php','Print all notes associated with the client and any notes associated with client invoices.',1,NOW(),1,NOW()); -
trunk/phpbms/modules/bms/install/tablecolumns.sql
r146 r170 1 INSERT INTO tablecolumnsVALUES (1,2,'id','clients.id','center','',0,'',0,'',NULL);2 INSERT INTO tablecolumns VALUES (2,2,'type','if(clients.type=\"prospect\",\"<span style=\'color:red;\'>P</span>\",\"<b>C</b>\")','center','',1,'',0,'','noencoding');3 INSERT INTO tablecolumnsVALUES (12,2,'name / company','if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company)','left','',2,'',0,'100%',NULL);4 INSERT INTO tablecolumnsVALUES (16,2,'city','clients.city','left','',4,'',0,'',NULL);5 INSERT INTO tablecolumnsVALUES (17,2,'state','clients.state','left','',5,'',0,'',NULL);6 INSERT INTO tablecolumnsVALUES (18,2,'zip','clients.postalcode','left','',6,'',0,'',NULL);7 INSERT INTO tablecolumnsVALUES (44,3,'id','invoices.id','left','',0,'',0,'',NULL);8 INSERT INTO tablecolumnsVALUES (45,3,'type','invoices.type','left','',1,'',0,'',NULL);9 INSERT INTO tablecolumnsVALUES (134,3,'status','invoices.status','left','',2,'',0,'',NULL);10 INSERT INTO tablecolumnsVALUES (46,3,'date','if(invoices.type=\"Invoice\",invoices.invoicedate,invoices.orderdate)','left','',4,'',0,'','date');11 INSERT INTO tablecolumns VALUES (47,3,'client name / company','concat(\"<strong>\",if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company),\"</strong>\")','left','',5,'concat(clients.lastname,clients.firstname,clients.company)',0,'100%','noencoding');12 INSERT INTO tablecolumnsVALUES (139,5,'id','lineitems.id','left','',0,'',0,'',NULL);13 INSERT INTO tablecolumnsVALUES (48,3,'total','if(invoices.type!=\"VOID\",invoices.totalti,\"-----\")','right','sum(if(invoices.type!=\"VOID\",invoices.totalti,0))',6,'if(invoices.type!=\"VOID\",invoices.totalti,0)',0,'','currency');14 INSERT INTO tablecolumnsVALUES (49,3,'due','if(invoices.type!=\"VOID\",invoices.totalti-invoices.amountpaid,\"-----\")','right','sum(if(invoices.type!=\"VOID\",(invoices.totalti-invoices.amountpaid),0))',7,'if(invoices.type!=\"VOID\",invoices.totalti-invoices.amountpaid,0)',0,'','currency');15 INSERT INTO tablecolumnsVALUES (51,5,'invoice id','lineitems.invoiceid','left','',1,'',0,'',NULL);16 INSERT INTO tablecolumnsVALUES (52,5,'part #','products.partnumber','left','',4,'',0,'',NULL);17 INSERT INTO tablecolumnsVALUES (53,5,'name','products.partname','left','',5,'',1,'100%',NULL);18 INSERT INTO tablecolumnsVALUES (54,5,'unit price','concat(\"$\",format(lineitems.unitprice,2))','right','concat(\"$\",format(sum(lineitems.unitprice),2))',6,'lineitems.unitprice',0,'',NULL);19 INSERT INTO tablecolumnsVALUES (55,5,'qty','format(lineitems.quantity,2)','center','format(sum(lineitems.quantity),2)',7,'lineitemd.quantity',0,'',NULL);20 INSERT INTO tablecolumnsVALUES (56,5,'price ext.','lineitems.unitprice*lineitems.quantity','right','sum(lineitems.unitprice*lineitems.quantity)',8,'',0,'','currency');21 INSERT INTO tablecolumnsVALUES (57,5,'cost ext.','lineitems.unitcost*lineitems.quantity','right','sum(lineitems.unitcost*lineitems.quantity)',9,'',0,'','currency');22 INSERT INTO tablecolumnsVALUES (58,5,'total wt.','format((lineitems.unitweight*lineitems.quantity),2)','right','format(sum(lineitems.unitweight*lineitems.quantity),2)',11,'lineitems.unitweight*lineitems.quantity',0,'',NULL);23 INSERT INTO tablecolumnsVALUES (59,6,'id','tax.id','center','',0,'',0,'',NULL);24 INSERT INTO tablecolumns VALUES (60,6,'name','concat(\"<strong>\",tax.name,\"</strong>\")','left','',1,'tax.name',0,'','noencoding');25 INSERT INTO tablecolumnsVALUES (61,6,'percentage','concat(tax.percentage,\"%\")','left','',2,'tax.percentage',0,'98%',NULL);26 INSERT INTO tablecolumnsVALUES (62,4,'id','products.id','center','',0,'',0,'',NULL);27 INSERT INTO tablecolumnsVALUES (63,4,'part number','products.partnumber','left','',1,'',0,'',NULL);28 INSERT INTO tablecolumnsVALUES (64,4,'name','products.partname','left','',2,'',1,'100%',NULL);29 INSERT INTO tablecolumnsVALUES (65,4,'category','productcategories.name','right','',3,'',0,'',NULL);30 INSERT INTO tablecolumnsVALUES (66,4,'status','products.status','center','',5,'',0,'',NULL);31 INSERT INTO tablecolumnsVALUES (67,4,'unit price','products.unitprice','right','',6,'',0,'','currency');32 INSERT INTO tablecolumnsVALUES (68,7,'id','productcategories.id','center','',0,'',0,'',NULL);33 INSERT INTO tablecolumnsVALUES (69,7,'name','productcategories.name','left','',1,'',0,'100%',NULL);34 INSERT INTO tablecolumnsVALUES (70,7,'date created','productcategories.creationdate','left','',2,'productcategories.creationdate',0,'','datetime');35 INSERT INTO tablecolumnsVALUES (71,8,'id','prerequisites.id','center','',0,'',0,'',NULL);36 INSERT INTO tablecolumnsVALUES (72,8,'part number','products.partnumber','left','',1,'',0,'',NULL);37 INSERT INTO tablecolumnsVALUES (73,8,'name','products.partname','left','',2,'',1,'50%',NULL);38 INSERT INTO tablecolumnsVALUES (74,8,'dependent part num.','childproducts.partnumber','left','',3,'',0,'50%',NULL);39 INSERT INTO tablecolumnsVALUES (75,18,'id','clients.id','center','',0,'',0,'',NULL);40 INSERT INTO tablecolumns VALUES (76,18,'type','if(clients.type=\"prospect\",\"<span style=\'color:red;\'>P</span>\",\"<b>C</b>\")','left','',1,'clients.type',0,'','noencoding');41 INSERT INTO tablecolumnsVALUES (77,18,'company / name','if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company)','left','',2,'',1,'100%',NULL);42 INSERT INTO tablecolumnsVALUES (79,18,'city','clients.city','left','',3,'',0,'',NULL);43 INSERT INTO tablecolumnsVALUES (80,18,'state','clients.state','center','',4,'',0,'',NULL);44 INSERT INTO tablecolumnsVALUES (81,18,'postal code','clients.postalcode','left','',5,'',0,'',NULL);45 INSERT INTO tablecolumnsVALUES (102,2,'e-mail','clients.email','left','',3,'',0,'',NULL);46 INSERT INTO tablecolumnsVALUES (103,22,'name','clientemailprojects.name','left','',2,'',0,'100%',NULL);47 INSERT INTO tablecolumns VALUES (104,22,'user','if(clientemailprojects.userid=0,\"<b>global</b>\",concat(users.lastname,\", \",users.firstname))','left','',1,'',0,'','noencoding');48 INSERT INTO tablecolumnsVALUES (105,22,'last run','clientemailprojects.lastrun','right','',3,'',0,'','datetime');49 INSERT INTO tablecolumnsVALUES (106,22,'id','clientemailprojects.id','left','',0,'',0,'',NULL);50 INSERT INTO tablecolumnsVALUES (136,25,'id','discounts.id','left','',0,'',0,'',NULL);51 INSERT INTO tablecolumnsVALUES (135,3,'web','invoices.weborder','center','',3,'',0,'','boolean');52 INSERT INTO tablecolumnsVALUES (108,5,'type','invoices.type','left','',2,'',0,'',NULL);53 INSERT INTO tablecolumnsVALUES (109,5,'date','if(invoices.type=\"Invoice\",invoices.invoicedate,invoices.orderdate)\r\n','left','',3,'',1,'','date');54 INSERT INTO tablecolumnsVALUES (132,4,'type','products.type','center','',4,'',0,'',NULL);55 INSERT INTO tablecolumnsVALUES (133,5,'tax','lineitems.taxable','center','',10,'',0,'','boolean');56 INSERT INTO tablecolumnsVALUES (137,25,'type','discounts.type','left','',1,'',0,'',NULL);57 INSERT INTO tablecolumnsVALUES (138,25,'name','discounts.name','left','',2,'',0,'100%',NULL);1 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (1,2,'id','clients.id','center','',0,'',0,'',NULL); 2 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (2,2,'type','if(clients.type=\"prospect\",\"<span style=\'color:red;\'>P</span>\",\"<b>C</b>\")','center','',1,NULL,0,'','noencoding'); 3 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (12,2,'name / company','if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company)','left','',2,'',0,'100%',NULL); 4 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (16,2,'city','clients.city','left','',4,'',0,'',NULL); 5 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (17,2,'state','clients.state','left','',5,'',0,'',NULL); 6 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (18,2,'zip','clients.postalcode','left','',6,'',0,'',NULL); 7 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (44,3,'id','invoices.id','left','',0,'',0,'',NULL); 8 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (45,3,'type','invoices.type','left','',1,'',0,'',NULL); 9 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (134,3,'status','invoices.status','left','',2,'',0,'',NULL); 10 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (46,3,'date','if(invoices.type=\"Invoice\",invoices.invoicedate,invoices.orderdate)','left','',4,'',0,'','date'); 11 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (47,3,'client name / company','concat(\"<strong>\",if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company),\"</strong>\")','left','',5,NULL,0,'100%','noencoding'); 12 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (139,5,'id','lineitems.id','left','',0,'',0,'',NULL); 13 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (48,3,'total','if(invoices.type!=\"VOID\",invoices.totalti,\"-----\")','right','sum(if(invoices.type!=\"VOID\",invoices.totalti,0))',6,'if(invoices.type!=\"VOID\",invoices.totalti,0)',0,'','currency'); 14 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (49,3,'due','if(invoices.type!=\"VOID\",invoices.totalti-invoices.amountpaid,\"-----\")','right','sum(if(invoices.type!=\"VOID\",(invoices.totalti-invoices.amountpaid),0))',7,'if(invoices.type!=\"VOID\",invoices.totalti-invoices.amountpaid,0)',0,'','currency'); 15 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (51,5,'invoice id','lineitems.invoiceid','left','',1,'',0,'',NULL); 16 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (52,5,'part #','products.partnumber','left','',4,'',0,'',NULL); 17 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (53,5,'name','products.partname','left','',5,'',1,'100%',NULL); 18 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (54,5,'unit price','concat(\"$\",format(lineitems.unitprice,2))','right','concat(\"$\",format(sum(lineitems.unitprice),2))',6,'lineitems.unitprice',0,'',NULL); 19 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (55,5,'qty','format(lineitems.quantity,2)','center','format(sum(lineitems.quantity),2)',7,'lineitemd.quantity',0,'',NULL); 20 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (56,5,'price ext.','lineitems.unitprice*lineitems.quantity','right','sum(lineitems.unitprice*lineitems.quantity)',8,'',0,'','currency'); 21 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (57,5,'cost ext.','lineitems.unitcost*lineitems.quantity','right','sum(lineitems.unitcost*lineitems.quantity)',9,'',0,'','currency'); 22 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (58,5,'total wt.','format((lineitems.unitweight*lineitems.quantity),2)','right','format(sum(lineitems.unitweight*lineitems.quantity),2)',11,'lineitems.unitweight*lineitems.quantity',0,'',NULL); 23 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (59,6,'id','tax.id','center','',0,'',0,'',NULL); 24 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (60,6,'name','concat(\"<strong>\",tax.name,\"</strong>\")','left','',1,NULL,0,'','noencoding'); 25 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (61,6,'percentage','concat(tax.percentage,\"%\")','left','',2,'tax.percentage',0,'98%',NULL); 26 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (62,4,'id','products.id','center','',0,'',0,'',NULL); 27 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (63,4,'part number','products.partnumber','left','',1,'',0,'',NULL); 28 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (64,4,'name','products.partname','left','',2,'',1,'100%',NULL); 29 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (65,4,'category','productcategories.name','right','',3,'',0,'',NULL); 30 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (66,4,'status','products.status','center','',5,'',0,'',NULL); 31 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (67,4,'unit price','products.unitprice','right','',6,'',0,'','currency'); 32 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (68,7,'id','productcategories.id','center','',0,'',0,'',NULL); 33 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (69,7,'name','productcategories.name','left','',1,'',0,'100%',NULL); 34 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (70,7,'date created','productcategories.creationdate','left','',2,'productcategories.creationdate',0,'','datetime'); 35 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (71,8,'id','prerequisites.id','center','',0,'',0,'',NULL); 36 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (72,8,'part number','products.partnumber','left','',1,'',0,'',NULL); 37 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (73,8,'name','products.partname','left','',2,'',1,'50%',NULL); 38 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (74,8,'dependent part num.','childproducts.partnumber','left','',3,'',0,'50%',NULL); 39 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (75,18,'id','clients.id','center','',0,'',0,'',NULL); 40 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (76,18,'type','if(clients.type=\"prospect\",\"<span style=\'color:red;\'>P</span>\",\"<b>C</b>\")','left','',1,NULL,0,'','noencoding'); 41 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (77,18,'company / name','if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company)','left','',2,'',1,'100%',NULL); 42 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (79,18,'city','clients.city','left','',3,'',0,'',NULL); 43 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (80,18,'state','clients.state','center','',4,'',0,'',NULL); 44 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (81,18,'postal code','clients.postalcode','left','',5,'',0,'',NULL); 45 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (102,2,'e-mail','clients.email','left','',3,'',0,'',NULL); 46 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (103,22,'name','clientemailprojects.name','left','',2,'',0,'100%',NULL); 47 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (104,22,'user','if(clientemailprojects.userid=0,\"<b>global</b>\",concat(users.lastname,\", \",users.firstname))','left','',1,NULL,0,'','noencoding'); 48 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (105,22,'last run','clientemailprojects.lastrun','right','',3,'',0,'','datetime'); 49 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (106,22,'id','clientemailprojects.id','left','',0,'',0,'',NULL); 50 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (136,25,'id','discounts.id','left','',0,'',0,'',NULL); 51 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (135,3,'web','invoices.weborder','center','',3,'',0,'','boolean'); 52 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (108,5,'type','invoices.type','left','',2,'',0,'',NULL); 53 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (109,5,'date','if(invoices.type=\"Invoice\",invoices.invoicedate,invoices.orderdate)\r\n','left','',3,'',1,'','date'); 54 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (132,4,'type','products.type','center','',4,'',0,'',NULL); 55 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (133,5,'tax','lineitems.taxable','center','',10,'',0,'','boolean'); 56 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (137,25,'type','discounts.type','left','',1,'',0,'',NULL); 57 INSERT INTO `tablecolumns` (`id`, `tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (138,25,'name','discounts.name','left','',2,'',0,'100%',NULL); -
trunk/phpbms/modules/bms/install/tabledefs.sql
r145 r170 1 INSERT INTO tabledefs VALUES ('modules/bms/clientemailprojects_edit.php','Client E-mail Projects',22,'clientemailprojects',2,'2005-03-15 13:17:07',2,20050317140938,'clientemailprojects left join users on clientemailprojects.userid=users.id','NA','delete','clientemailprojects.id !=-1','clientemailprojects.name','search','','','system',2);2 INSERT INTO tabledefs VALUES ('modules/bms/clients_addedit.php','Clients/Prospects',2,'clients',2,'2003-02-06 15:43:06',2,20050318154822,'clients','modules/bms/clients_addedit.php','inactivate','clients.id=-100','concat(clients.lastname,\", \",clients.firstname)','','','','table',2);3 INSERT INTO tabledefs VALUES ('modules/bms/invoices_addedit.php','Quotes/Orders/Invoices',3,'invoices',2,'2003-02-06 15:45:40',2,20051122181349,'(invoices inner join clients on invoices.clientid=clients.id)','modules/bms/invoices_addedit.php','void','invoices.type+0<3','invoices.id','','','','table',2);4 INSERT INTO tabledefs VALUES ('modules/bms/products_addedit.php','Products',4,'products',2,'2003-02-06 15:46:10',2,20051019132051,'(products inner join productcategories on products.categoryid=productcategories.id)','modules/bms/products_addedit.php','inactivate','products.id =-100','products.partnumber','','','','table',2);5 INSERT INTO tabledefs VALUES ('N/A','Line Items',5,'lineitems',2,'2004-03-04 14:47:49',2,20051021173049,'((lineitems left join products on lineitems.productid=products.id) inner join invoices on lineitems.invoiceid=invoices.id)','N/A','NA','lineitems.id =-1','lineitems.invoiceid,lineitems.id','','','','table',2);6 INSERT INTO tabledefs VALUES ('modules/bms/tax_addedit.php','Tax Areas',6,'tax',2,'2004-03-04 14:48:44',2,20040413102940,'tax','modules/bms/tax_addedit.php','delete','tax.id !=0','tax.name','','','','table',2);7 INSERT INTO tabledefs VALUES ('modules/bms/productcategories_addedit.php','Product Categories',7,'productcategories',2,'2004-03-04 14:49:32',2,20040413102940,'productcategories','modules/bms/productcategories_addedit.php','delete','productcategories.id !=0','productcategories.name','','','','table',2);8 INSERT INTO tabledefs VALUES ('N/A','Prerequisites',8,'prerequisites',2,'2004-03-04 14:50:09',2,20040413102940,'(prerequisites left join products on prerequisites.parentid=products.id) left join products as childproducts on prerequisites.childid=childproducts.id','N/A','NA','prerequisites.id =-1','products.id','','','','table',2);9 INSERT INTO tabledefs VALUES ('N/A','Client/Prospect Duplicates',18,'clients',2,'2004-04-07 13:19:42',2,20040413102940,'(clients, clients dupclients)','N/A','NA','clients.id = -100','concat(clients.lastname,\", \",clients.firstname)','','','','view',2);10 INSERT INTO tabledefs VALUES ('modules/bms/discounts_addedit.php','Dicounts/Promotions',25,'discounts',2,'2005-10-20 12:42:29',2,20051020175114,'discounts','modules/bms/discounts_addedit.php','inactivate','discounts.id!=0','discounts.id','search','all records','name','table',2);1 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (22,'Client E-mail Projects','system',2,'clientemailprojects','clientemailprojects left join users on clientemailprojects.userid=users.id','modules/bms/clientemailprojects_edit.php',0,'NA',0,0,-100,-100,'delete','clientemailprojects.id !=-1','clientemailprojects.name','search','','',1,NOW(),1,NOW()); 2 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (2,'Clients/Prospects','table',2,'clients','clients','modules/bms/clients_addedit.php',0,'modules/bms/clients_addedit.php',0,0,-100,-100,'inactivate','clients.id=-100','concat(clients.lastname,\", \",clients.firstname)','','','',1,NOW(),1,NOW()); 3 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (3,'Quotes/Orders/Invoices','table',2,'invoices','(invoices inner join clients on invoices.clientid=clients.id)','modules/bms/invoices_addedit.php',0,'modules/bms/invoices_addedit.php',0,0,-100,-100,'void','invoices.type+0<3','invoices.id','','','',1,NOW(),1,NOW()); 4 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (4,'Products','table',2,'products','(products inner join productcategories on products.categoryid=productcategories.id)','modules/bms/products_addedit.php',0,'modules/bms/products_addedit.php',0,0,-100,-100,'inactivate','products.id =-100','products.partnumber','','','',1,NOW(),1,NOW()); 5 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (5,'Line Items','table',2,'lineitems','((lineitems left join products on lineitems.productid=products.id) inner join invoices on lineitems.invoiceid=invoices.id)','N/A',0,'N/A',0,0,-100,-100,'NA','lineitems.id =-1','lineitems.invoiceid,lineitems.id','','','',1,NOW(),1,NOW()); 6 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (6,'Tax Areas','table',2,'tax','tax','modules/bms/tax_addedit.php',0,'modules/bms/tax_addedit.php',0,0,-100,-100,'delete','tax.id !=0','tax.name','','','',1,NOW(),1,NOW()); 7 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (7,'Product Categories','table',2,'productcategories','productcategories','modules/bms/productcategories_addedit.php',0,'modules/bms/productcategories_addedit.php',0,0,-100,-100,'delete','productcategories.id !=0','productcategories.name','','','',1,NOW(),1,NOW()); 8 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (8,'Prerequisites','table',2,'prerequisites','(prerequisites left join products on prerequisites.parentid=products.id) left join products as childproducts on prerequisites.childid=childproducts.id','N/A',0,'N/A',0,0,-100,-100,'NA','prerequisites.id =-1','products.id','','','',1,NOW(),1,NOW()); 9 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (18,'Client/Prospect Duplicates','view',2,'clients','(clients, clients dupclients)','N/A',0,'N/A',0,0,-100,-100,'NA','clients.id = -100','concat(clients.lastname,\", \",clients.firstname)','','','',2,'2004-04-07 13:19:42',1,NOW(),1,NOW()); 10 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (25,'Dicounts/Promotions','table',2,'discounts','discounts','modules/bms/discounts_addedit.php',0,'modules/bms/discounts_addedit.php',0,0,-100,-100,'inactivate','discounts.id!=0','discounts.id','search','all records','name',2,'2005-10-20 12:42:29',1,NOW(),1,NOW()); -
trunk/phpbms/modules/bms/install/tablefindoptions.sql
r145 r170 1 INSERT INTO tablefindoptionsVALUES (1,2,'Prospects','clients.type = \"prospect\" and clients.inactive=0',1,0);2 INSERT INTO tablefindoptionsVALUES (7,2,'Today\'s Prospects','clients.type = \"prospect\" and (TO_DAYS(now())-TO_DAYS(clients.creationdate))=0 and clients.inactive=0',3,0);3 INSERT INTO tablefindoptionsVALUES (8,2,'Yesterday\'s Prospects','clients.type = \"prospect\" and (TO_DAYS(now())-TO_DAYS(clients.creationdate)=1 and clients.inactive=0',4,0);4 INSERT INTO tablefindoptionsVALUES (9,2,'Last Week\'s Prospects','clients.type = \"prospect\" and (TO_DAYS(now())-TO_DAYS(clients.creationdate))<7 and clients.inactive=0',5,0);5 INSERT INTO tablefindoptionsVALUES (10,2,'Clients','clients.type = \"client\" and clients.inactive=0',0,0);6 INSERT INTO tablefindoptionsVALUES (11,2,'Inactive Clients','clients.type = \"client\" and clients.inactive=1',6,0);7 INSERT INTO tablefindoptionsVALUES (12,2,'All Records','clients.id != 0',7,0);8 INSERT INTO tablefindoptionsVALUES (102,3,'Invoices - This Quarter','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(CURDATE()) and QUARTER(invoices.invoicedate)=QUARTER(CURDATE())',15,30);9 INSERT INTO tablefindoptionsVALUES (103,3,'Invoices - This Year','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(CURDATE())',17,30);10 INSERT INTO tablefindoptionsVALUES (104,3,'Invoices - Last Quarter','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(DATE_SUB(CURDATE(),INTERVAL 3 MONTH)) and QUARTER(invoices.invoicedate)=QUARTER(DATE_SUB(CURDATE(),INTERVAL 3 MONTH))',16,30);11 INSERT INTO tablefindoptions VALUES (106,3,'Orders - Committed','invoices.type=\"Order\" and invoices.status=\"Committed\"',3,-10);12 INSERT INTO tablefindoptions VALUES (107,3,'Orders - Open','invoices.type=\"Order\" and invoices.status=\"Open\"',2,-10);13 INSERT INTO tablefindoptionsVALUES (49,3,'Invoices - Today','invoices.type=\"Invoice\" and invoices.invoicedate=curdate()',9,20);14 INSERT INTO tablefindoptionsVALUES (50,3,'Invoices - Yesterday','invoices.type=\"Invoice\" and invoices.invoicedate=date_sub(curdate(),INTERVAL 1 DAY)',10,20);15 INSERT INTO tablefindoptionsVALUES (45,3,'Invoices - This Month','invoices.type=\"Invoice\" and year(invoicedate)=year(curdate()) and month(invoicedate)=month(curdate())',13,30);16 INSERT INTO tablefindoptions VALUES (22,3,'Orders','invoices.type=\"Order\"',1,-10);17 INSERT INTO tablefindoptions VALUES (23,3,'Orders - Packed','invoices.type=\"Order\" and invoices.status=\"Packed\"',4,-10);18 INSERT INTO tablefindoptions VALUES (24,3,'Orders - Shipped','invoices.type=\"Order\" and invoices.status=\"Shipped\"',5,-10);19 INSERT INTO tablefindoptionsVALUES (25,3,'Invoices','invoices.type=\"Invoice\"',8,30);20 INSERT INTO tablefindoptionsVALUES (26,3,'Quotes','invoices.type=\"Quote\"',7,20);21 INSERT INTO tablefindoptions VALUES (27,3,'Voided Records','invoices.type=\"VOID\"',18,-10);22 INSERT INTO tablefindoptionsVALUES (28,3,'All Records','invoices.id != 0',19,30);23 INSERT INTO tablefindoptionsVALUES (46,3,'Invoices - Last Month','invoices.type=\"Invoice\" and year(invoicedate)=year(date_sub(curdate(),INTERVAL 1 MONTH)) and month(invoicedate)=month(date_sub(curdate(),INTERVAL 1 MONTH))',14,30);24 INSERT INTO tablefindoptionsVALUES (51,3,'Invoices - This Week','invoices.type=\"Invoice\" and year(invoicedate)=year(curdate()) and week(invoicedate)=week(curdate())',11,30);25 INSERT INTO tablefindoptionsVALUES (52,3,'Invoices - Last Week','invoices.type=\"Invoice\" and year(invoicedate)=year(date_sub(curdate(),INTERVAL 7 DAY)) and week(invoicedate)=week(date_sub(curdate(),INTERVAL 7 DAY))',12,30);26 INSERT INTO tablefindoptions VALUES (53,3,'Orders - Today','invoices.type=\"Order\" and invoices.orderdate=curdate()',6,-10);27 INSERT INTO tablefindoptionsVALUES (31,4,'In Stock Items','products.status=\"In Stock\"',1,0);28 INSERT INTO tablefindoptionsVALUES (32,4,'Out of Stock Items','products.status=\"Out of Stock\"',2,0);29 INSERT INTO tablefindoptionsVALUES (33,4,'Backordered Items','products.status=\"Backordered\"',3,0);30 INSERT INTO tablefindoptions VALUES (34,4,'Inactive','products.inactive=1',4,-10);31 INSERT INTO tablefindoptionsVALUES (35,4,'All Records','products.id != 0',5,0);32 INSERT INTO tablefindoptionsVALUES (29,5,'All Records','lineitems.id!=0',0,30);33 INSERT INTO tablefindoptionsVALUES (54,5,'Orders','invoices.type=\"Order\"',1,0);34 INSERT INTO tablefindoptionsVALUES (55,5,'Quotes','invoices.type=\"Quote\"',8,0);35 INSERT INTO tablefindoptionsVALUES (56,5,'Invoices','invoices.type=\"Invoice\"',9,30);36 INSERT INTO tablefindoptionsVALUES (57,5,'Orders - Today','invoices.type=\"Order\" and invoices.orderdate=curdate()',2,0);37 INSERT INTO tablefindoptionsVALUES (58,5,'Invoices - Yesterday','invoices.type=\"Invoice\" and invoices.invoicedate=date_sub(curdate(),INTERVAL 1 DAY)',11,0);38 INSERT INTO tablefindoptionsVALUES (59,5,'Orders - Yesterday','invoices.type=\"Orders\" and invoices.orderdate=date_sub(curdate(),INTERVAL 1 DAY)',3,0);39 INSERT INTO tablefindoptionsVALUES (60,5,'Orders - Last Week','invoices.type=\"Order\" and year(invoices.orderdate)=year(date_sub(curdate(),INTERVAL 7 DAY)) and week(invoices.orderdate)=week(date_sub(curdate(),INTERVAL 7 DAY))',5,0);40 INSERT INTO tablefindoptionsVALUES (61,5,'Orders - This Week','invoices.type=\"Order\" and year(invoices.orderdate)=year(curdate()) and week(invoices.orderdate)=week(curdate())',4,0);41 INSERT INTO tablefindoptionsVALUES (62,5,'Orders - This Month','invoices.type=\"Order\" and year(invoices.orderdate)=year(curdate()) and month(invoices.orderdate)=month(curdate())',6,0);42 INSERT INTO tablefindoptionsVALUES (63,5,'Orders - Last Month','invoices.type=\"Order\" and year(invoices.orderdate)=year(date_sub(curdate(),INTERVAL 1 MONTH)) and month(invoices.orderdate)=month(date_sub(curdate(),INTERVAL 1 MONTH))',7,0);43 INSERT INTO tablefindoptionsVALUES (64,5,'Invoices - Today','invoices.type=\"Invoice\" and invoices.invoicedate=curdate()',10,0);44 INSERT INTO tablefindoptionsVALUES (65,5,'Invoices - This Week','invoices.type=\"Order\" and year(invoices.orderdate)=year(curdate()) and week(invoices.orderdate)=week(curdate())',12,30);45 INSERT INTO tablefindoptionsVALUES (66,5,'Invoices - Last Week','invoices.type=\"Invoice\" and year(invoices.invoicedate)=year(date_sub(curdate(),INTERVAL 7 DAY)) and week(invoices.invoicedate)=week(date_sub(curdate(),INTERVAL 7 DAY))',13,30);46 INSERT INTO tablefindoptionsVALUES (67,5,'Invoices - This Month','invoices.type=\"Invoice\" and year(invoices.invoicedate)=year(curdate()) and month(invoices.invoicedate)=month(curdate())',14,30);47 INSERT INTO tablefindoptionsVALUES (68,5,'Invoices - Last Month','invoices.type=\"Invoice\" and year(invoicedate)=year(date_sub(curdate(),INTERVAL 1 MONTH)) and month(invoicedate)=month(date_sub(curdate(),INTERVAL 1 MONTH))',15,30);48 INSERT INTO tablefindoptionsVALUES (30,6,'All Records','tax.id != 0',1,0);49 INSERT INTO tablefindoptionsVALUES (36,7,'All Records','productcategories.id != 0',1,0);50 INSERT INTO tablefindoptionsVALUES (37,8,'All Records','prerequisites.id != 0',1,0);51 INSERT INTO tablefindoptionsVALUES (38,18,'matching names','clients.firstname=dupclients.firstname and clients.lastname=dupclients.lastname and clients.id<>dupclients.ID',1,0);52 INSERT INTO tablefindoptionsVALUES (39,18,'Matching Names and Postal Code','clients.firstname=dupclients.firstname and clients.lastname=dupclients.lastname and clients.postalcode=dupclients.postalcode and clients.id<>dupclients.ID',2,0);53 INSERT INTO tablefindoptionsVALUES (40,18,'Matching Addresses','clients.address1=dupclients.address1 and clients.id<>dupclients.ID',3,0);54 INSERT INTO tablefindoptionsVALUES (41,18,'Matching Home Phone','clients.homephone=dupclients.homephone and clients.id<>dupclients.ID',4,0);55 INSERT INTO tablefindoptionsVALUES (47,22,'all records','clientemailprojects.id!=-1',0,0);56 INSERT INTO tablefindoptionsVALUES (48,22,'global projects','clientemailprojects.userid=0',1,0);57 INSERT INTO tablefindoptions VALUES (105,25,'all records','discounts.id!=0',0,-10);1 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (1,2,'Prospects','clients.type = \"prospect\" and clients.inactive=0',1,0); 2 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (7,2,'Today\'s Prospects','clients.type = \"prospect\" and (TO_DAYS(now())-TO_DAYS(clients.creationdate))=0 and clients.inactive=0',3,0); 3 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (8,2,'Yesterday\'s Prospects','clients.type = \"prospect\" and (TO_DAYS(now())-TO_DAYS(clients.creationdate)=1 and clients.inactive=0',4,0); 4 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (9,2,'Last Week\'s Prospects','clients.type = \"prospect\" and (TO_DAYS(now())-TO_DAYS(clients.creationdate))<7 and clients.inactive=0',5,0); 5 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (10,2,'Clients','clients.type = \"client\" and clients.inactive=0',0,0); 6 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (11,2,'Inactive Clients','clients.type = \"client\" and clients.inactive=1',6,0); 7 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (12,2,'All Records','clients.id != 0',7,0); 8 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (102,3,'Invoices - This Quarter','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(CURDATE()) and QUARTER(invoices.invoicedate)=QUARTER(CURDATE())',15,30); 9 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (103,3,'Invoices - This Year','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(CURDATE())',17,30); 10 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (104,3,'Invoices - Last Quarter','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(DATE_SUB(CURDATE(),INTERVAL 3 MONTH)) and QUARTER(invoices.invoicedate)=QUARTER(DATE_SUB(CURDATE(),INTERVAL 3 MONTH))',16,30); 11 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (106,3,'Orders - Committed','invoices.type=\"Order\" and invoices.status=\"Committed\"',3,0); 12 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (107,3,'Orders - Open','invoices.type=\"Order\" and invoices.status=\"Open\"',2,0); 13 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (49,3,'Invoices - Today','invoices.type=\"Invoice\" and invoices.invoicedate=curdate()',9,20); 14 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (50,3,'Invoices - Yesterday','invoices.type=\"Invoice\" and invoices.invoicedate=date_sub(curdate(),INTERVAL 1 DAY)',10,20); 15 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (45,3,'Invoices - This Month','invoices.type=\"Invoice\" and year(invoicedate)=year(curdate()) and month(invoicedate)=month(curdate())',13,30); 16 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (22,3,'Orders','invoices.type=\"Order\"',1,0); 17 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (23,3,'Orders - Packed','invoices.type=\"Order\" and invoices.status=\"Packed\"',4,0); 18 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (24,3,'Orders - Shipped','invoices.type=\"Order\" and invoices.status=\"Shipped\"',5,0); 19 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (25,3,'Invoices','invoices.type=\"Invoice\"',8,30); 20 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (26,3,'Quotes','invoices.type=\"Quote\"',7,20); 21 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (27,3,'Voided Records','invoices.type=\"VOID\"',18,0); 22 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (28,3,'All Records','invoices.id != 0',19,30); 23 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (46,3,'Invoices - Last Month','invoices.type=\"Invoice\" and year(invoicedate)=year(date_sub(curdate(),INTERVAL 1 MONTH)) and month(invoicedate)=month(date_sub(curdate(),INTERVAL 1 MONTH))',14,30); 24 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (51,3,'Invoices - This Week','invoices.type=\"Invoice\" and year(invoicedate)=year(curdate()) and week(invoicedate)=week(curdate())',11,30); 25 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (52,3,'Invoices - Last Week','invoices.type=\"Invoice\" and year(invoicedate)=year(date_sub(curdate(),INTERVAL 7 DAY)) and week(invoicedate)=week(date_sub(curdate(),INTERVAL 7 DAY))',12,30); 26 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (53,3,'Orders - Today','invoices.type=\"Order\" and invoices.orderdate=curdate()',6,0); 27 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (31,4,'In Stock Items','products.status=\"In Stock\"',1,0); 28 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (32,4,'Out of Stock Items','products.status=\"Out of Stock\"',2,0); 29 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (33,4,'Backordered Items','products.status=\"Backordered\"',3,0); 30 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (34,4,'Inactive','products.inactive=1',4,0); 31 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (35,4,'All Records','products.id != 0',5,0); 32 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (29,5,'All Records','lineitems.id!=0',0,30); 33 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (54,5,'Orders','invoices.type=\"Order\"',1,0); 34 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (55,5,'Quotes','invoices.type=\"Quote\"',8,0); 35 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (56,5,'Invoices','invoices.type=\"Invoice\"',9,30); 36 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (57,5,'Orders - Today','invoices.type=\"Order\" and invoices.orderdate=curdate()',2,0); 37 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (58,5,'Invoices - Yesterday','invoices.type=\"Invoice\" and invoices.invoicedate=date_sub(curdate(),INTERVAL 1 DAY)',11,0); 38 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (59,5,'Orders - Yesterday','invoices.type=\"Orders\" and invoices.orderdate=date_sub(curdate(),INTERVAL 1 DAY)',3,0); 39 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (60,5,'Orders - Last Week','invoices.type=\"Order\" and year(invoices.orderdate)=year(date_sub(curdate(),INTERVAL 7 DAY)) and week(invoices.orderdate)=week(date_sub(curdate(),INTERVAL 7 DAY))',5,0); 40 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (61,5,'Orders - This Week','invoices.type=\"Order\" and year(invoices.orderdate)=year(curdate()) and week(invoices.orderdate)=week(curdate())',4,0); 41 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (62,5,'Orders - This Month','invoices.type=\"Order\" and year(invoices.orderdate)=year(curdate()) and month(invoices.orderdate)=month(curdate())',6,0); 42 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (63,5,'Orders - Last Month','invoices.type=\"Order\" and year(invoices.orderdate)=year(date_sub(curdate(),INTERVAL 1 MONTH)) and month(invoices.orderdate)=month(date_sub(curdate(),INTERVAL 1 MONTH))',7,0); 43 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (64,5,'Invoices - Today','invoices.type=\"Invoice\" and invoices.invoicedate=curdate()',10,0); 44 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (65,5,'Invoices - This Week','invoices.type=\"Order\" and year(invoices.orderdate)=year(curdate()) and week(invoices.orderdate)=week(curdate())',12,30); 45 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (66,5,'Invoices - Last Week','invoices.type=\"Invoice\" and year(invoices.invoicedate)=year(date_sub(curdate(),INTERVAL 7 DAY)) and week(invoices.invoicedate)=week(date_sub(curdate(),INTERVAL 7 DAY))',13,30); 46 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (67,5,'Invoices - This Month','invoices.type=\"Invoice\" and year(invoices.invoicedate)=year(curdate()) and month(invoices.invoicedate)=month(curdate())',14,30); 47 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (68,5,'Invoices - Last Month','invoices.type=\"Invoice\" and year(invoicedate)=year(date_sub(curdate(),INTERVAL 1 MONTH)) and month(invoicedate)=month(date_sub(curdate(),INTERVAL 1 MONTH))',15,30); 48 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (30,6,'All Records','tax.id != 0',1,0); 49 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (36,7,'All Records','productcategories.id != 0',1,0); 50 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (37,8,'All Records','prerequisites.id != 0',1,0); 51 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (38,18,'matching names','clients.firstname=dupclients.firstname and clients.lastname=dupclients.lastname and clients.id<>dupclients.ID',1,0); 52 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (39,18,'Matching Names and Postal Code','clients.firstname=dupclients.firstname and clients.lastname=dupclients.lastname and clients.postalcode=dupclients.postalcode and clients.id<>dupclients.ID',2,0); 53 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (40,18,'Matching Addresses','clients.address1=dupclients.address1 and clients.id<>dupclients.ID',3,0); 54 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (41,18,'Matching Home Phone','clients.homephone=dupclients.homephone and clients.id<>dupclients.ID',4,0); 55 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (47,22,'all records','clientemailprojects.id!=-1',0,0); 56 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (48,22,'global projects','clientemailprojects.userid=0',1,0); 57 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (105,25,'all records','discounts.id!=0',0,0); -
trunk/phpbms/modules/bms/install/tableoptions.sql
r145 r170 1 INSERT INTO tableoptionsVALUES (1,2,'new','1',0,0);2 INSERT INTO tableoptionsVALUES (2,2,'edit','1',0,0);3 INSERT INTO tableoptionsVALUES (3,2,'printex','1',0,0);4 INSERT INTO tableoptionsVALUES (4,2,'select','1',0,0);5 INSERT INTO tableoptionsVALUES (63,2,'massEmail','send mass e-mail',1,0);6 INSERT INTO tableoptionsVALUES (5,2,'mark_asclient','convert to client',1,0);7 INSERT INTO tableoptionsVALUES (6,2,'stamp_infosent','info packet sent',1,0);8 INSERT INTO tableoptionsVALUES (7,2,'delete_prospects','delete prospects',1,0);9 INSERT INTO tableoptionsVALUES (28,3,'new','1',0,20);10 INSERT INTO tableoptionsVALUES (29,3,'select','1',0,0);11 INSERT INTO tableoptionsVALUES (30,3,'edit','1',0,0);12 INSERT INTO tableoptionsVALUES (31,3,'printex','1',0,0);13 INSERT INTO tableoptions VALUES (79,3,'mark_asuninvoice','remove invoice status',1,90);14 INSERT INTO tableoptionsVALUES (32,3,'mark_aspaid','mark paid in full',1,0);15 INSERT INTO tableoptionsVALUES (33,3,'mark_asinvoice','convert to invoice',1,30);16 INSERT INTO tableoptionsVALUES (34,3,'mark_ashipped','mark as shipped',1,0);17 INSERT INTO tableoptionsVALUES (41,4,'new','1',0,0);18 INSERT INTO tableoptionsVALUES (42,4,'edit','1',0,0);19 INSERT INTO tableoptionsVALUES (43,4,'select','1',0,0);20 INSERT INTO tableoptionsVALUES (44,4,'printex','1',0,0);21 INSERT INTO tableoptionsVALUES (35,5,'new','0',0,0);22 INSERT INTO tableoptionsVALUES (36,5,'select','1',0,0);23 INSERT INTO tableoptionsVALUES (37,5,'edit','0',0,0);24 INSERT INTO tableoptionsVALUES (68,5,'printex','1',0,0);25 INSERT INTO tableoptionsVALUES (38,6,'new','1',0,0);26 INSERT INTO tableoptionsVALUES (39,6,'select','1',0,0);27 INSERT INTO tableoptionsVALUES (40,6,'edit','1',0,0);28 INSERT INTO tableoptionsVALUES (45,7,'new','1',0,0);29 INSERT INTO tableoptionsVALUES (46,7,'edit','1',0,0);30 INSERT INTO tableoptionsVALUES (47,7,'select','1',0,0);31 INSERT INTO tableoptionsVALUES (48,7,'printex','1',0,0);32 INSERT INTO tableoptionsVALUES (49,8,'new','0',0,0);33 INSERT INTO tableoptionsVALUES (50,8,'select','1',0,0);34 INSERT INTO tableoptionsVALUES (51,8,'edit','0',0,0);35 INSERT INTO tableoptionsVALUES (52,18,'new','0',0,0);36 INSERT INTO tableoptionsVALUES (53,18,'edit','0',0,0);37 INSERT INTO tableoptionsVALUES (54,18,'select','1',0,0);38 INSERT INTO tableoptionsVALUES (55,18,'delete_prospects','delete prospects',0,0);39 INSERT INTO tableoptionsVALUES (64,22,'new','0',0,0);40 INSERT INTO tableoptionsVALUES (65,22,'edit','1',0,0);41 INSERT INTO tableoptionsVALUES (66,22,'select','1',0,0);42 INSERT INTO tableoptionsVALUES (67,22,'printex','0',0,0);43 INSERT INTO tableoptions VALUES (80,25,'new','1',0,-10);44 INSERT INTO tableoptions VALUES (81,25,'select','1',0,-10);45 INSERT INTO tableoptions VALUES (82,25,'edit','1',0,-10);1 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (1,2,'new','1',0,0); 2 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (2,2,'edit','1',0,0); 3 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (3,2,'printex','1',0,0); 4 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (4,2,'select','1',0,0); 5 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (63,2,'massEmail','send mass e-mail',1,0); 6 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (5,2,'mark_asclient','convert to client',1,0); 7 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (6,2,'stamp_infosent','info packet sent',1,0); 8 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (7,2,'delete_prospects','delete prospects',1,0); 9 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (28,3,'new','1',0,20); 10 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (29,3,'select','1',0,0); 11 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (30,3,'edit','1',0,0); 12 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (31,3,'printex','1',0,0); 13 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (79,3,'mark_asuninvoice','remove invoice status',1,-100); 14 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (32,3,'mark_aspaid','mark paid in full',1,0); 15 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (33,3,'mark_asinvoice','convert to invoice',1,30); 16 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (34,3,'mark_ashipped','mark as shipped',1,0); 17 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (41,4,'new','1',0,0); 18 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (42,4,'edit','1',0,0); 19 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (43,4,'select','1',0,0); 20 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (44,4,'printex','1',0,0); 21 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (35,5,'new','0',0,0); 22 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (36,5,'select','1',0,0); 23 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (37,5,'edit','0',0,0); 24 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (68,5,'printex','1',0,0); 25 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (38,6,'new','1',0,0); 26 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (39,6,'select','1',0,0); 27 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (40,6,'edit','1',0,0); 28 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (45,7,'new','1',0,0); 29 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (46,7,'edit','1',0,0); 30 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (47,7,'select','1',0,0); 31 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (48,7,'printex','1',0,0); 32 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (49,8,'new','0',0,0); 33 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (50,8,'select','1',0,0); 34 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (51,8,'edit','0',0,0); 35 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (52,18,'new','0',0,0); 36 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (53,18,'edit','0',0,0); 37 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (54,18,'select','1',0,0); 38 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (55,18,'delete_prospects','delete prospects',0,0); 39 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (64,22,'new','0',0,0); 40 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (65,22,'edit','1',0,0); 41 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (66,22,'select','1',0,0); 42 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (67,22,'printex','0',0,0); 43 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (80,25,'new','1',0,0); 44 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (81,25,'select','1',0,0); 45 INSERT INTO `tableoptions` (`id`, `tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (82,25,'edit','1',0,0); -
trunk/phpbms/modules/bms/install/tablesearchablefields.sql
r145 r170 1 INSERT INTO tablesearchablefieldsVALUES (1,2,'(clients.lastname like \"{{value}}%\" or clients.firstname like \"{{value}}%\" or clients.company like \"{{value}}%\")','company / name',0,'whereclause');2 INSERT INTO tablesearchablefieldsVALUES (14,2,'(clients.homephone like \"{{value}}%\" or clients.workphone like \"{{value}}%\" or clients.mobilephone like \"{{value}}%\" or clients.otherphone like \"{{value}}%\" or clients.fax like \"{{value}}%\")','phone',1,'whereclause');3 INSERT INTO tablesearchablefieldsVALUES (17,2,'clients.city','city',2,'field');4 INSERT INTO tablesearchablefieldsVALUES (18,2,'clients.state','state',3,'field');5 INSERT INTO tablesearchablefieldsVALUES (19,2,'clients.postalcode','postal code',4,'field');6 INSERT INTO tablesearchablefieldsVALUES (20,2,'clients.email','e-mail',5,'field');7 INSERT INTO tablesearchablefieldsVALUES (21,2,'clients.leadsource','lead source',6,'field');8 INSERT INTO tablesearchablefieldsVALUES (22,2,'clients.id','id',7,'field');9 INSERT INTO tablesearchablefieldsVALUES (72,3,'invoices.orderdate','order date',2,'field');10 INSERT INTO tablesearchablefieldsVALUES (73,3,'invoices.invoicedate','invoice date',3,'field');11 INSERT INTO tablesearchablefieldsVALUES (40,3,'(clients.lastname like \"{{value}}%\" or clients.firstname like \"{{value}}%\" or clients.company like \"{{value}}%\")','company / name',1,'whereclause');12 INSERT INTO tablesearchablefieldsVALUES (41,3,'invoices.id','id',0,'field');13 INSERT INTO tablesearchablefieldsVALUES (48,4,'products.partnumber','part number',0,'field');14 INSERT INTO tablesearchablefieldsVALUES (49,4,'products.partname','part name',1,'field');15 INSERT INTO tablesearchablefieldsVALUES (50,4,'products.unitprice','unit price',2,'field');16 INSERT INTO tablesearchablefieldsVALUES (51,4,'products.id','id',3,'field');17 INSERT INTO tablesearchablefieldsVALUES (42,5,'products.partnumber','part number',0,'field');18 INSERT INTO tablesearchablefieldsVALUES (43,5,'lineitems.invoiceid','invoice id',2,'field');19 INSERT INTO tablesearchablefieldsVALUES (44,5,'lineitems.id','id',8,'field');20 INSERT INTO tablesearchablefieldsVALUES (76,5,'invoices.orderdate','order date',3,'field');21 INSERT INTO tablesearchablefieldsVALUES (77,5,'invoices.invoicedate','invoice date',4,'field');22 INSERT INTO tablesearchablefieldsVALUES (45,5,'products.partname','part name',1,'field');23 INSERT INTO tablesearchablefieldsVALUES (46,6,'tax.name','name',0,'field');24 INSERT INTO tablesearchablefieldsVALUES (47,6,'tax.id','id',1,'field');25 INSERT INTO tablesearchablefieldsVALUES (52,7,'productcategories.name','name',0,'field');26 INSERT INTO tablesearchablefieldsVALUES (53,7,'productcategories.id','id',1,'field');27 INSERT INTO tablesearchablefieldsVALUES (54,8,'products.partnumber','part number',0,'field');28 INSERT INTO tablesearchablefieldsVALUES (55,8,'products.partname','part name',1,'field');29 INSERT INTO tablesearchablefieldsVALUES (56,8,'childproducts.partnumber','dependent part number',2,'field');30 INSERT INTO tablesearchablefieldsVALUES (57,8,'childproducts.partname','dependent name',3,'field');31 INSERT INTO tablesearchablefieldsVALUES (58,8,'prerequisites.id','id',4,'field');32 INSERT INTO tablesearchablefieldsVALUES (59,18,'(clients.lastname like \"{{value}}%\" or clients.firstname like \"{{value}}%\" or clients.company like \"{{value}}%\")','company / name',0,'whereclause');33 INSERT INTO tablesearchablefieldsVALUES (61,18,'(clients.homephone like \"{{value}}%\" or clients.workphone like \"{{value}}%\" or clients.mobilephone like \"{{value}}%\" or clients.otherphone like \"{{value}}%\" or clients.fax like \"{{value}}%\")','phone',1,'whereclause');34 INSERT INTO tablesearchablefieldsVALUES (62,18,'clients.city','city',2,'field');35 INSERT INTO tablesearchablefieldsVALUES (63,18,'clients.state','state',3,'field');36 INSERT INTO tablesearchablefieldsVALUES (64,18,'clients.postalcode','postal code',4,'field');37 INSERT INTO tablesearchablefieldsVALUES (65,18,'clients.email','e-mail',5,'field');38 INSERT INTO tablesearchablefieldsVALUES (66,18,'clients.id','id',6,'field');39 INSERT INTO tablesearchablefieldsVALUES (74,22,'clientemailprojects.name','name',0,'field');40 INSERT INTO tablesearchablefieldsVALUES (75,22,'users.firstname like \"{{value}}%\" or users.lastname like \"{{value}}%\"','user',1,'whereclause');41 INSERT INTO tablesearchablefieldsVALUES (95,25,'discounts.name','name',0,'field');1 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (1,2,'(clients.lastname like \"{{value}}%\" or clients.firstname like \"{{value}}%\" or clients.company like \"{{value}}%\")','company / name',0,'whereclause'); 2 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (14,2,'(clients.homephone like \"{{value}}%\" or clients.workphone like \"{{value}}%\" or clients.mobilephone like \"{{value}}%\" or clients.otherphone like \"{{value}}%\" or clients.fax like \"{{value}}%\")','phone',1,'whereclause'); 3 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (17,2,'clients.city','city',2,'field'); 4 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (18,2,'clients.state','state',3,'field'); 5 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (19,2,'clients.postalcode','postal code',4,'field'); 6 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (20,2,'clients.email','e-mail',5,'field'); 7 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (21,2,'clients.leadsource','lead source',6,'field'); 8 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (22,2,'clients.id','id',7,'field'); 9 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (72,3,'invoices.orderdate','order date',2,'field'); 10 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (73,3,'invoices.invoicedate','invoice date',3,'field'); 11 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (40,3,'(clients.lastname like \"{{value}}%\" or clients.firstname like \"{{value}}%\" or clients.company like \"{{value}}%\")','company / name',1,'whereclause'); 12 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (41,3,'invoices.id','id',0,'field'); 13 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (48,4,'products.partnumber','part number',0,'field'); 14 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (49,4,'products.partname','part name',1,'field'); 15 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (50,4,'products.unitprice','unit price',2,'field'); 16 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (51,4,'products.id','id',3,'field'); 17 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (42,5,'products.partnumber','part number',0,'field'); 18 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (43,5,'lineitems.invoiceid','invoice id',2,'field'); 19 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (44,5,'lineitems.id','id',8,'field'); 20 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (76,5,'invoices.orderdate','order date',3,'field'); 21 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (77,5,'invoices.invoicedate','invoice date',4,'field'); 22 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (45,5,'products.partname','part name',1,'field'); 23 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (46,6,'tax.name','name',0,'field'); 24 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (47,6,'tax.id','id',1,'field'); 25 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (52,7,'productcategories.name','name',0,'field'); 26 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (53,7,'productcategories.id','id',1,'field'); 27 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (54,8,'products.partnumber','part number',0,'field'); 28 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (55,8,'products.partname','part name',1,'field'); 29 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (56,8,'childproducts.partnumber','dependent part number',2,'field'); 30 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (57,8,'childproducts.partname','dependent name',3,'field'); 31 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (58,8,'prerequisites.id','id',4,'field'); 32 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (59,18,'(clients.lastname like \"{{value}}%\" or clients.firstname like \"{{value}}%\" or clients.company like \"{{value}}%\")','company / name',0,'whereclause'); 33 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (61,18,'(clients.homephone like \"{{value}}%\" or clients.workphone like \"{{value}}%\" or clients.mobilephone like \"{{value}}%\" or clients.otherphone like \"{{value}}%\" or clients.fax like \"{{value}}%\")','phone',1,'whereclause'); 34 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (62,18,'clients.city','city',2,'field'); 35 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (63,18,'clients.state','state',3,'field'); 36 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (64,18,'clients.postalcode','postal code',4,'field'); 37 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (65,18,'clients.email','e-mail',5,'field'); 38 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (66,18,'clients.id','id',6,'field'); 39 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (74,22,'clientemailprojects.name','name',0,'field'); 40 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (75,22,'users.firstname like \"{{value}}%\" or users.lastname like \"{{value}}%\"','user',1,'whereclause'); 41 INSERT INTO `tablesearchablefields` (`id`, `tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (95,25,'discounts.name','name',0,'field'); -
trunk/phpbms/modules/bms/install/update.php
r145 r170 114 114 115 115 function verifyAdminLogin($user,$pass,$encryptionSeed,$dblink){ 116 $querystatement="SELECT id FROM users WHERE login=\"".$user."\" AND password=encode(\"".$pass."\",\"".$encryptionSeed."\") AND a ccesslevel>=90";116 $querystatement="SELECT id FROM users WHERE login=\"".$user."\" AND password=encode(\"".$pass."\",\"".$encryptionSeed."\") AND admin=1"; 117 117 $queryresult=mysql_query($querystatement,$dblink); 118 118 if(!$queryresult) die("what the!");//return false; -
trunk/phpbms/modules/bms/invoices_addedit.php
r161 r170 117 117 $thechoices[]=array("name"=>"Quote","value"=>"Quote"); 118 118 $thechoices[]=array("name"=>"Order","value"=>"Order"); 119 if( $_SESSION["userinfo"]["accesslevel"]>=30) $thechoices[]=array("name"=>"Invoice","value"=>"Invoice");119 if(hasRights(30)) $thechoices[]=array("name"=>"Invoice","value"=>"Invoice"); 120 120 $thechoices[]=array("name"=>"VOID","value"=>"VOID"); 121 121 basic_choicelist("type",$therecord["type"],$thechoices,array("onchange"=>"checkType(this)","class"=>"important","style"=>"width:90px","tabindex"=>"9")); … … 321 321 <input name="Button" type="button" class="Buttons" onClick="this.form['amountpaid'].value=this.form['totalti'].value;calculatePaidDue();" value="pay in full" tabindex="24"/> 322 322 </p> 323 <?php if( $_SESSION["userinfo"]["accesslevel"]>=20){ ?>323 <?php if(hasRights(20)){ ?> 324 324 <p> 325 325 <label for="paymentmethod">payment method</label><br /> … … 350 350 <input id="ccverification" name="ccverification" type="text" value="<?php echo htmlQuotes($therecord["ccverification"]) ?>" size="8" maxlength="7" tabindex="29" /> 351 351 </p> 352 </div><?php }// end if access level?>352 </div><?php }// end if access?> 353 353 </fieldset> 354 354 <div id="fsShipping"> -
trunk/phpbms/modules/bms/invoices_attachments.php
r145 r170 48 48 $tabledefid=3; 49 49 $refid=(integer) $_GET["refid"]; 50 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid." AND files.accesslevel<=".$_SESSION["userinfo"]["accesslevel"]; 50 $securitywhere=""; 51 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 52 $securitywhere=" AND files.roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 53 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid.$securitywhere; 51 54 $backurl="../bms/invoices_attachments.php"; 52 55 $base="../../"; -
trunk/phpbms/modules/bms/products_attachments.php
r145 r170 48 48 $tabledefid=4; 49 49 $refid=(integer) $_GET["refid"]; 50 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid." AND files.accesslevel<=".$_SESSION["userinfo"]["accesslevel"]; 50 $securitywhere=""; 51 if ($_SESSION["userinfo"]["admin"]!=1 && count($_SESSION["userinfo"]["roles"])>0) 52 $securitywhere=" AND files.roleid IN (".implode(",",$_SESSION["userinfo"]["roles"]).",0)"; 53 $whereclause="attachments.tabledefid=".$tabledefid." AND attachments.recordid=".$refid.$securitywhere 51 54 $backurl="../bms/products_attachments.php"; 52 55 $base="../../"; -
trunk/phpbms/modules/bms/products_saleshistory.php
r166 r170 41 41 include("../../include/fields.php"); 42 42 43 if( $_SESSION["userinfo"]["accesslevel"]<30) goURL($_SESSION["app_path"]."noaccess.html");43 if(!hasRights(30)) goURL($_SESSION["app_path"]."noaccess.php"); 44 44 45 45 include("include/products_functions.php"); -
trunk/phpbms/modules/bms/report/clients_folderlabels.php
r145 r170 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 session_cache_limiter('private'); 40 require_once("../../../include/session.php"); 41 require_once("../../../fpdf/fpdf.php"); 42 39 43 if($_SESSION["printing"]["sortorder"]) 40 44 $sortorder=$_SESSION["printing"]["sortorder"]; … … 72 76 } 73 77 74 session_cache_limiter('private');75 require_once("../../../include/session.php");76 require_once("../../../fpdf/fpdf.php");77 78 require("../../../report/general_labels.php"); 78 79 ?> -
trunk/phpbms/modules/bms/report/clients_mailinglabels.php
r145 r170 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 session_cache_limiter('private'); 40 require_once("../../../include/session.php"); 41 require_once("../../../fpdf/fpdf.php"); 39 42 40 43 if($_SESSION["printing"]["sortorder"]) … … 77 80 } 78 81 79 session_cache_limiter('private');80 require_once("../../../include/session.php");81 require_once("../../../fpdf/fpdf.php");82 82 require("../../../report/general_labels.php"); 83 83 ?> -
trunk/phpbms/modules/bms/report/clients_purchasehistory.php
r163 r170 109 109 inner join lineitems on invoices.id=lineitems.invoiceid) 110 110 inner join products on lineitems.productid=products.id 111 WHERE clients.id=".$ _GET["id"]."111 WHERE clients.id=".$id." 112 112 and ".$thestatus." 113 113 HAVING -
trunk/phpbms/modules/bms/report/clients_shippinglabels.php
r145 r170 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 session_cache_limiter('private'); 40 require_once("../../../include/session.php"); 41 require_once("../../../fpdf/fpdf.php"); 39 42 40 43 if($_SESSION["printing"]["sortorder"]) … … 77 80 return $pdf; 78 81 } 79 80 session_cache_limiter('private');81 require_once("../../../include/session.php");82 require_once("../../../fpdf/fpdf.php");83 82 require("../../../report/general_labels.php"); 84 83 ?> -
trunk/phpbms/modules/bms/snapshot.php
r162 r170 132 132 } 133 133 134 if ( $_SESSION["userinfo"]["accesslevel"]>=20) {?>134 if (hasRights(20)) {?> 135 135 <div class="box" id="bmsBox"> 136 136 <button class="graphicButtons buttonDown" id="todaysOrdersLink"><span>Up</span></button> -
trunk/phpbms/print.php
r167 r170 198 198 <option value="selected">selected records (<?php echo count($tablePrinter->theids) ?> record<?php if(count($tablePrinter->theids)>1) echo "s"?>)</option> 199 199 <option value="savedsearch">saved search...</option> 200 <?php if($_SESSION["userinfo"]["a ccesslevel"]>=30){?><option value="all">all records in table</option><?php }?>200 <?php if($_SESSION["userinfo"]["admin"]==1){?><option value="all">all records in table</option><?php }?> 201 201 </select> 202 202 </p> -
trunk/phpbms/servefile.php
r145 r170 40 40 session_cache_limiter('private'); 41 41 require_once("include/session.php"); 42 if(isset($_GET["i"]) && isset($_SESSION["userinfo"]["accesslevel"])) { 43 $querystatement="SELECT file,type,name FROM files WHERE id=".((integer)$_GET["i"])." AND accesslevel<=".$_SESSION["userinfo"]["accesslevel"]; 42 require_once("include/common_functions.php"); 43 if(isset($_GET["i"])) { 44 $querystatement="SELECT file,type,name,roleid FROM files WHERE id=".((integer)$_GET["i"]); 44 45 @ $queryresult=mysql_query($querystatement,$dblink); 45 46 if($queryresult) { 46 47 if(mysql_num_rows($queryresult)){ 47 48 $therecord=mysql_fetch_array($queryresult); 48 header("Content-type: ".$therecord["type"]); 49 header("Content-Disposition: attachment; filename=\"".rawurlencode($therecord["name"])."\""); 50 51 echo $therecord["file"]; 49 if(hasRights($therecord["roleid"])){ 50 header("Content-type: ".$therecord["type"]); 51 header("Content-Disposition: attachment; filename=\"".rawurlencode($therecord["name"])."\""); 52 53 echo $therecord["file"]; 54 } 52 55 } 53 56 }