- added possibility to change cart during order process
authorpeter <peter@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sun, 9 Mar 2008 18:39:45 +0000 (18:39 +0000)
committerpeter <peter@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sun, 9 Mar 2008 18:39:45 +0000 (18:39 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@109 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

www/inc/rendering/cart_listing.php
www/inc/rendering/order_listing.php
www/inc/rendering/submit.php
www/template/de/orderoverview.html

index 56059cf..250b13c 100644 (file)
@@ -73,7 +73,11 @@ function createCartOverview()
        // set buttons
        $p->setVar("buttonSAVE", "ms_save");
        $p->setVar("buttonORDER", "ms_goToOrder");
+       
        // set hidden fields
+       if ($_GET["isOrder"] == "true")
+               $hiddenfields .= "<input type=\"hidden\" name=\"ms_isOrder\" value=\"true\" />\n";
+       
        $p->setVar("IS_HIDDEN", "true");
        $p->setVar("HIDDENAREA", $hiddenfields);
        
index d49f83e..bca8285 100644 (file)
@@ -133,14 +133,14 @@ function createOrderOverview()
                $comments = "";
                
                if (!isEmpty($shippingAddress = $cart->getShippingAddress()))
-                       $shippingAddress .= " (<a href=index.php?mode=editShippingAddress>".i18n("Change")."</a>)";
+                       $shippingAddress .= " [<a href=index.php?mode=editShippingAddress>".i18n("Change")."</a>]";
                else
-                       $shippingAddress = "(<a href=index.php?mode=editShippingAddress>".i18n("Add")."</a>)";
+                       $shippingAddress = "[<a href=index.php?mode=editShippingAddress>".i18n("Add")."</a>]";
                
                if (!isEmpty($comments = $cart->getOrderComments()))
-                       $comments .= " (<a href=index.php?mode=editOrderComments>".i18n("Change")."</a>)";
+                       $comments .= " [<a href=index.php?mode=editOrderComments>".i18n("Change")."</a>]";
                else
-                       $comments = "(<a href=index.php?mode=editOrderComments>".i18n("Add")."</a>)";
+                       $comments = "[<a href=index.php?mode=editOrderComments>".i18n("Add")."</a>]";
                
                $p->setVar("CUST_SHIPPINGADDRESS", $shippingAddress);
                $p->setVar("CUST_COMMENTS", $comments);
@@ -183,11 +183,10 @@ function createOrderOverview()
        $p->setVar("TOTALSUM", $lang->getPrice($totalsum));
        
        // set edit links
-       $p->setVar("linkEDIT_SHIPPINGADDRESS", "index.php?mode=editShippingAddress");
-       $p->setVar("linkEDIT_COMMENTS", "index.php?mode=editOrderComments");
+       $p->setVar("linkCHANGE_CART", "index.php?mode=cart&isOrder=true");
        
        // set buttons
-       
+       $p->setVar("buttonORDERTICKETS", "ms_orderTickets");    
        
        // create page
        $parser->setVAR("PAGE", $p->parseFile("orderoverview.html"));
index f1af4e8..4197abf 100644 (file)
 
 // forward to order login when order button in cart is pressed
 if (isset($_POST["ms_goToOrder"])) {
-       Header("Location: index.php?mode=orderLogin");
+       if ($_POST["ms_isOrder"] == "true")
+               Header("Location: index.php?mode=orderOverview");
+       else
+               Header("Location: index.php?mode=orderLogin");
        exit();
 }
 
@@ -271,8 +274,6 @@ function registerUser()
 /** saves the shipping address */
 function saveShippingAddress()
 {
-       $error = ErrorManager::singleton();
-
        if (isset($_POST["ms_saveShippingAddress"])) {
        
                // check if loggedin
@@ -317,4 +318,22 @@ function saveOrderComments()
                exit();
        }
 }
+
+function orderTickets()
+{
+       if (isset($_POST["ms_orderTickets"])) {
+       
+               // check if loggedin
+               $session = new WebSession();
+               if (!$session->isAuthorized()) {
+                       Header("Location: index.php");
+                       exit();
+               }
+               
+               $cart = new Cart($_COOKIE[COOKIE_CART]);
+               if ($cart->isValid()) {
+                       
+               }
+       }
+}
 ?>
\ No newline at end of file
index d8dd93e..d10a7cc 100644 (file)
@@ -30,7 +30,7 @@
 </fieldset>
 </div>
 <div id="tickets">
-<h2>Karten:</h2>
+<h2>Karten:</h2>[<a href="@linkCHANGE_CART@">&Auml;ndern</a>]
 <table class="ms_Table">
 <tr>
 <th>Veranstaltung</th>
@@ -66,7 +66,7 @@
 
 <form action="@FULLURL@" method="POST">
 <div class="ms_ButtonArea">
-<input type="submit" id="ms_button_order" name="ms_order" @attribDISABLED@ value="Jetzt bestellen!" />
+<input type="submit" id="ms_button_order" name="@buttonORDERTICKETS@" @attribDISABLED@ value="Jetzt bestellen!" />
 </div>
 </form>
 </div>
\ No newline at end of file