- added functionality to disable order button when no events in cart
authorpeter <peter@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 17 Nov 2007 23:34:44 +0000 (23:34 +0000)
committerpeter <peter@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 17 Nov 2007 23:34:44 +0000 (23:34 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@79 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

www/inc/cart_listing.php
www/template/de/cart.html

index bd3f9a9..149df88 100644 (file)
@@ -44,6 +44,7 @@ function createCartOverview()
                        $p->setVar("AMOUNT", $amountValue);
                }
                
+               // set submit functionality
                $p->setVar("linkDELETEROW", "index.php?mode=cart&action=deleteEvent&event=".$event->getEventId());
                $p->setVar("fieldAMOUNT", "ms_amount[]");
                
@@ -58,9 +59,12 @@ function createCartOverview()
                $tablerows .= $p->parse($cartRowTmpl);
        }
        
-       // if no tickets in cart set EMPTYROWS
+       // if no tickets in cart set EMPTYROWS and disable order button
        if (count($cart->getTickets()) == 0) {
                $tablerows = $p->getVar("EMPTYROWS");
+               $p->setVar("attribDISABLED", "disabled=\"disabled\"");
+       } else {
+               $p->setVar("attribDISABLED", "");
        }
        
        $p->setVar("TABLEROWS", $tablerows);
index 1ebce7a..624bbaa 100644 (file)
@@ -39,7 +39,7 @@
 
 <div class="ms_ButtonArea">
 <input type="submit" id="ms_button_save" name="@buttonSAVE@" value="Aktualisieren" />
-<input type="submit" id="ms_button_order" name="@buttonORDER@" value="Zur Bestellung" />
+<input type="submit" id="ms_button_order" name="@buttonORDER@" @attribDISABLED@ value="Zur Bestellung" />
 </div>
 #if:IS_HIDDEN==true
 @HIDDENAREA@