Add tooltips with comments.
[order_line_extra.git] / order_lines_view.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $path_to_root = "../..";
13
14 include_once($path_to_root . "/includes/db_pager.inc");
15 include_once($path_to_root . "/includes/session.inc");
16 include_once($path_to_root . "/sales/includes/sales_ui.inc");
17 include_once($path_to_root . "/reporting/includes/reporting.inc");
18
19 include_once("includes/order_lines.inc");
20
21 $page_security = 'SA_ORDERLINEX_EDIT';
22 add_access_extensions();
23
24 $_SESSION['page_title'] = _($help_context = "Edit lines extra parameters");
25
26 update_extra_order_details();
27
28
29 $js = "";
30 if ($use_popup_windows)
31         $js .= get_js_open_window(900, 600);
32 if ($use_date_picker)
33         $js .= get_js_date_picker();
34 page($_SESSION['page_title'], false, false, "", $js);
35
36 //---------------------------------------------------------------------------------------------
37
38 start_form();
39
40 start_table(TABLESTYLE_NOBORDER);
41 start_row();
42
43
44 if(!isset($_POST['customer_id'])) {
45         if(isset($_GET['customer_id'])) {
46                 $customer_id = $_GET['customer_id'];
47         }
48 else $customer_id = null;
49
50 }
51 else {
52         $customer_id = $_POST['customer_id'];
53 }
54 customer_list_cells(_("Select a customer: "), 'customer_id', $customer_id, true, true);
55
56
57
58
59
60 //submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
61
62 end_row();
63
64 end_table(1);
65
66 //---------------------------------------------------------------------------------------------
67 //      Orders inquiry table
68 //
69 if($customer_id) {
70         $sql = get_order_details_extra($customer_id);
71         $cols = array(
72                 'detail_id' => 'skip'
73                 ,       _("Order #") => array('fun'=>'view_link', 'ord' => '')
74                 ,_("Item Code") => array('ord' => '')
75                 ,_("Quantity") => array('type' => 'qty')
76         ,_("Required Date") => array('fun' => 'input_date_details', 'ord' => '')
77         ,_("Comment") => array('fun' => 'input_comment_details', 'ord' => '')
78         );
79 }
80 else {
81         $sql = get_order_summary();
82         $cols = array(
83         'customer id' => 'skip',
84 _("Customer") => array('ord' => '', 'fun' => 'customer_link'),
85 _("Branch") => array('ord' => ''),
86 _("Delivery Date") => array('ord' => '', 'type' => 'date'),
87 _("Quantity") => array('ord' => ''),
88 _("Amount") => array('ord' => '', 'type' => 'amount'),
89 _("required date") => array('ord' => '', 'type' => 'date'),
90 _("Comments") => array('ord' => '', 'fun' => 'aggregate_comment'),
91 _("comment 2 ") =>  'skip'
92         );
93 }
94
95
96 $table =& new_db_pager('orders_tbl', $sql, $cols);
97
98 $table->width = "80%";
99
100 display_db_pager($table);
101
102 br(1);
103 submit_center_first('Update', _("Update"), true, '', 'default', true);
104 submit_center_last('Cancel', _("Cancel"), true, '', 'cancel', true);
105
106         end_form();
107         end_page();
108 ?>
109 <style>
110 span.tooltip{ display:none;}
111 span.tooltip {
112       position: absolute;
113       width: 200px;
114       color: rgb(113, 157, 171);
115       background: rgb(255, 255, 255);
116       border: 1px solid rgb(113, 157, 171);
117 }
118 .toto {
119       height: 20px;
120       line-height: 20px;
121       padding: 10px;
122       font-size: 14px;
123       text-align: center;
124       border: 4px solid rgb(255, 255, 255);
125       border-radius: 5px;
126       text-shadow: rgba(0, 0, 0, 0.1) 1px 1px 1px;
127       box-shadow: rgba(0, 0, 0, 0.1) 1px 1px 2px 0px;
128 }
129
130 :hover + span.tooltip, span.tooltip:hover {
131         display: inline;
132 }
133 span.before-tooltip {
134         color: #800;
135         font-style: italic;
136 }
137
138 </style>