use POST prior to GET for stock_id
[order_line_extra.git] / item_schedule.php
index fff2d21feca5fadc869133a919aa07e6d862b9ce..6fa44effc4af8a41d21b3a1021b9c2892e09dede 100644 (file)
@@ -36,16 +36,24 @@ start_form();
 start_table(TABLESTYLE_NOBORDER);
 start_row();
 
+?>GET<?php
+print_r($_GET);
+?>POST<?php
+print_r($_POST);
+
+if (!isset($_POST['stock_id'])) {
 if (isset($_GET['stock_id']))
 {
        $_POST['stock_id'] = $_GET['stock_id'];
 }
+else {
+       $_POST['stock_id'] = get_global_stock_item();
+       }
+}
 
 //if (!@$_GET['popup'])
        start_form();
 
-if (!isset($_POST['stock_id']))
-       $_POST['stock_id'] = get_global_stock_item();
 
 $stock_id = $_POST['stock_id'];
        stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
@@ -114,7 +122,14 @@ tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
        console.log('hello')
        $(document).ready(function() {
                console.log('ready')
-               $('#item_schedule table').tableDnD()
+               $('#item_schedule table').tableDnD({
+                       onDragStart: function (table, row) {
+                                       console.log(table)
+                                       console.log(row)}
+                       ,onDrop: function (table, row) {
+                                       console.log(table)
+                                       console.log(row)}
+               })
        }
        )
 </script>