hedera-web/forms/admin/shelves/shelves.js

54 lines
850 B
JavaScript
Raw Normal View History

2015-09-22 07:20:47 +00:00
2016-09-26 09:28:47 +00:00
Hedera.Shelves = new Class
2015-09-22 07:20:47 +00:00
({
2016-09-26 09:28:47 +00:00
Extends: Hedera.Form
2016-10-04 15:27:49 +00:00
2015-09-22 07:20:47 +00:00
,activate: function ()
{
this.$('date').value = new Date ();
this.$('useIds').value = false;
2015-10-23 23:23:19 +00:00
}
2016-10-04 15:27:49 +00:00
2015-11-05 07:30:19 +00:00
,onConfigChange: function ()
2015-10-23 23:23:19 +00:00
{
2016-10-04 15:27:49 +00:00
var fields = [
'realm'
,'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
];
for (var i = 0; i < fields.length; i++)
this.$(fields[i]).value = this.$('config').get (fields[i]);
2015-09-22 07:20:47 +00:00
}
,onPreviewClick: function ()
2016-10-04 15:27:49 +00:00
{
var fields = [
'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
,'useIds'
,'date'
];
var batch = new Sql.Batch ();
for (var i = 0; i < fields.length; i++)
batch.addValue (fields[i], this.$(fields[i]).value);
2015-11-19 13:57:23 +00:00
this.gui.openReport ('shelves-report', batch);
2015-10-21 23:42:52 +00:00
}
});