Date work (js + empty value)
authorMaxime Bourget <bmx007@gmail.com>
Sun, 5 May 2013 16:13:03 +0000 (17:13 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sun, 5 May 2013 16:13:03 +0000 (17:13 +0100)
includes/order_lines.inc
order_lines_view.php

index 716dd95ce21b58b8aac2c216acd6f3d2bed3befd..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);
@@ -13,8 +19,17 @@ function order_link($row)
 
 function input_date_details($row, $date) {
 $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='detail[$row_id][required_date]'>
+<input type='text' value='$date' name='$name'>
 ";
 }
 
index 18aed7cf87cb02f2597cddbefad6ff38dc82a606..bf3f88e2e552bbc69741009dc4a2d10e37dc8c4d 100644 (file)
@@ -24,6 +24,10 @@ add_access_extensions();
 $_SESSION['page_title'] = _($help_context = "Edit lines extra parameters");
 
 $js = "";
+if ($use_popup_windows)
+       $js .= get_js_open_window(900, 600);
+if ($use_date_picker)
+       $js .= get_js_date_picker();
 page($_SESSION['page_title'], false, false, "", $js);
 
 //---------------------------------------------------------------------------------------------