cleaned up some of the status display handling
[Evergreen.git] / Open-ILS / web / vandelay / vandelay.html
1 <!--
2 # Copyright (C) 2008  Georgia Public Library Service
3 # Bill Erickson <erickson@esilibrary.com>
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 -->
14 <html>
15     <head>
16         <title>Vandelay</title>
17         <style type="text/css">
18             @import "/js/dojo/dojo/resources/dojo.css";
19             @import "/js/dojo/dijit/themes/tundra/tundra.css";
20             @import "/js/dojo/dijit/tests/css/dijitTests.css"; 
21             @import "/js/dojo/dojox/grid/_grid/Grid.css";
22             td { padding: 6px; }
23             .match_div {
24                 height: 95%;
25                 width: 95%;
26             }
27             .match_div a {
28                 color: red;
29                 font-weight:bold;
30             }
31             .match_div a:visited {
32                 color: red;
33                 font-weight:bold;
34             }
35             .tall { height:100%; }
36             .hidden { display: none; }
37             #toolbar { margin-top: 0px; }
38             body { width:100%; height:100%; border:0; margin:0; padding:0; }
39             .progress { 
40                 width:100%;
41                 text-align:center;
42                 margin: 20px;
43             }
44             .overlay_selected { 
45                 padding: 2px; 
46                 background: #d9e8f9;
47                 border: 1px solid red; 
48             }
49         </style>
50         <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
51         <script type="text/javascript" src='vandelay.js'></script>
52     </head>
53     <body class="tundra tall">
54         <div dojoType="dijit.Toolbar" id='toolbar'>
55             <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
56                 onclick='displayGlobalDiv("vl-marc-upload-div");' showLabel="true">Import Records</div>
57             <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
58                 onclick='vlShowQueueSelect();' showLabel="true">Inspect Queue</div>
59         </div>
60
61         <div id="vl-generic-progress" class='progress'>
62             <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
63         </div>
64         <div id="vl-generic-progress-with-total" class='hidden progress'>
65             <div dojoType="dijit.ProgressBar" jsId='vlControlledProgressBar' style="width:300px"></div>
66         </div>
67
68         <div id='vl-marc-upload-status-div' class='hidden'>
69             <h1>Upload Status</h1><br/>
70             <div id='vl-upload-status-uploading'><h3>Uploading...</h3></div>
71             <div id='vl-upload-status-processing' class='hidden'><h3>Processing...</h3></div>
72         </div>
73
74         <!-- MARC upload form -->
75         <div id='vl-marc-upload-div' class='hidden'>
76             <h1>Evergreen MARC File Upload</h1><br/>
77             <form id="vl-marc-upload-form" enctype="multipart/form-data">
78                 <input type='hidden' name='ses' id='vl-ses-input'/>
79                 <br/>
80                 <table>
81                     <tr>
82                         <td>Record Type</td>
83                         <td colspan='4'>
84                             <select id='vl-record-type' dojoType='dijit.form.FilteringSelect' 
85                                     jsId='vlUploadRecordType' onchange='vlShowUploadForm();'>
86                                 <option value='bib' selected='selected'>Bibliographic Records</option>
87                                 <option value='auth'>Authority Records</option>
88                             </select>
89                         </td>
90                     </tr>
91                     <tr>
92                         <td>Create a Upload New Queue</td>
93                         <td>
94                             <input type='text' dojoType='dijit.form.TextBox' id='vl-queue-name' size='32'></input>
95                         </td>
96                         <td>or Add to an Existing Queue</td>
97                         <td>
98                             <select jsId='vlUploadQueueSelector' dojoType='dijit.form.FilteringSelect'>
99                             </select>
100                         </td>
101                     </tr>
102                     <tr>
103                         <td>Purpose</td>
104                         <td colspan='4'>
105                             <select name='purpose' dojoType='dijit.form.FilteringSelect'>
106                                 <option value='import'>Import</option>
107                                 <option value='overlay'>Overlay</option>
108                             </select>
109                         </td>
110                     </tr>
111                     <tr>
112                         <td>
113                             <span id="vl-file-label">File to Upload:</span>
114                         </td>
115                         <td id='vl-input-td' colspan='4'>
116                             <input size='48' type="file" name="marc_upload"/>
117                         </td>
118                     </tr>
119                     <tr>
120                         <td align='center' colspan='4'>
121                             <button dojoType="dijit.form.Button" onclick="batchUpload()">Upload</button>
122                         </td>
123                     </tr>
124                 </table>
125             </form>
126         </div>
127
128         <!-- record queue grid -->
129         <div id='vl-queue-div' class='tall hidden'>
130             <h1>Record Queue</h1><br/>
131             <div id='vl-queue-no-records' class='hidden'><h2>There are no records in the selected queue</h2></div>
132             <script>
133                 var vlQueueGridLayout;
134                 function resetVlQueueGridLayout() {
135                     vlQueueGridLayout = [{
136                         defaultCell: {styles: 'text-align: center;'},
137                         cells : [[
138                             {name: 'Selected', get: vlQueueGridDrawSelectBox },
139                             {name: 'Import Time', field:'import_time', get:vlGetDateTimeField}
140                         ]]
141                     }];
142                 }
143             </script>
144             <div id='vl-queue-div-grid' class='tall'>
145                 <button dojoType='dijit.form.Button' onclick='vlSelectAllGridRecords();'>Select All</button>
146                 <button dojoType='dijit.form.Button' onclick='vlSelectNoGridRecords();'>Select None</button>
147                 <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
148                 <div class='tall'>
149                     <div dojoType='dojox.Grid' jsId='vlQueueGrid' class='tall'> </div>
150                 </div>
151             </div>
152         </div>
153
154         <!-- Grid of record matches -->
155         <div id='vl-match-div' class='tall hidden'>
156             <script>
157                 var vlMatchGridLayout;
158                 function resetVlMatchGridLayout() {
159                     vlMatchGridLayout = [{
160                         defaultCell: {styles: 'text-align: center;'},
161                         cells : [[
162                             {
163                                 name: 'Overlay Target', 
164                                 get: vlGetOverlayTargetSelector,
165                                 value: '<input type="radio" name="overlay_target" onclick="vlHandleOverlayTargetSelected();" id="vl-overlay-target-ID"/>'
166                             },
167                             {name:'Match Point', field:'field_type'},
168                             {name: 'ID', field:'id'},
169                             {   name: 'View MARC', 
170                                 get: vlGetViewMARC, 
171                                 value:'<a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID);">View MARC</a>'
172                             },
173                             {name: 'Creator', get: vlGetCreator},
174                             {name: 'Create Date', field:'create_date', get: vlGetDateTimeField},
175                             {name: 'Last Edit Date', field:'edit_date', get: vlGetDateTimeField},
176                             {name: 'Source', field:'source'},
177                             {name: 'TCN Source', field:'tcn_source'},
178                             {name: 'TCN Value', field:'tcn_value'}
179                         ]]
180                     }];
181                 }
182             </script>
183             <h1>Import Matches</h1><br/>
184             <div>
185                 <button dojoType='dijit.form.Button' 
186                     onclick='displayGlobalDiv("vl-queue-div");'>Back To Import Queue...</button>
187                 <span style='padding-left:20px;'>
188                     <input dojoType='dijit.form.CheckBox' jsId='vlOverlayTargetEnable' onclick='vlHandleOverlayTargetSelected'/> 
189                     Overlay selected record with imported record
190                 </span>
191             </div>
192             <div class='tall'>
193                 <div dojoType='dojox.Grid' jsId='vlMatchGrid'> </div>
194             </div>
195         </div>
196
197         <!-- MARC as HTML for matched records -->
198         <div id='vl-match-html-div' class='tall hidden'>
199             <h1>MARC Record</h1><br/>
200             <div>
201                 <button dojoType='dijit.form.Button' 
202                     onclick='displayGlobalDiv("vl-match-div");'>Back To Matches...</button>
203             </div>
204             <div>
205                 <style>#vl-match-record-html td {padding:0px;}</style>
206                 <div id='vl-match-record-html'> </div>
207             </div>
208         </div>
209
210         <!-- Form for choosing which queue to view -->
211         <div id='vl-queue-select-div' class='tall hidden'>
212             <h1>Select a Queue to Inspect</h1><br/>
213             <table>
214                 <tr>
215                     <td>Queue Type</td>
216                     <td>
217                         <select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='vlShowQueueSelect();'>
218                             <option value='bib' selected='selected'>Bibliographic Records</option>
219                             <option value='auth'>Authority Records</option>
220                         </select>
221                     </td>
222                 </tr>
223                 <tr>
224                     <td>Queue</td>
225                     <td>
226                         <select jsId='vlQueueSelectQueueList' dojoType='dijit.form.FilteringSelect'>
227                         </select>
228                     </td>
229                 </tr>
230                 <tr>
231                     <td colspan='2'>
232                         <button dojoType='dijit.form.Button' onclick='vlFetchQueueFromForm();'>Retrieve Queue</button>
233                     </td>
234                 </tr>
235             </table>
236         </div>
237     </body>
238 </html>