phpBMS

Changeset 203

Show
Ignore:
Timestamp:
03/23/07 18:47:37 (5 years ago)
Author:
brieb
Message:

Updated errors with update process.
Added backward compatibility with PHP < 4.3.0
Removed invoice debug paramaters.

Location:
trunk/phpbms
Files:
4 modified

Legend:

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

    r200 r203  
    141141// Start Code 
    142142//================================================================================================================= 
     143 
     144//php <4.3.0 compatibility 
     145if(!function_exists("mysql_real_escape_string")){ 
     146        function mysql_real_escape_string($string){ 
     147                return mysql_escape_string($string); 
     148        } 
     149         
     150   function utf8_replaceEntity($result){ 
     151       $value = (int)$result[1]; 
     152       $string = ''; 
     153       
     154       $len = round(pow($value,1/8)); 
     155       
     156       for($i=$len;$i>0;$i--){ 
     157           $part = ($value & (255>>2)) | pow(2,7); 
     158           if ( $i == 1 ) $part |= 255<<(8-$len); 
     159           
     160           $string = chr($part) . $string; 
     161           
     162           $value >>= 6; 
     163       } 
     164       
     165       return $string; 
     166   } 
     167   
     168   function html_entity_decode($string){ 
     169       return preg_replace_callback( 
     170           '/&#([0-9]+);/u', 
     171           'utf8_replaceEntity', 
     172           $string 
     173       ); 
     174   }     
     175} 
     176 
    143177        if(!isset($_SERVER['REQUEST_URI'])) { 
    144178                // This following code is for windows boxen, because they lack some server varables as well 
     
    157191                session_start(); 
    158192        error_reporting(E_ALL); 
    159  
    160193         
    161194        if (!isset($_SESSION["app_path"])) 
  • trunk/phpbms/install/install.php

    r201 r203  
    108108        <ul> 
    109109                <li>MySQL 3.23.58 or higher</li> 
    110                 <li>PHP 4.1.2 or higher</li> 
     110                <li>PHP 4.3.0 or higher</li> 
    111111                <li>Web Server (Tested using Apache and IIS.)</li> 
    112112    </ul> 
  • trunk/phpbms/modules/bms/install/updatev0.70.sql

    r202 r203  
    1 CREATE TABLE `shippingmethods` (`id` int(11) NOT NULL AUTO_INCREMENT,  `name` VARCHAR(128) NOT NULL,  `inactive` tinyint(4) DEFAULT 0,  `priority` int(11) DEFAULT 0,  `canestimate` tinyint(4) DEFAULT 0,  `estimationscript` VARCHAR(128),  `createdby` INTEGER UNSIGNED,  `creationdate` DATETIME,  `modifiedby` INTEGER UNSIGNED,  `modifieddate` TIMESTAMP, PRIMARY KEY(`id`)) ENGINE = MYISAM; 
     1CREATE TABLE `shippingmethods` (`id` int(11) NOT NULL AUTO_INCREMENT,  `name` VARCHAR(128) NOT NULL,  `inactive` tinyint(4) DEFAULT 0,  `priority` int(11) DEFAULT 0,  `canestimate` tinyint(4) DEFAULT 0,  `estimationscript` VARCHAR(128),  `createdby` INTEGER UNSIGNED,  `creationdate` DATETIME,  `modifiedby` INTEGER UNSIGNED,  `modifieddate` TIMESTAMP, PRIMARY KEY(`id`)); 
    22ALTER TABLE `invoices` ADD COLUMN `shippingmethodid` INTEGER UNSIGNED AFTER `shippingmethod`; 
    33UPDATE `invoices` SET shippingmethodid=0; 
     
    2020INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`,`wrap`, `size`, `format`) VALUES (300,'estimate','shippingmethods.canestimate','center','',2,'',0,'','boolean'); 
    2121INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`,`wrap`, `size`, `format`) VALUES (300,'priority','shippingmethods.priority','right','',0,'',0,'',NULL); 
    22 CREATE TABLE `paymentmethods` (`id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL default '',  `type` enum('draft','charge','receivable') default NULL,  `priority` int(8) NOT NULL default '0',  `inactive` tinyint(1) NOT NULL default '0',  `onlineprocess` tinyint(1) NOT NULL default '0',  `processscript` varchar(128) default '',  `createdby` int(11) default NULL,  `creationdate` datetime default NULL,  `modifiedby` int(11) default NULL,  `modifieddate` TIMESTAMP,  PRIMARY KEY  (`id`)) TYPE=MyISAM PACK_KEYS=0; 
     22CREATE TABLE `paymentmethods` (`id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL default '',  `type` enum('draft','charge','receivable') default NULL,  `priority` int(8) NOT NULL default '0',  `inactive` tinyint(1) NOT NULL default '0',  `onlineprocess` tinyint(1) NOT NULL default '0',  `processscript` varchar(128) default '',  `createdby` int(11) default NULL,  `creationdate` datetime default NULL,  `modifiedby` int(11) default NULL,  `modifieddate` TIMESTAMP,  PRIMARY KEY  (`id`)); 
    2323INSERT 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 (301,'Payment Methods','table',2,'paymentmethods','paymentmethods','modules/bms/paymentmethods_addedit.php',30,'modules/bms/paymentmethods_addedit.php',30,30,30,-100,'inactivate','paymentmethods.inactive=0','paymentmethods.priority,paymentmethods.name','','','',1,NOW(),1,NOW()); 
    2424INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (301,'All Records','paymentmethods.id!=-1',2,0); 
     
    4646ALTER TABLE `clients` CHANGE COLUMN `shiptostate` `shiptostate` varchar(5) default NULL; 
    4747ALTER TABLE `invoices` CHANGE COLUMN `state` `state` varchar(5) default NULL; 
    48 CREATE TABLE `invoicestatuses` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,`name` VARCHAR(128), `invoicedefault` TINYINT UNSIGNED NOT NULL DEFAULT 0,`defaultassignedtoid` INTEGER UNSIGNED,`inactive` TINYINT UNSIGNED NOT NULL DEFAULT 0, `priority` INTEGER UNSIGNED NOT NULL DEFAULT 0, `createdby` INTEGER UNSIGNED, `creationdate` DATETIME, `modifiedby` INTEGER UNSIGNED, `modifieddate` TIMESTAMP, PRIMARY KEY(`id`))ENGINE = MYISAM; 
    49 CREATE TABLE `invoicestatushistory` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `invoiceid` INTEGER UNSIGNED, `invoicestatusid` INTEGER UNSIGNED, `statusdate` DATE, `assignedtoid` INTEGER UNSIGNED, PRIMARY KEY(`id`))ENGINE = MYISAM; 
     48CREATE TABLE `invoicestatuses` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,`name` VARCHAR(128), `invoicedefault` TINYINT UNSIGNED NOT NULL DEFAULT 0,`defaultassignedtoid` INTEGER UNSIGNED,`inactive` TINYINT UNSIGNED NOT NULL DEFAULT 0, `priority` INTEGER UNSIGNED NOT NULL DEFAULT 0, `createdby` INTEGER UNSIGNED, `creationdate` DATETIME, `modifiedby` INTEGER UNSIGNED, `modifieddate` TIMESTAMP, PRIMARY KEY(`id`)); 
     49CREATE TABLE `invoicestatushistory` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `invoiceid` INTEGER UNSIGNED, `invoicestatusid` INTEGER UNSIGNED, `statusdate` DATE, `assignedtoid` INTEGER UNSIGNED, PRIMARY KEY(`id`)); 
    5050INSERT INTO `invoicestatuses` (`id`, `name`, `invoicedefault`, `defaultassignedtoid`, `inactive`, `priority`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (1,'Open',1,NULL,0,0,1,NOW(),1,NOW()); 
    5151INSERT INTO `invoicestatuses` (`id`, `name`, `invoicedefault`, `defaultassignedtoid`, `inactive`, `priority`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (2,'Committed',0,NULL,0,10,1,NOW(),1,NOW()); 
  • trunk/phpbms/modules/bms/invoices_addedit.php

    r202 r203  
    432432                        <input class="uneditable fieldCurrency important fieldTotal" name="totalti" id="totalti" type="text" value="<?php echo numberToCurrency($therecord["totalti"])?>" size="12" maxlength="15" onchange="calculateTotal();"  readonly="true" /> 
    433433                        <input id="totalcost" name="totalcost" type="hidden" value="<?php echo $therecord["totalcost"] ?>" /> 
    434                         <input id="totaltaxable" name="totaltaxable" type="text" value="<?php echo $therecord["totaltaxable"] ?>" /> 
     434                        <input id="totaltaxable" name="totaltaxable" type="hidden" value="<?php echo $therecord["totaltaxable"] ?>" /> 
    435435                </td> 
    436436                <td class="totalItems">&nbsp;</td> 
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.