phpBMS

Changeset 206

Show
Ignore:
Timestamp:
03/27/07 11:44:14 (5 years ago)
Author:
brieb
Message:

Fixed install problems with scheduler.
Fixed convert to invoice function.
Expanded logging details for errors.

Location:
trunk/phpbms
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/include/session.php

    r204 r206  
    112112                 
    113113        if($log && function_exists("sendLog")){ 
    114                 global $dblik; 
     114                global $dblink; 
    115115                if(!isset($_SESSION["userinfo"]["id"])) 
    116116                        $_SESSION["userinfo"]["id"]="NULL"; 
    117                 sendLog($dblink,"ERROR",$id.":".$extras,$_SESSION["userinfo"]["id"]); 
     117                sendLog($dblink,"ERROR",$id.": ".$_SERVER["REQUEST_URI"]." -- ".$extras,$_SESSION["userinfo"]["id"]); 
    118118        } 
    119119        if($die) die(); 
  • trunk/phpbms/install/createtables.sql

    r200 r206  
    276276 
    277277CREATE TABLE `scheduler` ( 
    278   `id` int(10) unsigned NOT NULL, 
     278  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 
    279279  `name` varchar(45) default NULL, 
    280280  `job` varchar(128) default NULL, 
     
    288288  `creationdate` datetime default NULL, 
    289289  `modifiedby` int(10) unsigned default NULL, 
    290   `modifieddate` timestamp NOT NULL default CURRENT_TIMESTAMP, 
     290  `modifieddate` TIMESTAMP, 
    291291  PRIMARY KEY  (`id`), 
    292292  KEY `inactivated` (`inactive`), 
  • trunk/phpbms/install/tableoptions.sql

    r200 r206  
    4848INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'inactivate','inactivate',1,0); 
    4949INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (201,'runSelected','run job(s)',1,0); 
    50 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (201,'name','scheduler.name','left','',0,'',0,'95%',NULL); 
    51 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (201,'cron interval','scheduler.crontab','left','',1,'',0,'',NULL); 
    52 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (201,'inactive','scheduler.inactive','center','',2,'',0,'','boolean'); 
    5350INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,'new','0',0,0); 
    5451INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (202,'select','1',0,0); 
  • trunk/phpbms/install/updatev0.7.sql

    r204 r206  
    6666INSERT INTO `settings` (`name`, `value`) VALUES ('thousands_separator',','); 
    6767INSERT INTO `settings` (`name`, `value`) VALUES ('demo_enabled','false'); 
    68 CREATE TABLE `scheduler` (`id` int(10) unsigned NOT NULL, `name` varchar(45) default NULL, `job` varchar(128) default NULL, `crontab` varchar(64) default NULL, `lastrun` datetime default NULL, `startdatetime` datetime NOT NULL, `enddatetime` datetime default NULL, `description` text, `inactive` tinyint(3) unsigned NOT NULL default '0', `createdby` int(10) unsigned default NULL, `creationdate` datetime default NULL, `modifiedby` int(10) unsigned default NULL, `modifieddate` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY  (`id`), KEY `inactivated` (`inactive`), KEY `startdate` (`startdatetime`), KEY `enddate` (`enddatetime`)); 
     68CREATE TABLE `scheduler` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(45) default NULL, `job` varchar(128) default NULL, `crontab` varchar(64) default NULL, `lastrun` datetime default NULL, `startdatetime` datetime NOT NULL, `enddatetime` datetime default NULL, `description` text, `inactive` tinyint(3) unsigned NOT NULL default '0', `createdby` int(10) unsigned default NULL, `creationdate` datetime default NULL, `modifiedby` int(10) unsigned default NULL, `modifieddate` timestamp NOT NULL, PRIMARY KEY  (`id`), KEY `inactivated` (`inactive`), KEY `startdate` (`startdatetime`), KEY `enddate` (`enddatetime`)); 
    6969INSERT 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 (201,'Scheduler','system',1,'scheduler','scheduler','modules/base/scheduler_addedit.php',-100,'modules/base/scheduler_addedit.php',-100,-100,-100,-100,'delete','scheduler.id!=0','scheduler.name','','','',1,NOW(),1,NOW()); 
    7070INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (201,'all records','scheduler.id!=0',0,0); 
  • trunk/phpbms/modules/bms/include/invoices_search_functions.php

    r204 r206  
    110110 
    111111        $whereclause=buildWhereClause($theids,"invoices.id"); 
    112         $whereclause="(".$whereclause.") AND (invoices.type!=\"Invoice\" OR invoices.type!=\"VOID\") AND invoices.amountpaid=invoices.totalti;"; 
     112        $whereclause="(".$whereclause.") AND (invoices.type!=\"Invoice\" OR invoices.type!=\"VOID\") AND invoices.amountpaid=invoices.totalti"; 
    113113         
    114114        //Look up default assignedto 
     
    121121                $assignedtoid=$therecord["defaultassignedtoid"]; 
    122122 
    123         $querystatement = "UPDATE invoices SET invoices.type=\"Invoice\" invoices.invoicedate=ifnull(invoices.invoicedate,Now()),modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE".$whereclause; 
     123        $querystatement = "UPDATE invoices SET invoices.type=\"Invoice\", invoices.invoicedate=ifnull(invoices.invoicedate,Now()),modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE".$whereclause; 
    124124        $queryresult = mysql_query($querystatement,$dblink); 
    125125        if (!$queryresult) reportError(300,"Could not mark as invoice: ".mysql_error($dblink)." -- ".$querystatement);           
     
    131131        $querystatement="SELECT id FROM invoices WHERE (".$whereclause.") AND statusid!=4"; 
    132132        $queryresult = mysql_query($querystatement,$dblink); 
     133        if (!$queryresult) reportError(300,"Could not retrieve history for history cleaning: ".mysql_error($dblink)." -- ".$querystatement);             
    133134         
    134135        while($therecord=mysql_fetch_array($queryresult)){ 
    135                 $querystatement = "UPDATE invoices SET invoices.statusid=4,invoices.statusdate=Now(), invoices.assignedtoid=".$assignedtoid.", WHERE id=".$therecord["id"]; 
     136                $querystatement = "UPDATE invoices SET invoices.statusid=4,invoices.statusdate=Now(), invoices.assignedtoid=".$assignedtoid." WHERE invoices.id=".$therecord["id"]; 
    136137                $queryresult = mysql_query($querystatement,$dblink); 
    137138                if (!$queryresult) reportError(300,"Could not mark as invoice: ".mysql_error($dblink)." -- ".$querystatement);           
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.