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 = "../..";
14 include_once($path_to_root . "/includes/session.inc");
15 include_once($path_to_root . "/includes/ui/ui_lists.inc");
16 include_once($path_to_root . "/includes/ui/ui_globals.inc");
17 include_once($path_to_root . "/includes/ui/ui_input.inc");
18 include_once($path_to_root . "/reporting/includes/reporting.inc");
20 //include_once("includes/item_scheduler.inc");
21 include_once("hincludes/lib/php/Boot.class.php");
23 $page_security = 'SA_ORDERLINEX_EDIT';
24 add_access_extensions();
26 $_SESSION['page_title'] = _($help_context = "Item schedule");
30 page($_SESSION['page_title'], false, false, "", $js);
32 //---------------------------------------------------------------------------------------------
36 start_table(TABLESTYLE_NOBORDER);
44 if (!isset($_POST['stock_id'])) {
45 if (isset($_GET['stock_id']))
47 $_POST['stock_id'] = $_GET['stock_id'];
50 $_POST['stock_id'] = get_global_stock_item();
53 if (list_updated('stock_id'))
54 $Ajax->activate('item_schedule');
56 //if (!@$_GET['popup'])
60 $stock_id = $_POST['stock_id'];
61 stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
66 $scheduler = new ItemScheduler($stock_id, 'DEF');
68 div_start('item_schedule');
69 start_table(TABLESTYLE);
70 $th = $scheduler->tableHeader();
74 $scheduler->generateTable();
80 submit_center_first('Update', _("Update"), '', 'default', false);
81 submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
88 <style type='text/css'>
93 tr.partial td:nth-child(5) {
114 border: 2px solid black;
116 tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
118 background: transparent;
121 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
122 <script src="js/jquery.tablednd.0.8.min.js"></script>
123 <script text="text/javascript">
125 /** add table DnD as behavior **/
126 function onDragStart (table, row) {
130 function onDrop(table, row) {
131 var row_ids = $.map(table.tBodies[0].rows, function(r) { return r.id} )
133 var form = $(table).closest('form')[0]
134 JsHttpRequest.request(this, form);
139 '#item_schedule table': function (e) {
140 $(e).tableDnD({onDragStart: onDragStart, onDrop: onDrop})
143 Behaviour.register(inserts);