Date work (js + empty value)
[order_line_extra.git] / includes / order_lines.inc
index 0c0b09763223e4110af391060ebb63692577d911..050fa825c6a9b6828d70782b6ceb4fde114fc16e 100644 (file)
@@ -1,5 +1,11 @@
 <?php
 include_once($path_to_root."/includes/ui/ui_input.inc");
+
+function compute_input_name($row, $field) {
+       $row_id = $row['id'];
+       return "detail[$row_id][$field]";
+}
+
 function view_link($dummy, $order_no)
 {
        return  get_customer_trans_view_str(ST_SALESORDER, $order_no);
@@ -12,16 +18,31 @@ function order_link($row)
 }
 
 function input_date_details($row, $date) {
- return date_cells( null, 'name');
+$row_id = $row['id'];
+       $name = compute_input_name($row, 'required_date');
+
+$_POST[$name] = sql2date($date);
+
+       start_extract_cell();
+               date_cells (null, $name, 'title', null, 0,0,1001);
+       return end_extract_cell();
+
 
+       return "
+<input type='text' value='$date' name='$name'>
+";
 }
 
 function input_comment_details($row, $comment) {
-       return label_cell($comment); 
+$row_id = $row['id'];
+       return "
+<input type='text' value='$comment' name='detail[$row_id][comment]'>
+";
 }
 
 function get_order_details_extra($customer_id) {
-       $sql = "SELECT so.order_no
+       $sql = "SELECT sod.id
+       , so.order_no
        , stk_code
        , quantity - qty_sent
        , required_date