From 0b63fb479debd4151e7937ed9d59e38c4b190d28 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Mon, 26 Jul 2021 11:47:36 +0200 Subject: [PATCH] adjustments for PHP7 Change-Id: I643fccf7e77ebf68b12c83300d1e8537d1aef5f6 --- pack | 2 +- twig | 2 +- www/inc/Twig | 2 +- www/inc/classes/basevars.php | 2 +- www/inc/classes/language_manager.php | 1 + www/inc/loader_nonadmin.php | 2 +- www/inc/rendering/cart_listing.php | 14 ++++++++++---- www/styles/style.css | 13 +++++++++---- 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/pack b/pack index 96c683c..6ebf94b 160000 --- a/pack +++ b/pack @@ -1 +1 @@ -Subproject commit 96c683cfd7117c221597e0aa6d4eba772272cba3 +Subproject commit 6ebf94b64abaadbf653c6ddebc185ce3578d0a91 diff --git a/twig b/twig index 42f758d..9ba72f1 160000 --- a/twig +++ b/twig @@ -1 +1 @@ -Subproject commit 42f758d9fe2146d1f0470604fc05ee43580873fc +Subproject commit 9ba72f1b8219eabc96f8cd5f0d300d993f52fe03 diff --git a/www/inc/Twig b/www/inc/Twig index 4de2cd0..c4e787d 120000 --- a/www/inc/Twig +++ b/www/inc/Twig @@ -1 +1 @@ -../../twig/lib/Twig \ No newline at end of file +../../twig \ No newline at end of file diff --git a/www/inc/classes/basevars.php b/www/inc/classes/basevars.php index 657b01c..76dd27a 100644 --- a/www/inc/classes/basevars.php +++ b/www/inc/classes/basevars.php @@ -17,7 +17,7 @@ static private function initTwigPriv() { Twig_Autoloader::register(); global $loader,$twig,$twigoptions,$twigextensions; - $loader = new Twig_Loader_Filesystem(LanguageManager::singleton()->templateFolders()); + $loader = new Twig\Loader\FilesystemLoader(LanguageManager::singleton()->templateFolders()); $twig = new Twig_Environment($loader, $twigoptions ); foreach($twigextensions as $te){ $t='Twig_Extension_'.$te; diff --git a/www/inc/classes/language_manager.php b/www/inc/classes/language_manager.php index 65ed82d..ee83b11 100644 --- a/www/inc/classes/language_manager.php +++ b/www/inc/classes/language_manager.php @@ -46,6 +46,7 @@ class LanguageManager private $templateFolder; private $formatcfg; private $timezone; + private $lang="C"; /** private constructor */ private function __construct($xlang=false) diff --git a/www/inc/loader_nonadmin.php b/www/inc/loader_nonadmin.php index b5f7deb..e0bf21b 100644 --- a/www/inc/loader_nonadmin.php +++ b/www/inc/loader_nonadmin.php @@ -10,7 +10,7 @@ if(!$db->canUseDb()) //TODO: convert random into class and move to framework include_once('./inc/classes/random.php'); //load external Twig library -require_once 'inc/Twig/Autoloader.php'; +require_once('inc/Twig/lib/Twig/Autoloader.php'); //load web-UI specific class-files include('inc/classes/autoload.php'); diff --git a/www/inc/rendering/cart_listing.php b/www/inc/rendering/cart_listing.php index 4134acd..1c53093 100644 --- a/www/inc/rendering/cart_listing.php +++ b/www/inc/rendering/cart_listing.php @@ -41,7 +41,7 @@ static public function addTickets() WTrWebCartAddTicket::execute($cartid,$evid,$pcid,$amount); } //go to the cart - redirectHome(array("mode"=>"cart","cartid"=>$cartid)); + redirectHome(array("mode"=>"cart",self::cartIdName=>$cartid)); } ///called from index.php - adds a voucher to the cart @@ -63,7 +63,7 @@ static public function addVoucher() // echo "adding"; WTrWebCartAddVoucher::execute($cartid,$prc); //go to the cart - redirectHome(array("mode"=>"cart","cartid"=>$cartid)); + redirectHome(array("mode"=>"cart",self::cartIdName=>$cartid)); } ///called from index.php - adds a coupon to the cart @@ -110,7 +110,7 @@ static public function removeItem() //find and remove voucher WTrWebCartRemoveVoucher::execute($cartid,$vid); } - redirectHome(array("mode"=>"cart","cartid"=>$cartid)); + redirectHome(array("mode"=>"cart",self::cartIdName=>$cartid)); } ///clean up old carts @@ -145,7 +145,13 @@ static public function getCart(){ /**returns the current cart ID, or an empty string if there is no cart, does not update*/ static protected function findCart(){ global $HTTPARGS,$_COOKIE; - if(self::$cartid!==false)return self::$cartid; + if(self::$cartid!==false){ + $res=WTcart::getFromDB(self::$cartid); + if(is_a($res,"WTcart")) + return self::$cartid; + else + self::$cartid=false; + } //search GET/POST parms if(isset($HTTPARGS[self::cartIdName])){ //found it, test it! diff --git a/www/styles/style.css b/www/styles/style.css index 43eaec8..ed4f797 100644 --- a/www/styles/style.css +++ b/www/styles/style.css @@ -1,5 +1,5 @@ /* -// (c) Konrad Rosenbaum, 2007-2011 +// (c) Konrad Rosenbaum, 2007-2021 // (c) Peter Keller, 2007/8 // protected under the GNU AGPL version 3 or at your option any newer // see COPYING.AGPL @@ -9,10 +9,15 @@ .ms_FormRow {clear:both; padding-top: 5px; padding-bottom: 5px; } .ms_FormRow label {font-weight:bold; width:150px; float:left;} -.ms_Table {border-collapse: collapse;} -.ms_Table th {padding: 7px; border: 1px solid black; text-align: center;} +.ms_Table {border-collapse: collapse; border: 1px solid black; padding: 8px;} +.ms_Table th {padding: 7px; border: 1px solid black; text-align: center; font-weight: bold; } .ms_Table td {padding: 7px; border: 1px solid black;} -.ms_Table input {text-align: right;} +.ms_Table input {text-align: left;} + +.ms_TableNB {border-collapse: collapse; border: none; padding: 8px;} +.ms_TableNB th {padding: 4px; border: none; text-align: center; font-weight: bold; } +.ms_TableNB td {padding: 4px; border: none;} +.ms_TableNB input {text-align: left;} .ms_AlignRight {text-align: right;} .ms_Bold {font-weight: bold;} -- 1.7.2.5