move to new autoload mechanism
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Tue, 25 May 2010 17:57:05 +0000 (17:57 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Tue, 25 May 2010 17:57:05 +0000 (17:57 +0000)
some minor fixes

git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@476 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

www/inc/classes/autoload.php
www/inc/db/autoload.php
www/inc/loader.php
www/inc/loader_nonadmin.php
www/inc/machine/autoload.php
www/inc/rendering/autoload.php
www/inc/wext/autoload.php
www/inc/wext/event.php
www/index.php

index 826fa0c..650654d 100644 (file)
 // Copyright: See README/COPYING files that come with this distribution
 //
 //
-include('./inc/classes/event.php');
-include('./inc/classes/room.php');
-include("./inc/classes/random.php");
-include("./inc/classes/order.php");
-include("./inc/classes/ticket.php");
-include("./inc/classes/voucher.php");
-include("./inc/classes/cart.php");
-include('./inc/classes/error.php');
-include('./inc/classes/language_manager.php');
-include('./inc/classes/parser.php');
-include('./inc/classes/config_manager.php');
-include('./inc/classes/customer.php');
-include('./inc/classes/websession.php');
+include_once('./inc/classes/event.php');
+include_once('./inc/classes/room.php');
+include_once("./inc/classes/random.php");
+include_once("./inc/classes/order.php");
+include_once("./inc/classes/ticket.php");
+include_once("./inc/classes/voucher.php");
+include_once("./inc/classes/cart.php");
+include_once('./inc/classes/error.php');
+include_once('./inc/classes/language_manager.php');
+include_once('./inc/classes/parser.php');
+include_once('./inc/classes/config_manager.php');
+include_once('./inc/classes/customer.php');
+include_once('./inc/classes/websession.php');
 ?>
\ No newline at end of file
index acbc856..5f60b49 100644 (file)
@@ -10,8 +10,8 @@
 // Copyright: See README/COPYING files that come with this distribution
 //
 //
-$AUTOCLASS["BarcodeTable"]='./inc/db/barcodetable.php';
-$AUTOCLASS["DBUpgrade"]='./inc/db/dbupgrade.php';
+wob_autoclass("BarcodeTable",'./inc/db/barcodetable.php');
+wob_autoclass("DBUpgrade",'./inc/db/dbupgrade.php');
 
 include('./inc/db/db_scheme.php');
 ?>
\ No newline at end of file
index 9fd54ad..00a6026 100644 (file)
@@ -1,6 +1,4 @@
 <?
-//load the linguist dummies, since we use them quite often
-include_once("inc/wbase/tr.php");
 //load WOB data
 include('./inc/wbase/autoload.php');
 include('./inc/wob/autoload.php');
@@ -11,4 +9,5 @@ include('./config.php');
 //try to connect
 $db->tryConnect();
 //move on in loader_nonadmin.php (or admin.php)
+include("./inc/machine/autoload.php");
 ?>
\ No newline at end of file
index 67a3aa8..71b3c51 100644 (file)
@@ -2,8 +2,7 @@
 //check database
 if(!$db->canUseDb())
        die("Database is not correctly configured. Giving up.");
-//load class-files
-include('./inc/classes/autoload.php');
-include("./inc/machine/autoload.php");
+//TODO: convert random into class and move to framework
+include_once('./inc/classes/random.php');
 
 ?>
\ No newline at end of file
index 8461d74..169a8cb 100644 (file)
 //
 //
 
-$AUTOCLASS["Session"]="./inc/machine/session.php";
-$AUTOCLASS["Host"]="./inc/machine/host.php";
-$AUTOCLASS["Template"]="./inc/machine/template.php";
-$AUTOCLASS["Version"]="./inc/machine/version.php";
-$AUTOCLASS["Translation"]="./inc/machine/translation.php";
-$AUTOCLASS["MachineUser"]="./inc/machine/muser.php";
+wob_autoclass("Session","./inc/machine/session.php");
+wob_autoclass("Host","./inc/machine/host.php");
+wob_autoclass("Template","./inc/machine/template.php");
+wob_autoclass("Version","./inc/machine/version.php");
+wob_autoclass("Translation","./inc/machine/translation.php");
+wob_autoclass("MachineUser","./inc/machine/muser.php");
 ?>
\ No newline at end of file
index 71172b2..3458417 100644 (file)
@@ -9,6 +9,6 @@
 // +----------------------------------------------------------------------
 //
 $d=dirname(__FILE__);
-$AUTOCLASS["EventRender"]=$d.'/event_listing.php';
+wob_autoclass("EventRender",$d.'/event_listing.php');
 
 ?>
index 4ccd728..5ecc9a8 100644 (file)
 //
 //
 
-$AUTOCLASS["WOArtist"]="inc/wext/artist.php";
-$AUTOCLASS["WOCartOrder"]="inc/wext/cart.php";
-$AUTOCLASS["WOCustomer"]="inc/wext/customer.php";
-$AUTOCLASS["WOEventPrice"]="inc/wext/event.php";
-$AUTOCLASS["WOEvent"]="inc/wext/event.php";
-$AUTOCLASS["WOFlag"]="inc/wext/flag.php";
-$AUTOCLASS["WOOrder"]="inc/wext/order.php";
-$AUTOCLASS["WOOrderInfo"]="inc/wext/order.php";
-$AUTOCLASS["WOPriceCategory"]="inc/wext/price.php";
-$AUTOCLASS["WORole"]="inc/wext/role.php";
-$AUTOCLASS["WORoom"]="inc/wext/room.php";
-$AUTOCLASS["WOShipping"]="inc/wext/shipping.php";
-$AUTOCLASS["WOTemplate"]="inc/wext/template.php";
-$AUTOCLASS["WOTicket"]="inc/wext/ticket.php";
+wob_autoclass("WOArtist","inc/wext/artist.php");
+wob_autoclass("WOCartOrder","inc/wext/cart.php");
+wob_autoclass("WOCustomer","inc/wext/customer.php");
+wob_autoclass("WOEventPrice","inc/wext/event.php");
+wob_autoclass("WOEvent","inc/wext/event.php");
+wob_autoclass("WOFlag","inc/wext/flag.php");
+wob_autoclass("WOOrder","inc/wext/order.php");
+wob_autoclass("WOOrderInfo","inc/wext/order.php");
+wob_autoclass("WOPriceCategory","inc/wext/price.php");
+wob_autoclass("WORole","inc/wext/role.php");
+wob_autoclass("WORoom","inc/wext/room.php");
+wob_autoclass("WOShipping","inc/wext/shipping.php");
+wob_autoclass("WOTemplate","inc/wext/template.php");
+wob_autoclass("WOTicket","inc/wext/ticket.php");
 
-$AUTOCLASS["MSmokeTransaction"]="inc/wext/transaction.php";
+wob_autoclass("MSmokeTransaction","inc/wext/transaction.php");
 ?>
\ No newline at end of file
index 9575af2..133a903 100644 (file)
@@ -25,7 +25,9 @@ class WOEventPrice extends WOEventPriceAbstract
        {
                global $db;
                $res=$db->select("ticket","status", "eventid=".$db->escapeInt($this->prop_eventid)." AND pricecategoryid=".$db->escapeInt($this->prop_pricecategoryid));
+//             print("!!!hallo:");var_dump($res);print($db->lastError());
                $cnt=0;
+               if($res!==false)
                foreach($res as $r)
                        if($r["status"] & WTticket::MaskBlock)
                                $cnt++;
@@ -41,6 +43,7 @@ class WOEvent extends WOEventAbstract
                global $db;
                $res=$db->select("ticket","status", "eventid=".$db->escapeInt($this->prop_id));
                $cnt=0;
+               if($res!==false)
                foreach($res as $r)
                        if($r["status"] == WTticket::Ordered || $r["status"] == WTticket::Used)
                                $cnt++;
index 1d80a91..64a63a0 100644 (file)
@@ -2,6 +2,9 @@
 //basics
 include('inc/loader.php');
 include('inc/loader_nonadmin.php');
+//load class-files; TODO: remove most of them
+include('./inc/classes/autoload.php');
+//load globals
 include('inc/global_variables.php');
 include('inc/global_functions.php');
 include("inc/rendering/autoload.php");
@@ -10,7 +13,6 @@ include("inc/rendering/autoload.php");
 include('inc/rendering/submit.php');
 
 //include display scripts
-// include('inc/rendering/event_listing.php');
 include('inc/rendering/cart_listing.php');
 include('inc/rendering/order_listing.php');