fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [13184]


From: Nelson Guerra
Subject: [Fmsystem-commits] [13184]
Date: Tue, 12 May 2015 21:42:50 +0000

Revision: 13184
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13184
Author:   nelson224
Date:     2015-05-12 21:42:50 +0000 (Tue, 12 May 2015)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind/property/js/portico/wo_hour.index.js

Modified: branches/dev-syncromind/property/js/portico/wo_hour.index.js
===================================================================
--- branches/dev-syncromind/property/js/portico/wo_hour.index.js        
2015-05-12 21:42:20 UTC (rev 13183)
+++ branches/dev-syncromind/property/js/portico/wo_hour.index.js        
2015-05-12 21:42:50 UTC (rev 13184)
@@ -1,4 +1,4 @@
-this.local_DrawCallback1 = function(oTable)
+this.local_DrawCallback2 = function(oTable)
 {
        var api = oTable.api();
        var data = api.ajax.json();
@@ -27,4 +27,98 @@
        $('#workorder_title').html(data.workorder_data.workorder_title);
        
        $('#vendor_name').html(data.workorder_data.vendor_name);
-};
\ No newline at end of file
+};
+
+function onSave ()
+{
+       var api = oTable0.api();
+
+       var values = {};
+
+       values['activity_id'] = {};
+       values['activity_num'] = {};
+       values['unit'] = {};
+       values['dim_d'] = {};
+       values['ns3420_id'] = {};
+       values['descr'] = {};
+       values['total_cost'] = {};
+       values['quantity'] = {};
+       values['wo_hour_cat'] = {};
+       values['cat_per_cent'] = {};
+       values['add'] = 'add';
+
+       var activity_id = $('.activity_id');
+       var activity_num = $('.activity_num');
+       var unit = $('.unit');
+       var dim_d = $('.dim_d');
+       var ns3420_id = $('.ns3420_id');
+       var descr = $('.descr');
+       var total_cost = $('.total_cost');
+       var quantity = $('.quantity');
+       var wo_hour_cat = $('.wo_hour_cat');
+       var cat_per_cent = $('.cat_per_cent');
+
+       activity_id.each(function(i, obj) {
+               values['activity_id'][$(obj).attr('counter')] = obj.value;
+       });
+
+       activity_num.each(function(i, obj) {
+               values['activity_num'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       unit.each(function(i, obj) {
+               values['unit'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       dim_d.each(function(i, obj) {
+               values['dim_d'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       ns3420_id.each(function(i, obj) {
+               values['ns3420_id'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       descr.each(function(i, obj) {
+               values['descr'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       total_cost.each(function(i, obj) {
+               values['total_cost'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       quantity.each(function(i, obj) {
+               values['quantity'][$(obj).attr('counter')] = obj.value;
+       });
+
+       wo_hour_cat.each(function(i, obj) {
+               values['wo_hour_cat'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       cat_per_cent.each(function(i, obj) {
+               values['cat_per_cent'][$(obj).attr('counter')] = obj.value;
+       });
+       
+       var requestUrl = api.ajax.url();
+
+       var data = {"values": values};
+       JqueryPortico.execute_ajax(requestUrl, function(result){
+
+               document.getElementById("message").innerHTML = '';
+
+               if (typeof(result.message) !== 'undefined')
+               {
+                       $.each(result.message, function (k, v) {
+                               document.getElementById("message").innerHTML = 
v.msg + "<br/>";
+                       });
+               }
+
+               if (typeof(result.error) !== 'undefined')
+               {
+                       $.each(result.error, function (k, v) {
+                               document.getElementById("message").innerHTML += 
v.msg + "<br/>";
+                       });
+               }
+               oTable.fnDraw();
+
+       }, data, "POST", "JSON");
+}
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]