Change current pick display (black on bold, no conditions)
authorMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 09:27:50 +0000 (10:27 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 09:27:50 +0000 (10:27 +0100)
haxe/ItemScheduler.hx
hincludes/lib/ItemScheduler.class.php
item_schedule.php

index 1ff94e04c4659c3471a9f622255a4acc33379dd0..8a92d77327300109d89aa287b0d20822f5ec37b2 100644 (file)
@@ -264,11 +264,13 @@ class ItemScheduler {
                var available = order.quantity > left ? left : order.quantity;
                var user_pick = parameters == null ? quantity : parameters.toPick(order);
                if (user_pick == null) user_pick = 0;
+                       var inputs : Array<String> = [];
                if(maxQuantity > 12) {
-                       return '<input type="text" name="'+row_id+'[to_pick]" value="'+user_pick+'">';
+                       inputs.push('<span class="picked">'+quantity+' </span>');
+                       inputs.push('<input type="text" name="'+row_id+'[to_pick]" value="'+user_pick+'" onchange=\'onPick(this);\'>');
                }
                else  {
-                       var inputs : Array<String> = ['<span class="pickable">'];
+                       inputs.push('<span class="pickable">');
                        for(q in 0...(maxQuantity+1)) {
                                var last_available = untyped __php__(' $q == $available ? true: false'); 
                                var current_pick = untyped __php__(' $q == $user_pick ? true:false');
@@ -279,7 +281,7 @@ class ItemScheduler {
                                inputs.push('<input type="radio" name="'+row_id+'[to_pick]" value="'+q+'" '+checked+' class="'+klass+'"
                                onclick=\'onPick(this);\'
                                >');
-                               inputs.push(picked && differs ? '<span class="picked">'+q+'</span>' : ''+q);
+                               inputs.push(picked ? '<span class="picked">'+q+'</span>' : ''+q);
                                inputs.push('</input>');
                                if(last_available) {
                        inputs.push('</span>');
@@ -288,8 +290,8 @@ class ItemScheduler {
                        }
                        inputs.push('</span>');
 
-                       return inputs.join(''); 
                }
+               return inputs.join(''); 
        }
 
        function formatLocation(location : Location, type: String,  left : Int) {
index 89fb78449f0faf40afeb54adaa4ab02c4ee45609..cc083f9dd86a10fe2d6bf20b9c22d5c6d79c37fb 100644 (file)
@@ -118,10 +118,12 @@ class ItemScheduler {
                if($user_pick === null) {
                        $user_pick = 0;
                }
+               $inputs = new _hx_array(array());
                if($maxQuantity > 12) {
-                       return "<input type=\"text\" name=\"" . $row_id . "[to_pick]\" value=\"" . _hx_string_rec($user_pick, "") . "\">";
+                       $inputs->push("<span class=\"picked\">" . _hx_string_rec($quantity, "") . " </span>");
+                       $inputs->push("<input type=\"text\" name=\"" . $row_id . "[to_pick]\" value=\"" . _hx_string_rec($user_pick, "") . "\" onchange='onPick(this);'>");
                } else {
-                       $inputs = new _hx_array(array("<span class=\"pickable\">"));
+                       $inputs->push("<span class=\"pickable\">");
                        {
                                $_g1 = 0; $_g = $maxQuantity + 1;
                                while($_g1 < $_g) {
@@ -143,8 +145,8 @@ class ItemScheduler {
                                }
                        }
                        $inputs->push("</span>");
-                       return $inputs->join("");
                }
+               return $inputs->join("");
        }
        public function formatOrder($order, $left, $date, $now) {
                $row_id = ItemScheduler::orderId($order);
@@ -324,7 +326,7 @@ function ItemScheduler_3(&$
        }
 }
 function ItemScheduler_4(&$»this, &$_g, &$_g1, &$available, &$checked, &$current_pick, &$differs, &$inputs, &$klass, &$last_available, &$left, &$maxQuantity, &$order, &$picked, &$q, &$quantity, &$row_id, &$user_pick) {
-       if($picked && $differs) {
+       if($picked) {
                return "<span class=\"picked\">" . _hx_string_rec($q, "") . "</span>";
        } else {
                return "" . _hx_string_rec($q, "");
index 7321c96fa9cfaafa2238f60addd8d6de09e4a9ae..9379528064e86ccda90753c40c826336a016fc24 100644 (file)
@@ -146,7 +146,7 @@ tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
 }
 
 span.picked {
-       color: darkred;
+       color: black;
        font-weight: bold;
 }