]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/vandelay/vandelay.html
adding initial grid column picker logic and plugged into queued records grid. also...
[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             .container:after {content: ""; display: block; height: 0; clear: both; }
23             .form_table td { padding: 6px; }
24             table { border-collapse: collapse; }
25             .match_div {
26                 height: 95%;
27                 width: 95%;
28             }
29             .match_div a {
30                 color: red;
31                 font-weight:bold;
32             }
33             .match_div a:visited {
34                 color: red;
35                 font-weight:bold;
36             }
37             .tall { height:100%; }
38             .wide { width:100%; }
39             .hidden { display: none; }
40             #toolbar { margin-top: 0px; }
41             body { width:100%; height:100%; border:0; margin:0; padding:0; }
42             .progress { 
43                 width:100%;
44                 text-align:center;
45                 margin: 20px;
46             }
47             .overlay_selected { 
48                 padding: 2px; 
49                 background: #d9e8f9;
50                 border: 1px solid red; 
51             }
52         </style>
53         <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:true" src="/js/dojo/dojo/dojo.js"></script>
54         <script type="text/javascript" src='/js/dojo/openils/MarcXPathParser.js'></script>
55         <script type="text/javascript" src='vandelay.js'></script>
56     </head>
57     <body class="tundra tall">
58         <div dojoType="dijit.Toolbar" id='toolbar'>
59             <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
60                 onclick='displayGlobalDiv("vl-marc-upload-div");' showLabel="true">Import Records</div>
61             <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
62                 onclick='vlShowQueueSelect();' showLabel="true">Inspect Queue</div>
63         </div>
64
65         <div id="vl-generic-progress" class='progress'>
66             <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
67         </div>
68         <div id="vl-generic-progress-with-total" class='hidden progress'>
69             <div dojoType="dijit.ProgressBar" jsId='vlControlledProgressBar' style="width:300px"></div>
70         </div>
71
72         <div id='vl-marc-upload-status-div' class='hidden'>
73             <h1>Upload Status</h1><br/>
74             <div id='vl-upload-status-uploading'><h3>Uploading...</h3></div>
75             <div id='vl-upload-status-processing' class='hidden'><h3>Processing...</h3></div>
76         </div>
77
78         <!-- MARC upload form -->
79         <div id='vl-marc-upload-div' class='hidden'>
80             <h1>Evergreen MARC File Upload</h1><br/>
81             <form id="vl-marc-upload-form" enctype="multipart/form-data">
82                 <input type='hidden' name='ses' id='vl-ses-input'/>
83                 <br/>
84                 <table class='form_table'>
85                     <tr>
86                         <td>Record Type</td>
87                         <td colspan='4'>
88                             <select id='vl-record-type' dojoType='dijit.form.FilteringSelect' 
89                                     jsId='vlUploadRecordType' onchange='vlShowUploadForm();'>
90                                 <option value='bib' selected='selected'>Bibliographic Records</option>
91                                 <option value='auth'>Authority Records</option>
92                             </select>
93                         </td>
94                     </tr>
95                     <tr>
96                         <td>Create a Upload New Queue</td>
97                         <td>
98                             <input type='text' dojoType='dijit.form.TextBox' id='vl-queue-name' size='32'></input>
99                         </td>
100                         <td>or Add to an Existing Queue</td>
101                         <td>
102                             <select jsId='vlUploadQueueSelector' dojoType='dijit.form.FilteringSelect'>
103                             </select>
104                         </td>
105                     </tr>
106                     <tr>
107                         <td>Purpose</td>
108                         <td colspan='4'>
109                             <select name='purpose' dojoType='dijit.form.FilteringSelect'>
110                                 <option value='import'>Import</option>
111                                 <option value='overlay'>Overlay</option>
112                             </select>
113                         </td>
114                     </tr>
115                     <tr>
116                         <td>
117                             <span id="vl-file-label">File to Upload:</span>
118                         </td>
119                         <td id='vl-input-td' colspan='4'>
120                             <input size='48' type="file" name="marc_upload"/>
121                         </td>
122                     </tr>
123                     <tr>
124                         <td align='center' colspan='4'>
125                             <button dojoType="dijit.form.Button" onclick="batchUpload()">Upload</button>
126                         </td>
127                     </tr>
128                 </table>
129             </form>
130         </div>
131
132         <!-- record queue grid -->
133         <div id='vl-queue-div' class='tall hidden'>
134             <h1>Record Queue</h1><br/>
135             <div id='vl-queue-no-records' class='hidden'><h2>There are no records in the selected queue</h2></div>
136             <script>
137                 var vlQueueGridLayout;
138                 function resetVlQueueGridLayout() {
139                     vlQueueGridLayout = [{
140                         defaultCell: {styles: 'text-align: center;'},
141                         cells : [[
142                             {name: '<input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>', 
143                                 get: vlQueueGridDrawSelectBox },
144                             {name: 'Import Time', field:'import_time', get:vlGetDateTimeField, selectableColumn:true}
145                         ]]
146                     }];
147                 }
148             </script>
149             <div id='vl-queue-div-grid' class='tall'>
150                 <!-- column picker dialog -->
151                 <div dojoType="dijit.Dialog" jsId='vlQueueGridColumePickerDialog' title="Column Picker" execute="alert(2);">
152                     <table class='form_table'>
153                         <thead>
154                             <tr><th width='33%'>Column</th><th width='33%'>Dislapy</th><th width='33%'>Auto Width</th></tr>
155                         </thead>
156                         <tbody>
157                             <tr>
158                                 <td colspan='3' align='center'>
159                                     <button jsId='vlQueueGridColumnPickerButton' 
160                                         onclick='vlQueueGridColumePickerDialog.hide();vlQueueGridColumePicker.update();' 
161                                         dojoType='dijit.form.Button'>Done</button>
162                                 </td>
163                             </tr>
164                         </tbody>
165                     </table>
166                 </div>
167
168                 <!-- queue grid navigation row -->
169                 <table width='100%' style='margin-bottom:0px;'>
170                     <tr>
171                         <td align='left'>
172                             <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
173                         </td>
174                         <td align='middle'>
175                             <style>.filter_td { padding-right: 5px; border-right: 2px solid #e8e1cf; } </style>
176                             <table><tr>
177                                 <td class='filter_td'>
178                                     Only show records with possible matches
179                                     <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches' checked='checked'/>
180                                 </td>
181                                 <td class='filter_td' style='padding-left:5px;'>
182                                     Results Per Page 
183                                     <select style='width:50px;' jsId='vlQueueDisplayLimit' dojoType='dijit.form.FilteringSelect' value='10'>
184                                         <option value='10'>10</option>
185                                         <option value='20'>20</option>
186                                         <option value='50'>50</option>
187                                         <option value='100'>100</option>
188                                     </select>
189                                 </td>
190                                 <td class='filter_td' style='padding-left:5px;'>
191                                     Page <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
192                                 </td style='padding-left:5px;'>
193                                 <td style='padding-left:5px;'>
194                                     <button dojoType='dijit.form.Button' 
195                                         onclick='retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords)'>Refresh</button>
196                                 </td>
197                             </tr></table>
198                         </td>
199                         <td align='right' valign='bottom'>
200                             <span style='padding-right:4px;'>
201                                 <a href='javascript:void(0);' onclick='
202                                     var page = parseInt(vlQueueDisplayPage.getValue());
203                                     if(page < 2) return;
204                                     vlQueueDisplayPage.setValue(page - 1);
205                                     retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>&#171; Previous Page</a>
206                             </span>
207                             <span style='padding-right:10px;'>
208                                 <a href='javascript:void(0);' onclick='
209                                     vlQueueDisplayPage.setValue(parseInt(vlQueueDisplayPage.getValue())+1);
210                                     retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>Next Page &#187;</a>
211                             </span>
212                             <span style='background:#e8e1cf;padding:3px 0px 0px 6px;-moz-border-radius:6px 0px 0px 0px;'>
213                                 <a href='javascript:void(0);' onclick='vlQueueGridColumePickerDialog.show();'>Select Columns</a>
214                             </span>
215                         </td>
216                     </tr>
217                 </table>
218
219                 <!-- Queue Grid -->
220                 <div class='tall'>
221                     <div dojoType='dojox.Grid' jsId='vlQueueGrid' class='tall'> </div>
222                 </div>
223             </div>
224         </div>
225
226         <!-- Grid of record matches -->
227         <div id='vl-match-div' class='tall hidden'>
228             <script>
229                 var vlMatchGridLayout;
230                 function resetVlMatchGridLayout() {
231                     vlMatchGridLayout = [{
232                         defaultCell: {styles: 'text-align: center;'},
233                         cells : [[
234                             {
235                                 name: 'Overlay Target', 
236                                 get: vlGetOverlayTargetSelector,
237                                 value: '<input type="radio" name="overlay_target" onclick="vlHandleOverlayTargetSelected();" id="vl-overlay-target-ID"/>'
238                             },
239                             {name:'Match Point', field:'field_type'},
240                             {name: 'ID', field:'id'},
241                             {   name: 'View MARC', 
242                                 get: vlGetViewMARC, 
243                                 value:'<a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID);">View MARC</a>'
244                             },
245                             {name: 'Creator', get: vlGetCreator},
246                             {name: 'Create Date', field:'create_date', get: vlGetDateTimeField},
247                             {name: 'Last Edit Date', field:'edit_date', get: vlGetDateTimeField},
248                             {name: 'Source', field:'source'},
249                             {name: 'TCN Source', field:'tcn_source'},
250                             {name: 'TCN Value', field:'tcn_value'}
251                         ]]
252                     }];
253                 }
254             </script>
255             <h1>Import Matches</h1><br/>
256             <div>
257                 <button dojoType='dijit.form.Button' 
258                     onclick='displayGlobalDiv("vl-queue-div");'>Back To Import Queue...</button>
259                 <span style='padding-left:20px;'>
260                     <input dojoType='dijit.form.CheckBox' jsId='vlOverlayTargetEnable' onclick='vlHandleOverlayTargetSelected'/> 
261                     Overlay selected record with imported record
262                 </span>
263             </div>
264             <div class='tall'>
265                 <div dojoType='dojox.Grid' jsId='vlMatchGrid'> </div>
266             </div>
267         </div>
268
269         <!-- MARC as HTML for matched records -->
270         <div id='vl-match-html-div' class='tall hidden'>
271             <h1>MARC Record</h1><br/>
272             <div>
273                 <button dojoType='dijit.form.Button' 
274                     onclick='displayGlobalDiv("vl-match-div");'>Back To Matches...</button>
275             </div>
276             <div>
277                 <style>#vl-match-record-html td {padding:0px;}</style>
278                 <div id='vl-match-record-html'> </div>
279             </div>
280         </div>
281
282         <!-- Form for choosing which queue to view -->
283         <div id='vl-queue-select-div' class='tall hidden'>
284             <h1>Select a Queue to Inspect</h1><br/>
285             <table class='form_table'>
286                 <tr>
287                     <td>Queue Type</td>
288                     <td>
289                         <select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='vlShowQueueSelect();'>
290                             <option value='bib' selected='selected'>Bibliographic Records</option>
291                             <option value='auth'>Authority Records</option>
292                         </select>
293                     </td>
294                 </tr>
295                 <tr>
296                     <td>Queue</td>
297                     <td>
298                         <select jsId='vlQueueSelectQueueList' dojoType='dijit.form.FilteringSelect'>
299                         </select>
300                     </td>
301                 </tr>
302                 <tr>
303                     <td colspan='2'>
304                         <button dojoType='dijit.form.Button' onclick='vlFetchQueueFromForm();'>Retrieve Queue</button>
305                     </td>
306                 </tr>
307             </table>
308         </div>
309     </body>
310 </html>