Commit 9e5224dc authored by Jérome Perrin's avatar Jérome Perrin

rename spreadsheet -> wip_spreadsheet in stored json

parent 0cb51353
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
// find the corresponding input // find the corresponding input
var data = that.getData(), var data = that.getData(),
input_job; input_job;
$.each(data.spreadsheet, function(i, line){ $.each(data.wip_spreadsheet, function(i, line){
if (line[1] == obj['id']) { if (line[1] == obj['id']) {
input_job = line; input_job = line;
} }
...@@ -503,14 +503,14 @@ ...@@ -503,14 +503,14 @@
} }
if (spreadsheet_data.length > 1) { if (spreadsheet_data.length > 1) {
var spreadsheet = $('#job_schedule_spreadsheet'); var job_schedule_spreadsheet = $('#job_schedule_spreadsheet');
if (configuration['Dream-Configuration'].gui.job_schedule_spreadsheet){ if (configuration['Dream-Configuration'].gui.job_schedule_spreadsheet){
spreadsheet.show(); job_schedule_spreadsheet.show();
spreadsheet.handsontable({ job_schedule_spreadsheet.handsontable({
data: spreadsheet_data, data: spreadsheet_data,
readOnly: true readOnly: true
}); });
spreadsheet.find('.htCore').width(spreadsheet.width()); job_schedule_spreadsheet.find('.htCore').width(job_schedule_spreadsheet.width());
} }
gantt.templates.task_class = function (start, end, obj) { gantt.templates.task_class = function (start, end, obj) {
return obj.parent ? "sub_task" : ""; return obj.parent ? "sub_task" : "";
......
...@@ -80,10 +80,10 @@ ...@@ -80,10 +80,10 @@
try { try {
// spreadsheets // spreadsheets
var spreadsheet_data = data.spreadsheet; // XXX rename as wip_spreadsheet in json ? var wip_spreadsheet_data = data.wip_spreadsheet;
if (spreadsheet_data !== undefined) { if (wip_spreadsheet_data !== undefined) {
var spreadsheet = $('#wip_spreadsheet'); var spreadsheet = $('#wip_spreadsheet');
spreadsheet.handsontable('populateFromArray', 0, 0, spreadsheet_data); spreadsheet.handsontable('populateFromArray', 0, 0, wip_spreadsheet_data);
spreadsheet.find('.htCore').width(spreadsheet.width()); spreadsheet.find('.htCore').width(spreadsheet.width());
} }
......
...@@ -316,10 +316,9 @@ ...@@ -316,10 +316,9 @@
"preference": priv.preference_container, "preference": priv.preference_container,
"general": priv.general_container "general": priv.general_container
}; };
var spreadsheet = $('#wip_spreadsheet'); var wip_spreadsheet = $('#wip_spreadsheet');
if (spreadsheet !== undefined) { if (wip_spreadsheet.length > 0) {
// XXX wip_spreadsheet ? data['wip_spreadsheet'] = wip_spreadsheet.handsontable('getData');
data['spreadsheet'] = spreadsheet.handsontable('getData');
} }
return data; return data;
}; };
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
}, },
"zoom_level": 0.99999 "zoom_level": 0.99999
}, },
"spreadsheet": [ "wip_spreadsheet": [
[ [
"Jobs", "Jobs",
"ID", "ID",
......
...@@ -38,9 +38,9 @@ class Simulation(ACO.Simulation): ...@@ -38,9 +38,9 @@ class Simulation(ACO.Simulation):
""" Set the WIP in queue from spreadsheet data. """ Set the WIP in queue from spreadsheet data.
""" """
data = copy(in_data) data = copy(in_data)
if 'spreadsheet' in data: if 'wip_spreadsheet' in data:
wip_dict = {} wip_dict = {}
for value_list in data['spreadsheet']: for value_list in data['wip_spreadsheet']:
if value_list[1] == 'ID' or not value_list[1]: if value_list[1] == 'ID' or not value_list[1]:
continue continue
sequence_list = value_list[6].split('-') sequence_list = value_list[6].split('-')
...@@ -70,6 +70,6 @@ class Simulation(ACO.Simulation): ...@@ -70,6 +70,6 @@ class Simulation(ACO.Simulation):
for node_id in data['nodes'].keys(): for node_id in data['nodes'].keys():
if node_id in wip_dict: if node_id in wip_dict:
data['nodes'][node_id]['wip'] = wip_dict[node_id] data['nodes'][node_id]['wip'] = wip_dict[node_id]
del(data['spreadsheet']) del(data['wip_spreadsheet'])
return data return data
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment