PHP7 compatibility fixes.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 13 Oct 2017 19:18:19 +0000 (21:18 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 9 Nov 2017 12:28:59 +0000 (13:28 +0100)
54 files changed:
admin/includes/fa_patch.class.inc
applications/application.php
applications/customers.php
applications/dimensions.php
applications/fixed_assets.php
applications/generalledger.php
applications/inventory.php
applications/manufacturing.php
applications/setup.php
applications/suppliers.php
frontaccounting.php
includes/JsHttpRequest.php
includes/ajax.inc
includes/archive.inc
includes/current_user.inc
includes/db/class.data_set.inc
includes/db/class.reflines_db.inc
includes/db_pager.inc
includes/errors.inc
includes/lang/language.inc
includes/packages.inc
includes/prefs/sysprefs.inc
includes/prefs/userprefs.inc
includes/references.inc
includes/session.inc
includes/ui/allocation_cart.inc
includes/ui/class.crud_view.inc
includes/ui/class.reflines_crud.inc
includes/ui/contacts_view.inc
includes/ui/items_cart.inc
includes/ui/simple_crud_class.inc
purchasing/includes/po_class.inc
purchasing/includes/supp_trans_class.inc
reporting/includes/Workbook.php
reporting/includes/barcodes.php
reporting/includes/class.graphic.inc
reporting/includes/class.mail.inc
reporting/includes/class.pdf.inc
reporting/includes/excel_report.inc
reporting/includes/fpdi/decoders/ASCII85Decode.php
reporting/includes/fpdi/decoders/LZWDecode.php
reporting/includes/fpdi/fpdi_pdf_parser.php
reporting/includes/fpdi/pdf_context.php
reporting/includes/fpdi/pdf_parser.php
reporting/includes/pdf_report.inc
reporting/includes/printer_class.inc
reporting/includes/reports_classes.inc
reporting/includes/tcpdf.php
sales/includes/cart_class.inc
sql/alter2.1.php
sql/alter2.2.php
sql/alter2.3.php
sql/alter2.4.php
sql/alter2.4rc1.php

index 91e13f1ab51048bea228b4af886352a068c1dab8..d16664053fcd835987e4363e9f8b5b519b97906f 100644 (file)
@@ -26,7 +26,7 @@ class fa_patch {
        var $errors = array();
        var     $max_upgrade_time = 300;
 
-       function fa_patch()
+       function __construct()
        {
                global $path_to_root;
 
index 81bf2e10ee262e6beb59a465c2a4d16b1dfa8869..c9f8e943a791e4ddc6113209aeed3e471903b1bf 100644 (file)
@@ -24,7 +24,7 @@ define('MENU_SYSTEM', 'menu_system');
                var $label;
                var $link;
                
-               function menu_item($label, $link) 
+               function __construct($label, $link) 
                {
                        $this->label = $label;
                        $this->link = $link;
@@ -36,7 +36,7 @@ define('MENU_SYSTEM', 'menu_system');
                var $title;
                var $items;
                
-               function menu($title) 
+               function __construct($title) 
                {
                        $this->title = $title;
                        $this->items = array();
@@ -58,7 +58,7 @@ define('MENU_SYSTEM', 'menu_system');
                var $access;
         var $category;
                
-               function app_function($label,$link,$access='SA_OPEN',$category='')
+               function __construct($label,$link,$access='SA_OPEN',$category='')
                {
                        $this->label = $label;
                        $this->link = $link;
@@ -74,7 +74,7 @@ define('MENU_SYSTEM', 'menu_system');
                var $lappfunctions;
                var $rappfunctions;
                
-               function module($name,$icon = null) 
+               function __construct($name,$icon = null) 
                {
                        $this->name = $name;
                        $this->icon = $icon;
@@ -107,7 +107,7 @@ define('MENU_SYSTEM', 'menu_system');
                var $modules;
                var $enabled;
                
-               function application($id, $name, $enabled=true) 
+               function __construct($id, $name, $enabled=true) 
                {
                        $this->id = $id;
                        $this->name = $name;
index 0e6a2c908b958c3ac664fdae1055d37802cab391..e7453d86bc0418d49f46d40210c56502fbc63814 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class customers_app extends application 
 {
-       function customers_app() 
+       function __construct() 
        {
-               $this->application("orders", _($this->help_context = "&Sales"));
+               parent::__construct("orders", _($this->help_context = "&Sales"));
        
                $this->add_module(_("Transactions"));
                $this->add_lapp_function(0, _("Sales &Quotation Entry"),
index 52fb9f7e0cddc0902a020353585ec6a8556a4047..605710d7362c9fa91319d59784ef57669558aeb8 100644 (file)
 ***********************************************************************/
 class dimensions_app extends application
 {
-       function dimensions_app()
+       function __construct()
        {
                $dim = get_company_pref('use_dimension');
-               $this->application("proj", _($this->help_context = "&Dimensions"), $dim);
+               parent::__construct("proj", _($this->help_context = "&Dimensions"), $dim);
 
                if ($dim > 0)
                {
index 3967c06a6e4f6981cc9ab0bf4e4e3f1ae488db74..8a3bb86dcb6e22c16b3adff79cb40a225ee4d0a2 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class assets_app extends application
 {
-       function assets_app()
+       function __construct()
        {
-               $this->application("assets", _($this->help_context = "&Fixed Assets"));
+               parent::__construct("assets", _($this->help_context = "&Fixed Assets"));
                        
                $this->add_module(_("Transactions"));
                $this->add_lapp_function(0, _("Fixed Assets &Purchase"),
index 21d48b35e4535ad7ffeba22e7799f3b2767c58d5..f81f04e04a4423cb77d1557d0a3f50b2302a0952 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class general_ledger_app extends application
 {
-       function general_ledger_app()
+       function __construct()
        {
-               $this->application("GL", _($this->help_context = "&Banking and General Ledger"));
+               parent::__construct("GL", _($this->help_context = "&Banking and General Ledger"));
 
                $this->add_module(_("Transactions"));
                $this->add_lapp_function(0, _("&Payments"),
index 965109b64b735040aa97520e4d0bcaae74261b34..e1c941f61f8adb9fd5fc4823b4e8449d30602b6b 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class inventory_app extends application
 {
-       function inventory_app()
+       function __construct()
        {
-               $this->application("stock", _($this->help_context = "&Items and Inventory"));
+               parent::__construct("stock", _($this->help_context = "&Items and Inventory"));
 
                $this->add_module(_("Transactions"));
                $this->add_lapp_function(0, _("Inventory Location &Transfers"),
index 9a7c393bed79cf3bc452cad85339ddaea4efa024..44b5e630e6ff30c2d82b40f4c3c150639fd74a5d 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class manufacturing_app extends application
 {
-       function manufacturing_app()
+       function __construct()
        {
-               $this->application("manuf", _($this->help_context = "&Manufacturing"));
+               parent::__construct("manuf", _($this->help_context = "&Manufacturing"));
 
                $this->add_module(_("Transactions"));
                $this->add_lapp_function(0, _("Work &Order Entry"),
index 99fa48d52b9278a59808eeec49d96d28039274ec..5f29aff11f8cac3a00e861c1972a800e67525857 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class setup_app extends application
 {
-       function setup_app()
+       function __construct()
        {
-               $this->application("system", _($this->help_context = "S&etup"));
+               parent::__construct("system", _($this->help_context = "S&etup"));
 
                $this->add_module(_("Company Setup"));
                $this->add_lapp_function(0, _("&Company Setup"),
index 56b702194f060110f9d3edcc02b040ba0ab217bf..5c649e484320a52462e9891fee916b76ff782b5f 100644 (file)
@@ -11,9 +11,9 @@
 ***********************************************************************/
 class suppliers_app extends application 
 {
-       function suppliers_app() 
+       function __construct() 
        {
-               $this->application("AP", _($this->help_context = "&Purchases"));
+               parent::__construct("AP", _($this->help_context = "&Purchases"));
 
                $this->add_module(_("Transactions"));
                $this->add_lapp_function(0, _("Purchase &Order Entry"),
index ec21ddb94984aa69cac1e34a5d611e592d3dd350..a7432037aba8eb77f494bd1a9294d13be90a4bb3 100644 (file)
@@ -31,9 +31,6 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
 
                var $menu;
 
-               function front_accounting()
-               {
-               }
                function add_application($app)
                {       
                        if ($app->enabled) // skip inactive modules
index f71c0ed236075c0bd5a53cf1e3f145718d3f1fcf..7eb712dd7c79cf530ecd645ccce18f5507d39d8d 100644 (file)
@@ -63,7 +63,7 @@ class JsHttpRequest
      * If an object is created WITHOUT an active AJAX query, it is simply marked as
      * non-active. Use statuc method isActive() to check.
      */
-    function JsHttpRequest($enc)
+    function __construct($enc)
     {
         global $JsHttpRequest_Active;
         
index 220c008432f86311e84f0216cb44bb01b72a244a..a89b55876f83eb355257f2bed324b54ad1452959 100644 (file)
@@ -16,9 +16,9 @@ class Ajax extends JsHttpRequest {
        var $aCommands = array();
        var $triggers = array();
        
-    function Ajax() 
+    function __construct() 
     {
-         $this->JsHttpRequest(@$_SESSION['language']->encoding);
+         parent::__construct(@$_SESSION['language']->encoding);
     }
        //
        //      This function is used in ctrl routines to activate
index 413e33081d30913f97136d45c4eb22835baa7b1d..b1a81001eb1d5fe10c51d01f4fcf79aa99356071 100644 (file)
@@ -16,7 +16,7 @@
 
 class archive
 {
-       function archive($name)
+       function __construct($name)
        {
                $this->options = array (
                        'basedir' => ".",
@@ -238,9 +238,9 @@ class archive
 
 class tar_file extends archive
 {
-       function tar_file($name)
+       function __construct($name)
        {
-               $this->archive($name);
+               parent::__construct($name);
                $this->options['type'] = "tar";
        }
 
@@ -428,9 +428,9 @@ class tar_file extends archive
 
 class gzip_file extends tar_file
 {
-       function gzip_file($name)
+       function __construct($name)
        {
-               $this->tar_file($name);
+               parent::__construct($name);
                $this->options['type'] = "gzip";
        }
 
index 431cfefe2546cd90dbc56968a16578f4898208ea..e6f051885848068c5abe02ef574776594dbff276 100644 (file)
@@ -36,7 +36,7 @@ class current_user
        var $prefs;
        var $cur_con; // current db connection (can be different from $company for superuser)
 
-       function current_user()
+       function __construct()
        {
                global $def_coy;
                
@@ -305,6 +305,8 @@ function number_format2($number, $decimals=0)
        $tsep = $SysPrefs->thoseps[user_tho_sep()];
        $dsep = $SysPrefs->decseps[user_dec_sep()];
 
+       if ($number == '')
+               $number = 0;
        if($decimals==='max')
                $dec = 15 - floor(log10(abs($number)));
        else {
@@ -511,7 +513,7 @@ function user_date_sep()
 {
        global $SysPrefs;
 
-       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->date_sep() : $SysPrefs->dflt_date_sep;
+       return isset($_SESSION["wa_current_user"]->prefs->date_sep) ? $_SESSION["wa_current_user"]->prefs->date_sep() : $SysPrefs->dflt_date_sep;
 }
 
 function user_tho_sep()
index f536e13c113a035c49888852ec497cc345f309ad..93846d0dd1fe4d65eeab9ce46aff34c96d2ae640 100644 (file)
@@ -37,7 +37,7 @@ abstract class record_set {
                $this->errors = array();
        }
 
-       function record_set($name, $fields, $key, $subset=null)
+       function __construct($name, $fields, $key, $subset=null)
        {
                $this->name = $name;
                $this->fields = $fields;
@@ -253,9 +253,9 @@ abstract class record_set {
 
 class data_set extends record_set {
 
-       function data_set($name, $fields, $key, $subset=null)
+       function __construct($name, $fields, $key, $subset=null)
        {
-               $this->record_set($name, $fields, $key, $subset);
+               parent::__construct($name, $fields, $key, $subset);
        }
 
        //
@@ -417,11 +417,11 @@ class array_set extends record_set {
 
        var $object_class;      // name of record object class or null for arrays
 
-       function array_set($name, $fields, $key=null, &$arr=array(), $class = null)
+       function __construct($name, $fields, $key=null, &$arr=array(), $class = null)
        {
                $this->array = &$arr;
                $this->object_class = $class;
-               $this->record_set($name, $fields, $key);
+               parent::__construct($name, $fields, $key);
        }
 
        //===========================================================================
index 47976504a550f29cbbaa7f5db4f4bf7993221d5c..f67aa60ac62fca8ede2c2c4bf842a90d3bbdca91 100644 (file)
@@ -17,13 +17,13 @@ include_once 'class.data_set.inc';
 **/
 
 class reflines_db extends data_set {
-       function reflines_db()
+       function __construct()
        {
                $this->set_validator('prefix:ui:_check_prefix', _("This prefix conflicts with another one already defined. Prefix have to be unambigous."));
                $this->set_validator('prefix:ui:_check_template', _("Invalid template format."));
                $this->set_validator('trans_type:ui:required', _("Transaction type cannot be empty."));
                $this->set_validator('pattern:ui:required', _("Next reference cannot be empty."));
-               $this->data_set('reflines', 
+               parent::__construct('reflines', 
                        array('trans_type', 'prefix', 'description', 'default', 'pattern', 'id', 'inactive'), 
                        'id');
        }
index 416773acb85dd6989aa74a94d4593804b73bbafa..daaa2e8e47116003ef6e173bbe3289c57ffd141d 100644 (file)
@@ -65,7 +65,7 @@ class db_pager {
        //      array('select' => 'SUM(quantity)', 'from' => TB_PREF."stock_moves", 'group' => 'location')
        //
        //      $name is base name for pager controls
-       function db_pager($sql, $name, $table = null, $page_len=0) 
+       function __construct($sql, $name, $table = null, $page_len=0) 
        {
                $this->width = "95%";
                if ($page_len == 0) $page_len = user_query_size();
index c5414d60b92b26aca3d27fa8b641a5b7c2fd7421..53587df6ed081b1489e162d77898d474e48f3ed6 100644 (file)
@@ -21,7 +21,8 @@ function get_backtrace($html = false, $skip=0)
        foreach($trace as $trn => $tr) {
                if ($trn <= $skip) continue;
                if ($html) $str .= '<tr><td>';
-               $str .= $tr['file'].':'.$tr['line'].': ';
+               if (isset($tr['file']) && isset($tr['line']))
+                       $str .= $tr['file'].':'.$tr['line'].': ';
                if ($html) $str .= '</td><td>';
                if (isset($tr['type'])) {
                        if($tr['type'] == '::') {
@@ -32,7 +33,7 @@ function get_backtrace($html = false, $skip=0)
                }
                $str .= $tr['function'].'(';
                
-               if(is_array($tr['args'])) {
+               if(isset($tr['args']) && is_array($tr['args'])) {
                        $args = array();
                        foreach($tr['args'] as $n=>$a) {
                                if (is_object($tr['args'][$n]))
@@ -87,6 +88,13 @@ function error_handler($errno, $errstr, $file, $line) {
        
     return true;
 }
+
+function exception_handler($exception)
+{
+       error_handler(E_ERROR, sprintf(_("Unhandled exception [%s]: %s."), $exception->getCode(), $exception->getMessage()),
+                $exception->getFile(), $exception->getLine());
+       end_page();
+}
 //------------------------------------------------------------------------------
 //     Formats system messages before insert them into message <div>
 // FIX center is unused now
index 1609cdc5db5b905bcc99b5de87e5fe4985922d44..fd3762c0c65e87b8d8438b72d9d479cd038d8043 100644 (file)
@@ -25,7 +25,7 @@ class language
        var $version; // lang package version
        var $is_locale_file;
        
-       function language($name, $code, $encoding, $dir = 'ltr') 
+       function __construct($name, $code, $encoding, $dir = 'ltr') 
        {
                global $dflt_lang;
                
index 2e1b92e3445d91c9ca3fa90dd8b4159736371a1b..c3aa518cd3de40f0d305c77eb1a3a5248f74751e 100644 (file)
@@ -19,7 +19,8 @@ define('PUBKEY_PATH', $path_to_root);
 // FrontAccounting package class
 //
 class package extends gzip_file {
-       function package($filename, $basedir=null)
+
+       function __construct($filename, $basedir=null)
        {
                global $path_to_root;
 
@@ -30,7 +31,7 @@ class package extends gzip_file {
                        } else
                        mkdir($basedir);
                }
-               $this->archive($filename);
+               parent::__construct($filename);
                $this->set_options(array('basedir'=> $basedir));
                $this->options['type'] = "pkg";
        }
index cce4769c563fcf3cfc80a58a65090ffe24e8af69..34e52bccb706a0d7355096ab7a288c87efbf31fe 100644 (file)
@@ -21,7 +21,7 @@ class sys_prefs
        var $prefs;
        var $db_ok; // check whether database has been upgraded after src update.
 
-       function sys_prefs()
+       function __construct()
        {
                global $path_to_root;
 
index 0f3684776a92d622a34befb0d4d18a6ece56f07a..863dc1fab05f8a74a8583aef68e9e4a8ddba3bf6 100644 (file)
@@ -41,7 +41,7 @@ class user_prefs
        var $def_print_destination; // default print destination. 0 = PDF/Printer, 1 = Excel
        var $def_print_orientation; // default print orientation. 0 = Portrait. 1 = Landscape
 
-       function user_prefs($user=null)
+       function __construct($user=null)
        {
                if ($user == null) { 
                        // set default values, used before login
index ff65fa387f25fa6533f1499109169b813fea7e70..7a919f27d43720094bf9ac746d90d74ad9e9ed46 100644 (file)
@@ -70,7 +70,7 @@ class references
 {
        var $reflines;
        
-       function references()
+       function __construct()
        {
                $this->reflines = new reflines_db();
        }
index 3ec67df1be0134276def5c0b1ad0f0539f5478a0..bba6496fddd1dc6a861c9db4b149cf63aabe734b 100644 (file)
@@ -372,6 +372,7 @@ if (isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
 include_once($path_to_root . "/includes/errors.inc");
 // colect all error msgs
 set_error_handler('error_handler' /*, errtypes */);
+set_exception_handler('exception_handler');
 
 include_once($path_to_root . "/includes/current_user.inc");
 include_once($path_to_root . "/frontaccounting.php");
index f51046b064aaf2b4fe3b4c497f14f805224c0f71..b45110b35ade07d366eb4a8622f81e7d9b93ee0f 100644 (file)
@@ -30,7 +30,7 @@ class allocation
 
        var $allocs; /*array of transactions allocated to */
 
-       function allocation($type, $trans_no, $person_id = null, $person_type_id=null)
+       function __construct($type, $trans_no, $person_id = null, $person_type_id=null)
        {
                $this->allocs = array();
                
@@ -254,7 +254,7 @@ class allocation_item
        
        var $current_allocated;
        
-       function allocation_item ($type, $type_no, $date_, $due_date, $amount, 
+       function __construct($type, $type_no, $date_, $due_date, $amount, 
                $amount_allocated, $current_allocated, $ref)
        {
 
index 8572fdbe867d6f3c527cc3fcb330b0e2e4763d48..dd3ffb54bcd8e9d640ed63aa1636b8d55fcae5ec 100644 (file)
@@ -43,7 +43,7 @@ class user_view {
        var $dec;
        var $name;
 
-       function user_view($name)
+       function __construct($name)
        {
                $this->name = $name;
        }
@@ -269,9 +269,9 @@ class simple_crud_view extends user_view {
        var $display_both = false; //when set to true both list and editor are displayed all the time (eventually set in sub classes)
        //
        //
-       function simple_crud_view($name, $data_set = null, $options=array())
+       function __construct($name, $data_set = null, $options=array())
        {
-               $this->user_view($name);
+               parent::__construct($name);
 
                $this->options = array_merge($this->options, $options);
 
@@ -596,10 +596,10 @@ class simple_crud_view extends user_view {
 
 class selector_crud_view extends simple_crud_view {
 
-       function selector_crud_view($name, $data_set = null, $options=array())
+       function __construct($name, $data_set = null, $options=array())
        {
                $this->display_both = true;
-               $this->simple_crud_view($name, $data_set, $options);
+               parent::__construct($name, $data_set, $options);
        }
 
        function _check_mode()
@@ -650,10 +650,10 @@ class table_crud_view extends simple_crud_view {
 
        var $title;
 
-       function table_crud_view($name, &$data_set = null, $options=array())
+       function __construct($name, &$data_set = null, $options=array())
        {
                $this->display_both = true;
-               $this->simple_crud_view($name, $data_set, $options);
+               parent::__construct($name, $data_set, $options);
        }
        /**
        *
index 70403f62543736d0f2e9d9251e14ffc349698743..60226fe2ed9015d9b88b0650062817799b76ea1f 100644 (file)
@@ -14,9 +14,9 @@ include_once $path_to_root.'/includes/ui/class.crud_view.inc';
 
 class fa_reflines extends simple_crud_view {
 
-       function fa_reflines()
+       function __construct()
        {
-               $this->simple_crud_view('refs', new reflines_db(), array('clone' => false));
+               parent::__construct('refs', new reflines_db(), array('clone' => false));
 
                $this->fields = array(
                        'prefix',
index d27b8faa06bf996284397ea5b4168e2d65ac2ca0..8ad1496a439483dba84e7f3df20267265473cc1c 100644 (file)
@@ -21,11 +21,11 @@ class contacts extends simple_crud {
        var $sub_class;
        var $class;
        
-       function contacts($name, $id, $class, $subclass=null) {
+       function __construct($name, $id, $class, $subclass=null) {
                $fields = array('ref','name','name2','address', 'phone', 'phone2','fax',
                        'email','lang','notes', 'assgn' =>array('fld'=>'contacts'));
 
-               $this->simple_crud($name, $fields);
+               parent::__construct($name, $fields);
                $this->class = $class;
                $this->subclass = $subclass;
                $this->entity = $id;
index 7a19d23508e508c4d4e857b9d948461312848ab9..bb473fe7e581296317a37b4a516fa02b1c954d90 100644 (file)
@@ -40,7 +40,7 @@ class items_cart
 
        var $fixed_asset;
 
-       function items_cart($type, $trans_no=0)
+       function __construct($type, $trans_no=0)
        {
                $this->trans_type = $type;
                $this->order_id = $trans_no;
@@ -465,7 +465,7 @@ class line_item
        var $price;
        var $standard_cost;
 
-       function line_item ($stock_id, $qty, $standard_cost=null, $description=null)
+       function __construct($stock_id, $qty, $standard_cost=null, $description=null)
        {
                $item_row = get_item($stock_id);
 
@@ -509,7 +509,7 @@ class gl_item
        var $branch_id;
        var $date;
 
-       function gl_item($code_id=null, $dimension_id=0, $dimension2_id=0, $amount=0, $memo='',
+       function __construct($code_id=null, $dimension_id=0, $dimension2_id=0, $amount=0, $memo='',
                $act_descr=null, $person_id=null, $date=null)
        {
                //echo "adding $index, $code_id, $dimension_id, $amount, $reference<br>";
index 05d9280135e9e57a67509edc11475da0a0d5b5bc..40c8ebea6b29b5653b2a746284015329473dee33 100644 (file)
@@ -26,7 +26,7 @@ class simple_crud {
        var $dec;
        //
        //
-       function simple_crud($name, $fields = null)
+       function __construct($name, $fields = null)
        {
                $this->name = $name;
                $this->pre_handlers = array(
index b197cb0369b1d27d3c31e81f79ead7dfa743c957..c24119d2b9d26bd226e7c149a83a468cfbfb4db5 100644 (file)
@@ -47,7 +47,7 @@ class purch_order
 
        var $fixed_asset = false;
 
-       function purch_order()
+       function __construct()
        {
                /*Constructor function initialises a new purchase order object */
                $this->line_items = array();
@@ -216,7 +216,7 @@ class po_line_details
        var $standard_cost;
        var $descr_editable;
 
-       function po_line_details($line_no, $stock_item, $item_descr, $qty, $prc, $uom, $req_del_date, 
+       function __construct($line_no, $stock_item, $item_descr, $qty, $prc, $uom, $req_del_date, 
                $qty_inv, $qty_recd, $grn_item_id=0)
        {
 
index 00226d9fc5d2c078c67c19c296518853dd822c61..8a70e41488f47b4565511838be523cf5f42c8fe4 100644 (file)
@@ -49,7 +49,7 @@ class supp_trans
        var $dimension,
                $dimension2;
 
-       function supp_trans($trans_type, $trans_no=0)
+       function __construct($trans_type, $trans_no=0)
        {
                $this->trans_type = $trans_type;
                /*Constructor function initialises a new Supplier Transaction object */
@@ -230,7 +230,7 @@ all the info to do the necessary entries without looking up ie additional querie
        var $gl_code;
        var $tax_included;
 
-       function grn_item ($id, $po_detail_item, $item_code, $item_description, $qty_recd, 
+       function __construct($id, $po_detail_item, $item_code, $item_description, $qty_recd, 
                $prev_quantity_inv, $this_quantity_inv, $order_price, $chg_price,
                $std_cost_unit, $gl_code, $tax_included)
        {
@@ -274,7 +274,7 @@ class gl_codes
        var $amount;
        var $memo_;
 
-       function gl_codes ($Counter, $gl_code, $gl_act_name, $gl_dim, $gl_dim2, $amount, $memo_)
+       function __construct($Counter, $gl_code, $gl_act_name, $gl_dim, $gl_dim2, $amount, $memo_)
        {
 
        /* Constructor function to add a new gl_codes object with passed params */
index 30a716cbc41894863ed1fe91be8aa5e8be1555a6..7e64a1b3a1320beb6358fe9fa8f0c2b10ddb52b4 100644 (file)
@@ -178,7 +178,7 @@ class ole_pps
     # _new (OLE::Storage_Lite::PPS)
     #   for OLE::Storage_Lite
     #------------------------------------------------------------------------------
-    function ole_pps($iNo, $sNm, $iType, $iPrev, $iNext, $iDir,
+    function __construct($iNo, $sNm, $iType, $iPrev, $iNext, $iDir,
                      $raTime1st, $raTime2nd, $iStart, $iSize,
                      $sData=false, $raChild=false) 
     {
@@ -315,7 +315,7 @@ class ole_pps
 
 class ole_pps_file extends ole_pps 
 {
-    function ole_pps_file($sNm, $sData=false, $sFile=false) 
+    function __construct($sNm, $sData=false, $sFile=false) 
     {
         $this->No         = false;
         $this->Name       = $sNm;
@@ -366,7 +366,7 @@ class ole_pps_file extends ole_pps
 
 class ole_pps_root extends ole_pps 
 {
-    function ole_pps_root($raTime1st=false, $raTime2nd=false, $raChild=false) 
+    function __construct($raTime1st=false, $raTime2nd=false, $raChild=false) 
     {
         $this->No         = false;
         $this->Name       = Asc2Ucs('Root Entry');
@@ -948,7 +948,7 @@ class Spreadsheet_Excel_Writer_BIFFwriter
     *
     * @access public
     */
-    function Spreadsheet_Excel_Writer_BIFFwriter()
+    function __construct()
     {
         $this->_byte_order = '';
         $this->_data       = '';
@@ -1136,7 +1136,7 @@ class Spreadsheet_Excel_Writer_Validator
     */
     var $_parser;
 
-    function Spreadsheet_Excel_Writer_Validator(&$parser)
+    function __construct(&$parser)
     {
         $this->_parser       = $parser;
         $this->_type         = 0x01; // FIXME: add method for setting datatype
@@ -1469,7 +1469,7 @@ class Spreadsheet_Excel_Writer_Format
     * @param integer $index the XF index for the format.
     * @param array   $properties array with properties to be set on initialization.
     */
-    function Spreadsheet_Excel_Writer_Format($BIFF_version, $index = 0, $properties =  array())
+    function __construct($BIFF_version, $index = 0, $properties =  array())
     {
         $this->_xf_index       = $index;
         $this->_BIFF_version   = $BIFF_version;
@@ -2387,7 +2387,7 @@ class Spreadsheet_Excel_Writer_Parser
     * @param integer $byte_order The byte order (Little endian or Big endian) of the architecture
                                  (optional). 1 => big endian, 0 (default) little endian.
     */
-    function Spreadsheet_Excel_Writer_Parser($byte_order, $biff_version)
+    function __construct($byte_order, $biff_version)
     {
         $this->_current_char  = 0;
         $this->_BIFF_version  = $biff_version;
@@ -4143,14 +4143,14 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
     * @param mixed   &$parser      The formula parser created for the Workbook
     * @access private
     */
-    function Spreadsheet_Excel_Writer_Worksheet($BIFF_version, $name,
+    function                                   __construct($BIFF_version, $name,
                                                 $index, &$activesheet,
                                                 &$firstsheet, &$str_total,
                                                 &$str_unique, &$str_table,
                                                 &$url_format, &$parser)
     {
         // It needs to call its parent's constructor explicitly
-        $this->Spreadsheet_Excel_Writer_BIFFwriter();
+        parent::__construct();
         $this->_BIFF_version   = $BIFF_version;
         $rowmax                = 65536; // 16384 in Excel 5
         $colmax                = 256;
@@ -7412,10 +7412,10 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri
     * @param string filename for storing the workbook. "-" for writing to stdout.
     * @access public
     */
-    function Spreadsheet_Excel_Writer_Workbook($filename)
+    function __construct($filename)
     {
         // It needs to call its parent's constructor explicitly
-        $this->Spreadsheet_Excel_Writer_BIFFwriter();
+        parent::__construct();
 
         $this->_filename         = $filename;
         $this->_parser           = new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
index 4454ec997255512af2d5883215f324b7b79f3e7a..03ee468e215f9398a5fccc47ef78733083c165ed 100644 (file)
@@ -81,7 +81,7 @@ class TCPDFBarcode {
         * @param string $code code to print
         * @param string $type type of barcode: <ul><li>C39 : CODE 39</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED with checksum</li><li>I25 : Interleaved 2 of 5</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>POSTNET : POSTNET</li><li>CODABAR : CODABAR</li></ul>
         */
-       function TCPDFBarcode($code, $type) {
+       function __construct($code, $type) {
                $this->setBarcode($code, $type);
        }
        
index da537dd5caa00b8ea00a854ed37c0f265c39718f..81e93d25e6eab66374455f2c8b040103902f1b6a 100644 (file)
@@ -149,7 +149,7 @@ class graph
        var $fontfile = "";
        var $encoding;
        
-    function graph()
+    function __construct()
     {
        global $SysPrefs;
                $this->encoding = strtoupper($_SESSION['language']->encoding);
index e40ffe8d0dbae3c503c5ca71c664b3aa96a6ad78..16cc81c368f7a7b0a69894e10a1a14e77cc554d3 100644 (file)
@@ -41,7 +41,7 @@ class email
        var $charset = 'ISO-8859-1';
        var $add_params;
        
-    function email($name, $mail)
+    function __construct($name, $mail)
     {
         $this->boundary = md5(uniqid(time()));
                $this->header = "From: $name <$mail>\n";
index 172c328a9896c547e712239b9bccaa93efe297d7..ab76ab46ed20fb3311ef59e971682608a97b64ae 100644 (file)
@@ -63,9 +63,9 @@ include_once (dirname(__FILE__).'/fpdi/fpdi.php');
 
 class Cpdf extends FPDI {
 
-       function Cpdf($pageSize='A4', $lang=null, $pageOrientation='P')
+       function __construct($pageSize='A4', $lang=null, $pageOrientation='P')
        {
-               $this->TCPDF($pageOrientation, 'pt', $pageSize);//, $uni, $enc);
+               parent::__construct($pageOrientation, 'pt', $pageSize);//, $uni, $enc);
                $this->SetLang($lang);
                $this->setPrintHeader(false);
                $this->setPrintFooter(false);
index 3786a91aaf9d92bcba4522a2096473deac9dc390..483d0fde157170d2d66fd99dc390d856908f6a83 100644 (file)
@@ -60,7 +60,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
        
        var $sheet;
 
-       function FrontReport($title, $filename, $size = 'A4', $fontsize = 9, $orientation = 'P', $margins = NULL, $excelColWidthFactor = 6.5)
+       function __construct($title, $filename, $size = 'A4', $fontsize = 9, $orientation = 'P', $margins = NULL, $excelColWidthFactor = 6.5)
        {
                global $SysPrefs, $page_security;
 
@@ -84,7 +84,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
                $this->filename = $filename.".xls";
                $this->unique_name = random_id().".xls";
                $this->path = company_path(). '/pdf_files';
-               $this->Spreadsheet_Excel_Writer_Workbook($this->path."/".$this->unique_name);
+               parent::__construct($this->path."/".$this->unique_name);
                if ($this->code != "iso-8859-1")
                        $this->setVersion(8); // set biff version to 8 (0x0006 internal)
                $this->sheet = $this->addWorksheet($this->worksheetNameGenerator($this->title));
index 1f9492c143e45f8859f6c0a0dd5696405523f73a..48be3ca6bb06f22fe5ac917bef2fc70df70a88c2 100644 (file)
@@ -28,7 +28,7 @@ if (!defined("ORD_tilde"))
 
 class ASCII85Decode {
 
-    function ASCII85Decode(&$fpdi) {
+    function __construct(&$fpdi) {
         $this->fpdi =& $fpdi;
     }
 
index 59d1b487f8b767915fc69f599a3cc70c4e182be9..027cde862922158a1017cd76d4704b4b42300a01 100644 (file)
@@ -29,7 +29,7 @@ class LZWDecode {
     var $nextBits = 0;
     var $andTable = array(511, 1023, 2047, 4095);
 
-    function LZWDecode(&$fpdi) {
+    function __construct(&$fpdi) {
         $this->fpdi =& $fpdi;
     }
 
index 8d9288e453c35358199466126969f9d5f78341e7..a23302ff9ad901e146a110095ab942765a8f71af 100644 (file)
@@ -66,11 +66,11 @@ class fpdi_pdf_parser extends pdf_parser {
      * @param string $filename  Source-Filename
      * @param object $fpdi      Object of type fpdi
      */
-    function fpdi_pdf_parser($filename,&$fpdi) {
+    function __construct($filename,&$fpdi) {
         $this->fpdi =& $fpdi;
                $this->filename = $filename;
                
-        parent::pdf_parser($filename);
+        parent::__construct($filename);
 
         // resolve Pages-Dictonary
         $pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']);
index ce0b0e0c2c2d80f9bc1805792dcc1e5379e0c067..703b5aa5b577baee2d8e96e505d73fba740074f1 100644 (file)
@@ -28,7 +28,7 @@ class pdf_context {
 
        // Constructor
 
-       function pdf_context($f) {
+       function __construct($f) {
                $this->file = $f;
                $this->reset();
        }
index b47ea7ac83d21524d7c4541cd5b764aef45560e6..54e198d48ad7c3da3017f486078b71c378a6b3c3 100644 (file)
@@ -90,7 +90,7 @@ class pdf_parser {
      *
      * @param string $filename  Source-Filename
      */
-       function pdf_parser($filename) {
+       function __construct($filename) {
         $this->filename = $filename;
         
         $this->f = @fopen($this->filename, "rb");
index 65aaaf9e89b690750ca60d5eb2998ea591cfa31d..31dcdb367bc1eb584df1d8369e53eceabcb5c5a8 100644 (file)
@@ -70,7 +70,7 @@ class FrontReport extends Cpdf
        
        var $dest;      // destination: email or printer
        
-       function FrontReport($title, $filename, $size = 'A4', $fontsize = 9, $orientation = 'P', $margins = NULL, $excelColWidthFactor = NULL)
+       function __construct($title, $filename, $size = 'A4', $fontsize = 9, $orientation = 'P', $margins = NULL, $excelColWidthFactor = NULL)
        {
                global $page_security;
 
@@ -222,7 +222,7 @@ class FrontReport extends Cpdf
                $this->scaleLogoWidth = false; // if Logo, scale on width (else height).
                $this->SetHeaderType('Header'); // default
 
-               $this->Cpdf($size, $_SESSION['language']->code, $orientation);
+               parent::__construct($size, $_SESSION['language']->code, $orientation);
        }
        
        /*
index e2de66576c7ff0c0588add33806f7c3cc66aa529..ecc0542fc4e8e731b5118d2a141ea9bf53eff646 100644 (file)
@@ -14,7 +14,7 @@ class remote_printer {
        //
        //      Setting connection parameters
        //
-    function remote_printer($queue, $host='', $port=515, $timeout=20){
+    function __construct($queue, $host='', $port=515, $timeout=20){
                if ($host == '')
                        $host = $_SERVER['REMOTE_ADDR']; // default is user's host
         $this->host = $host;
index 647209f8224a99e46b92fa4c1a19964f99c4ecfb..0a67200324dd35da81983a585cc5e3e3407b18fe 100644 (file)
@@ -462,7 +462,7 @@ class Report
        var $ar_params;
        var $controls;
        
-       function Report($id, $name, $ar_params = null)
+       function __construct($id, $name, $ar_params = null)
        {
                $this->id = $id;
                $this->name = $name;
index 6e7b6f4af9f50135c536984c6dc61288685d310f..139dea600bfc788c01f7d14f9fa65c7aec02a739 100644 (file)
@@ -1112,7 +1112,7 @@ if (!class_exists('TCPDF')) {
                 * @param boolean $unicode TRUE means that the input text is unicode (default = true)
                 * @param String $encoding charset encoding; default is UTF-8
                 */
-               function TCPDF($orientation='P', $unit='mm', $format='A4', $uni=true, $encoding="UTF-8") {
+               function __construct($orientation='P', $unit='mm', $format='A4', $uni=true, $encoding="UTF-8") {
                        if ($uni) // Fix for FrontAccounting
                        {
                                global $unicode, $unicode_mirror, $unicode_arlet, $laa_array, $diacritics;
index 13f383bfb8b70ff3e43634c7c25612bc475bb34c..7d68e2a4622fc60cfccf6bee5298556fd1c079b5 100644 (file)
@@ -90,7 +90,7 @@ class Cart
        //  $trans_no!=0 && $prepare_child==true => prepare for child doc entry
        //      $prepare_child is set to ST_SALESINVOICE for prepayment invoices
        //
-       function Cart($type, $trans_no=0, $prepare_child=false) {
+       function __construct($type, $trans_no=0, $prepare_child=false) {
                /*Constructor function initialises a new shopping cart */
                $this->line_items = array();
                $this->sales_type = "";
@@ -693,7 +693,7 @@ class line_details
        var $qty_old = 0;
 
 
-       function line_details ($stock_id, $qty, $prc, $disc_percent,
+       function __construct($stock_id, $qty, $prc, $disc_percent,
                $qty_done, $standard_cost, $description, $id=0, $src_no=0, $src_id=0)
        {
        /* Constructor function to add a new LineDetail object with passed params */
index 6d2e767bf1eab3dae2ab76758bc88e8bae74f361..1dade60291f2aba2d255e3e8b4cf55e605d33ba5 100644 (file)
@@ -15,7 +15,7 @@ class fa2_1 extends fa_patch {
        var $description;
        var $sql = 'alter2.1.sql';
 
-       function fa2_1() {
+       function __construct() {
                $this->description = _('Upgrade from version 2.0 to 2.1');
        }
        //
index 837f44cefc69a52918f6da2cb6a2ecc1e287d877..db6b3aecec026d7a87d51dbffda900541030a116 100644 (file)
@@ -18,7 +18,7 @@ class fa2_2 extends fa_patch  {
        var $preconf = true;
        var $beta = false; // upgrade from 2.1 or 2.2beta; set in prepare()
        
-       function fa2_2() {
+       function __construct() {
                global $security_groups;
                $this->beta = !isset($security_groups);
                $this->description = _('Upgrade from version 2.1/2.2beta to 2.2');
index f186ff62315a077b9967c3ed97b9be6e2e49c80e..2667d15cb925d66d58a4f311fe5eeae4c2917cb1 100644 (file)
@@ -17,7 +17,7 @@ class fa2_3 extends fa_patch {
        var $preconf = true;
        var $beta = false; // upgrade from 2.2 or 2.3beta;
        
-       function fa2_3() {
+       function __construct() {
                $this->description = _('Upgrade from version 2.2 to 2.3');
        }
        
index 5e9b83db0df12f7b06370fbff92672dcc70ef776..b3ec864dc6a04da9673678ad3ddacefbabe5166b 100644 (file)
@@ -18,8 +18,8 @@ class fa2_4 extends fa_patch {
        var $preconf = true;
        var     $max_upgrade_time = 900;        // table recoding is really long process
        
-       function fa2_4() {
-               parent::fa_patch();
+       function __construct() {
+               parent::__construct();
                $this->description = _('Upgrade from version 2.3 to 2.4');
        }
        
index 93464054adc4c059be95e553be5a6cd82d01023d..66a029fbda63c6630099c92bafb5aa5d09389f38 100644 (file)
@@ -18,8 +18,8 @@ class fa2_4rc1 extends fa_patch {
        var $preconf = true;
        var     $max_upgrade_time = 900;        // table recoding is really long process
 
-       function fa2_4rc1() {
-               parent::fa_patch();
+       function __construct() {
+               parent::__construct();
                $this->description = _('Upgrade from version 2.4beta to 2.4RC1');
        }