Check All/None button work.
authorMaxime Bourget <bmx007@gmail.com>
Sun, 9 Jun 2013 10:07:44 +0000 (11:07 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sun, 9 Jun 2013 10:07:44 +0000 (11:07 +0100)
includes/order_lines.inc
item_schedule.php
order_lines_view.php

index 49a8790b26be82724a5c9846472e52af4411b5af..4473ef08d2274fc1a0b68fc2fdd34b9cc1eedbeb 100644 (file)
@@ -23,7 +23,6 @@ function extract_cell($td) {
                return $matches[1];
        }
        else {
-print_r('cacou');
                return $td;
        }
 }
@@ -185,6 +184,12 @@ $row_id = $row['id'];
 ";
 }
 
+function input_check_details($row, $dummy) {
+       $row_id = $row['id'];
+               return "
+               <input type='checkbox' class='check_detail' name='detail[$row_id][check]'>";
+}
+
 function get_order_details_extra($customer_id, $location, $item_like) {
        $sql = "SELECT sod.id
        , so.order_no
index fcf15dcf9f572a32aa6a7d2dcb13b9dc6156a0b8..608bf90ecbe0ef40537656f535b982b8da469b48 100644 (file)
@@ -142,7 +142,6 @@ tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
 <script src="js/jquery.tablednd.0.8.min.js"></script>
 <script text="text/javascript">
-       console.log('hello')
        /**  add table DnD as behavior **/
        function onDragStart (table, row) {
        console.log(table)
index 72d38fcdaca75b2d198cb54d2cad43dbd2d70c4e..dd504de106c116b1d18e53972b0bb352a6aac94d 100644 (file)
@@ -96,7 +96,8 @@ if($customer_id) {
                ,_("Hold Until") => array('fun' => 'input_hold_until_date_details', 'ord' => '')
                ,_("Require By") => array('fun' => 'input_required_date_details', 'ord' => '')
                ,_("Expiry Date") => array('fun' => 'input_expiry_date_details', 'ord' => '')
-       ,_("Comment") => array('fun' => 'input_comment_details', 'ord' => '')
+               ,_("Comment") => array('fun' => 'input_comment_details', 'ord' => '')
+               ,'<input id="checkAll" type="checkbox">' => array('fun' => 'input_check_details')
        );
 }
 else {
@@ -166,3 +167,15 @@ span.before-tooltip {
 }
 
 </style>
+<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
+<script text="text/javascript">
+
+var inserts = {
+       '#checkAll': function (e) {
+               e.onchange = function()  {
+                       $('.check_detail').prop('checked', e.checked)
+               }
+       }
+       }
+Behaviour.register(inserts);
+</script>