]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/admin/upload_xacts.js
LP2042879 Shelving Location Groups Admin accessibility
[Evergreen.git] / Open-ILS / xul / staff_client / server / admin / upload_xacts.js
1 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
2
3 function $(id) {
4     return document.getElementById(id);
5 }
6
7 function my_init() {
8     try {
9         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
10         JSAN.errorLevel = "die"; // none, warn, or die
11         JSAN.addRepository('..');
12         JSAN.use('util.error'); g.error = new util.error();
13         g.error.sdump('D_TRACE','my_init() for upload_xacts.html');
14
15         if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
16             try { window.xulG.set_tab_name('Upload Offline Transactions'); } catch(E) { alert(E); }
17         }
18
19         JSAN.use('util.file'); g.file = new util.file( xul_param('filename') );
20
21         if (g.file._file.exists()) {
22             $('submit').disabled = false;
23             $('file').value = g.file._file.path;
24         } else {
25             alert('No transactions to upload.');
26             return;
27         }
28
29         $( 'ws' ).setAttribute('value', xul_param('ws'));
30         $( 'ses' ).setAttribute('value', xul_param('ses'));
31         $( 'seskey' ).setAttribute('value', xul_param('seskey'));
32         $( 'delta' ).setAttribute('value', xul_param('delta'));
33
34         $( 'form' ).setAttribute('action', xulG.url_prefix('XUL_OFFLINE_MANAGE_XACTS_CGI'));
35
36         setTimeout(
37             function() {
38                 JSAN.use('util.widgets');
39                 util.widgets.click('submit');
40             }, 0
41         );
42
43     } catch(E) {
44         var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
45             "system administrator or software developer the following:\nmain/upload_xacts.xhtml\n" + E + '\n';
46         try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
47         alert(err_msg);
48     }
49 }
50
51