From: Konrad Rosenbaum Date: Sun, 1 Jan 2012 18:04:48 +0000 (+0100) Subject: create audit date for tickets from old system X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=5b0595b9a924c4e7826f1279c807035d9ffc0a19;p=web%2Fkonrad%2Fsmoke.git create audit date for tickets from old system --- diff --git a/www/inc/db/dbupgrade.php b/www/inc/db/dbupgrade.php index 1747628..7944f77 100644 --- a/www/inc/db/dbupgrade.php +++ b/www/inc/db/dbupgrade.php @@ -285,6 +285,8 @@ class DBUpgrade //orders self::fprint("
Converting Order data...\n"); $orders=$olddb->select("order","*"); + $ordertime=array(); + $orderuser=array(); foreach($orders as $ord){ //process invoiceaddr $res=$db->select("address","addressid","customerid=".$ord["customerid"]); @@ -300,6 +302,9 @@ class DBUpgrade unset($ord["deliveryaddress"]); //create self::insert("order",$ord); + //remember + $ordertime[$ord["orderid"]]=$ord["ordertime"]; + $orderuser[$ord["orderid"]]=$ord["soldby"]; } //tickets @@ -316,6 +321,11 @@ class DBUpgrade unset($tick["reservetimeout"]); //finally insert self::insert("ticket",$tick); + //create audit data + $tick["audittime"]=$ordertime[$tick["orderid"]]; + $tick["audituname"]=$orderuser[$tick["orderid"]]; + $tick["audittransaction"]="1:create order"; + $db->insert("ticket_audit",$tick); } //vouchers