From 26047a9c349e7825952e0d4de61a8ab07e974d7b Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Sun, 25 Apr 2021 17:49:47 +0200 Subject: [PATCH] minor updates and fixes Change-Id: Ibe959009af5cdd530c318db88b3dc826dfbcc9f7 --- pack | 2 +- tzone | 2 +- www/inc/loader.php | 5 ++++- www/inc/rendering/event_listing.php | 7 ++++--- www/inc/wext/event.php | 28 ++++++++++++++-------------- www/inc/wext/webcart.php | 11 +++-------- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/pack b/pack index ea368b8..96c683c 160000 --- a/pack +++ b/pack @@ -1 +1 @@ -Subproject commit ea368b8d4490835ee46b1043d4b0fce403a18f01 +Subproject commit 96c683cfd7117c221597e0aa6d4eba772272cba3 diff --git a/tzone b/tzone index 6528fd2..2ba4702 160000 --- a/tzone +++ b/tzone @@ -1 +1 @@ -Subproject commit 6528fd26d09b68b51e8d2edba8e71192a71244da +Subproject commit 2ba4702b5aa2ae173387fa96a8bc33f835b3d8db diff --git a/www/inc/loader.php b/www/inc/loader.php index 2491b2a..7ca35d4 100644 --- a/www/inc/loader.php +++ b/www/inc/loader.php @@ -1,9 +1,12 @@ loadTemplate("tickets.html"); $list=$basevars; + $list['events']=array(); $trn=WTrGetAllEvents::execute(); $events = $trn->resultevents(); $now=time(); @@ -37,7 +38,7 @@ public static function createEventList() public static function createEventDetails() { global $twig,$session,$basevars; - + if (isset($_GET["event"])) { $eventID = $_GET["event"]+0; } @@ -53,7 +54,7 @@ public static function createEventDetails() // set event details $list=$basevars; $list['event']=$event; - + // create page return $p->render($list); } diff --git a/www/inc/wext/event.php b/www/inc/wext/event.php index 856dc39..a97cfa5 100644 --- a/www/inc/wext/event.php +++ b/www/inc/wext/event.php @@ -26,33 +26,33 @@ class WOEventPrice extends WOEventPriceAbstract $cnt++; return $cnt; } - + /**helper for web UI: returns the name of the field for this event price, always the configured amount field from WebCart plus an index indicating category and event IDs*/ public function getAmountinputfield() { return WebCart::TicketAmountField."[".$this->prop_pricecategoryid.":".$this->prop_eventid."]"; } - + /**helper for web UI: returns the value for HTML variables for this event price: an index indicating category and event IDs*/ public function getCategoryIdWeb() { global $basevars; return $basevars["inputnames"]["ticket"]."=".$this->prop_pricecategoryid.":".$this->prop_eventid; } - + /**helper function for web UI: returns the event ID from an amount field index */ static public function getEventIdFromAmountIndex($idx) { $sl=explode(":",$idx); - if(count($sl==2))return $sl[1]+0; + if(count($sl)==2)return $sl[1]+0; else return null; } - + /**helper function for web UI: returns the event ID from an amount field index */ static public function getCategoryIdFromAmountIndex($idx) { $sl=explode(":",$idx); - if(count($sl==2))return $sl[0]+0; + if(count($sl)==2)return $sl[0]+0; else return null; } }; @@ -94,7 +94,7 @@ class WOEvent extends WOEventAbstract //return... $trans->setevents($evlst2); } - + /**XML iface: get list of events*/ public static function getEventList($trans) { @@ -102,7 +102,7 @@ class WOEvent extends WOEventAbstract $evlst=WOEvent::fromTableArrayevent(WTevent::selectFromDB("eventid in ".$db->escapeIntList($trans->geteventids()))); $trans->setevents($evlst); } - + /**called by CreateEvent transaction*/ public static function createEvent($trans) { @@ -127,7 +127,7 @@ class WOEvent extends WOEventAbstract //return $trans->setevent(WOEvent::fromTableevent($tab)); } - + /**called by ChangeEvent transaction*/ public static function changeEvent($trans) { @@ -163,7 +163,7 @@ class WOEvent extends WOEventAbstract //return $trans->setevent(WOEvent::fromTableevent($tab)); } - + /**helper function for create/changeEvent - pushes the current list of prices to the database*/ public function syncPricesToDB() { @@ -204,7 +204,7 @@ class WOEvent extends WOEventAbstract } } } - + /**called by CancelEvent transaction*/ static public function cancelEvent($trans) { @@ -219,7 +219,7 @@ class WOEvent extends WOEventAbstract $tab->update(); WOEvent::fromTableevent($tab)->cancelAllTickets(); } - + /**helper function: cancels all usable tickets of this event*/ public function cancelAllTickets() { @@ -232,7 +232,7 @@ class WOEvent extends WOEventAbstract } } } - + /**called by the GetEventSummary transaction: returns the full event summary*/ public static function getSummary($trans) { @@ -254,7 +254,7 @@ class WOEvent extends WOEventAbstract $olst=WOOrder::fromTableArrayorder(WTorder::selectFromDB("orderid in ".$db->escapeIntList($oidl),"ORDER BY orderid")); $trans->setorders($olst); } - + /**called by the GetEntranceEvents transaction*/ public static function getEntranceEvents($trans) { diff --git a/www/inc/wext/webcart.php b/www/inc/wext/webcart.php index f2d1499..2596cec 100644 --- a/www/inc/wext/webcart.php +++ b/www/inc/wext/webcart.php @@ -13,7 +13,7 @@ class WOWebCart extends WOWebCartAbstract return count($this->prop_tickets)==0 && count($this->prop_vouchers)==0 && count($this->prop_items)==0; $prc=0; } - + /**returns the overall sum for twig*/ public function getTotalsum() { @@ -58,12 +58,10 @@ class WOWebCart extends WOWebCartAbstract $itm=WTcartticket::getFromDB($cartid,$evid,$pcid); if(is_a($itm,"WTcartticket")){ //yes: add to it -// echo "add".$amount; $itm->amount+=$amount; $itm->update(); }else{ //no: add new item -// echo "ins".$amount; $itm=WTcartticket::newRow(); $itm->cartid=$cartid; $itm->eventid=$evid; @@ -71,7 +69,6 @@ class WOWebCart extends WOWebCartAbstract $itm->amount=$amount; $itm->insert(); } -// die ("hallo"); } ///transaction to add coupon to cart @@ -104,7 +101,6 @@ class WOWebCart extends WOWebCartAbstract $cartid=$trans->getcartid(); $evid=$trans->geteventid(); $pcid=$trans->getpricecategoryid(); - error_log("hallo ".$cartid." ".$evid." ".$pcid); //get cart $cart=WOWebCart::fromTablecart(WTcart::getFromDB($cartid)); if(!is_a($cart,"WOWebCart"))return; @@ -112,11 +108,10 @@ class WOWebCart extends WOWebCartAbstract $itm=WTcartticket::getFromDB($cartid,$evid,$pcid); if(is_a($itm,"WTcartticket")){ //yes: remove it -// echo "add".$amount; $itm->deleteFromDb(); } } - + ///transaction to add vouchers static public function addVoucher($trans) { @@ -133,7 +128,7 @@ class WOWebCart extends WOWebCartAbstract $cv->value=$prc; $cv->insert(); } - + ///transaction to remove vouchers static public function removeVoucher($trans) { -- 1.7.2.5