|
@@ -100,7 +100,12 @@
|
100
|
100
|
output.writeStartElement("tr");
|
101
|
101
|
output.writeTextElement("td", String(query.value(0)).split("T")[1]);
|
102
|
102
|
output.writeTextElement("td", query.value(2));
|
103
|
|
- output.writeTextElement("td", query.value(11));
|
|
103
|
+ output.writeStartElement("td");
|
|
104
|
+ output.writeStartElement("a");
|
|
105
|
+ output.writeAttribute("href", "typica://script/p" + query.value(11).slice(1,-1));
|
|
106
|
+ output.writeCDATA(query.value(11));
|
|
107
|
+ output.writeEndElement();
|
|
108
|
+ output.writeEndElement();
|
104
|
109
|
var unroastedWeightsList = sqlToArray(query.value(5));
|
105
|
110
|
output.writeStartElement("td");
|
106
|
111
|
for(var i = 0; i < unroastedWeightsList.length; i++)
|
|
@@ -407,6 +412,24 @@
|
407
|
412
|
dateField.dateChanged.connect(function() {
|
408
|
413
|
refresh();
|
409
|
414
|
});
|
|
415
|
+
|
|
416
|
+ view.scriptLinkClicked.connect(function(url) {
|
|
417
|
+ var arg = url.slice(1, url.length);
|
|
418
|
+ var details = createWindow("batchDetails");
|
|
419
|
+ var fakeTable = new Object;
|
|
420
|
+ fakeTable.holding = new Array(7);
|
|
421
|
+ fakeTable.data = function(r, c) {
|
|
422
|
+ return this.holding[c];
|
|
423
|
+ };
|
|
424
|
+ var query = new QSqlQuery();
|
|
425
|
+ query.exec("SELECT time, machine, (SELECT name FROM items WHERE id = roasted_id) AS name, unroasted_total_quantity AS green, roasted_quantity AS roasted, ((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity * 100::numeric)::numeric(12,2) AS weight_loss, duration, annotation FROM roasting_log WHERE files = '{" + arg + "}'");
|
|
426
|
+ query.next();
|
|
427
|
+ for(var i = 0; i < 8; i++) {
|
|
428
|
+ fakeTable.holding[i] = query.value(i);
|
|
429
|
+ }
|
|
430
|
+ query = query.invalidate();
|
|
431
|
+ details.loadData(fakeTable, 0);
|
|
432
|
+ });
|
410
|
433
|
]]>
|
411
|
434
|
</program>
|
412
|
435
|
</window>
|