]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/reports/oils_rpt_widget.js
added a bool widget for selecting true/false
[Evergreen.git] / Open-ILS / web / reports / oils_rpt_widget.js
1 /*
2 oilsRptSetSubClass('oilsRptWidget', 'oilsRptObject');
3 oilsRptWidget.OILS_RPT_TRANSFORM_WIDGET = 0;
4 oilsRptWidget.OILS_RPT_OPERATION_WIDGET = 1;
5
6 function oilsRptWidget(args) {
7         this.initWidget(args);
8         this.dest = elem('input',{type:'text'});
9 }
10
11 oilsRptWidget.prototype.initWidget = function(args) {
12         if(!args) return;
13         this.init();
14         this.node       = args.node;
15         this.type       = args.type;
16         this.action = args.action;
17         this.column     = args.column;
18 }
19
20 oilsRptWidget.prototype.getValue = function() {
21         return this.dest.value ;
22 }
23
24 oilsRptWidget.prototype.draw = function() {
25         appendClear(this.node, this.dest);
26 }
27
28 oilsRptSetSubClass('oilsRptMultiInputWidget', 'oilsRptWidget');
29 function oilsRptMultiInputWidget(args) {
30         this.initInputWidget(args);
31 }
32
33 oilsRptMultiInputWidget.prototype.initInputWidget = function(args) {
34         if(!args) return;
35         this.initWidget(args);
36         this.count = (args.count) ? args.count : 2;
37         this.dest = [];
38         for( var i = 0; i < this.count; i++ )
39                 this.dest.push(elem('input',{type:'text',size:10}));
40 }
41
42 oilsRptMultiInputWidget.prototype.getValue = function() {
43         var vals = [];
44         for( var i = 0; i < this.dest.length; i++ )
45                 vals.push(this.dest[i].value);
46         return vals;
47 }
48
49 oilsRptMultiInputWidget.prototype.draw = function() {
50         removeChildren(this.node);
51         for( var i = 0; i < this.dest.length; i++ ) {
52                 if( this.label )
53                         this.node.appendChild(this.label[i]);
54                 this.node.appendChild(this.dest[i]);
55         }
56 }
57
58 oilsRptMultiInputWidget.prototype.setLabels = function(labels) {
59         this.labels = labels;   
60 }
61
62
63
64
65 oilsRptSetSubClass('oilsRptMultiWidget', 'oilsRptWidget');
66 function oilsRptMultiWidget(args) {
67         this.initMultiWidget(args);
68 }
69
70 oilsRptMultiWidget.prototype.initMultiWidget = function(args) {
71         if(!args) return;
72         this.initWidget(args);
73         this.dest = elem('select',
74                 {multiple:'multiple','class':'oils_rpt_small_info_selector'});
75
76         var obj = this;
77
78         this.addButton = elem('input',{type:'submit',value:"Add"})
79         this.addButton.onclick = this.getSourceCollector();
80         this.delButton = elem('input',{type:'submit',value:"Del"})
81         this.delButton.onclick = function(){obj.removeSelected()};
82 }
83
84 oilsRptMultiWidget.prototype.getValue = function() {
85         var vals = [];
86         for( var i = 0; i < this.dest.options.length; i++ )
87                 vals.push(this.dest.options[i].value);
88         return vals;
89 }
90
91 oilsRptMultiWidget.prototype.removeSelected = function() {
92         oilsDelSelectedItems(this.dest);
93 }
94
95 oilsRptMultiWidget.prototype.addItem = function(name, val) {
96         for( var i = 0; i < this.dest.options.length; i++ ) {
97                 if( this.dest.options[i].value == val ) 
98                         return;
99         }
100         insertSelectorVal(this.dest, -1, name, val);
101 }
102
103 oilsRptMultiWidget.prototype.setSource = function(src) {
104         this.source = src;
105 }
106
107 oilsRptMultiWidget.prototype.drawMultiWidget = function() {
108         appendClear(this.node, this.source);
109         this.node.appendChild(elem('br'))
110         this.node.appendChild(this.addButton);
111         this.node.appendChild(this.delButton);
112         this.node.appendChild(elem('br'))
113         this.node.appendChild(this.dest);
114 }
115
116 oilsRptSetSubClass('oilsRptInputMultiWidget', 'oilsRptMultiWidget');
117 function oilsRptInputMultiWidget(args) {
118         this.initInputMultiWidget(args);
119 }
120 oilsRptInputMultiWidget.prototype.initInputMultiWidget = function(args) {
121         if(!args) return;
122         this.initMultiWidget(args);
123         this.setSource(elem('input',{type:'text'}));
124 }
125
126 oilsRptInputMultiWidget.prototype.draw = function() {
127         this.drawMultiWidget();
128 }
129
130 oilsRptInputMultiWidget.prototype.getSourceCollector = function() {
131         var obj = this;
132         return function() {
133                 obj.addItem(obj.source.value, obj.source.value);
134         }
135 }
136
137
138
139 oilsRptSetSubClass('oilsRptSelectorMultiWidget', 'oilsRptMultiWidget');
140 function oilsRptSelectorMultiWidget(args) {
141         this.initSelectorMultiWidget(args);
142 }
143 oilsRptSelectorMultiWidget.prototype.initSelectorMultiWidget = function(args) {
144         if(!args) return;
145         this.initMultiWidget(args);
146         this.setSource(
147                 elem('select',{multiple:'multiple', 'class':'oils_rpt_small_info_selector'}));
148 }
149
150 oilsRptSelectorMultiWidget.prototype.getSourceCollector = function() {
151         var obj = this;
152         return function() {
153                 for( var i = 0; i < obj.source.options.length; i++ ) {
154                         if( obj.source.options[i].selected )
155                                 obj.addItem(obj.source.options[i].innerHTML, 
156                                         obj.source.options[i].value);
157                 }
158         }
159 }
160 */
161
162 /* ----------------------------------------------------------- */
163
164 /*
165 oilsRptSetSubClass('oilsRptRemoteWidget', 'oilsRptSelectorMultiWidget');
166 function oilsRptRemoteWidget(args) {
167         this.initRemoteWidget(args);
168 }
169 oilsRptRemoteWidget.prototype.initRemoteWidget = function(args) {
170         if(!args) return;
171         this.initSelectorMultiWidget(args);
172         this.selector = args.selector;
173 }
174
175 oilsRptRemoteWidget.prototype.draw = function() {
176         this.fetch();
177         //this.draw();
178 }
179
180 oilsRptRemoteWidget.prototype.setFetch = function(func) {
181         this.fetch = func;
182 }
183 */
184
185
186
187
188 /* --------------------------------------------------------------------- */
189 /*
190 oilsRptSetSubClass('oilsRptOrgMultiSelect','oilsRptSelectorMultiWidget');
191 function oilsRptOrgMultiSelect(args) {
192         this.initSelectorMultiWidget(args);
193 }
194 oilsRptOrgMultiSelect.prototype.draw = function(org) {
195         if(!org) org = globalOrgTree;
196         var opt = insertSelectorVal( this.source, -1, 
197                 org.shortname(), org.id(), null, findOrgDepth(org) );
198         if( org.id() == oilsRptCurrentOrg )
199                 opt.selected = true;
200         if( org.children() ) {
201                 for( var c = 0; c < org.children().length; c++ )
202                         this.draw(org.children()[c]);
203         }
204         this.drawMultiWidget();
205 }
206 */
207
208
209
210 /* --------------------------------------------------------------------- */
211 /*
212 function oilsRptRelDatePicker(args) {
213         this.node = args.node;
214         this.relative = args.relative;
215         this.div = DOM.oils_rpt_relative_date_picker.cloneNode(true);
216 }
217
218 oilsRptRelDatePicker.prototype.draw = function() {
219         this.node.appendChild(this.div);
220         unHideMe(this.div);
221 }
222
223 oilsRptRelDatePicker.prototype.getValue = function() {
224         var str = 
225                 getSelectorVal($n(this.div, 'count')) + 
226                 getSelectorVal($n(this.div,'type'));
227         if( this.relative ) str = '-'+str;
228         return str;
229 }
230 */
231 /* --------------------------------------------------------------------- */
232
233
234
235
236
237
238
239
240 /* --------------------------------------------------------------------- */
241 /* --------------------------------------------------------------------- */
242
243
244
245
246 /* --------------------------------------------------------------------- 
247         Represents a set of value, an inputWidget collects data and a 
248         multi-select displays the data and allows the user to remove items
249         --------------------------------------------------------------------- */
250 function oilsRptSetWidget(args) {
251         this.node = args.node;
252         this.inputWidget = new args.inputWidget(args);
253         this.dest = elem('select',
254                 {multiple:'multiple','class':'oils_rpt_small_info_selector'});
255 }
256
257 oilsRptSetWidget.prototype.draw = function() {
258
259         this.addButton = elem('input',{type:'submit',value:"Add"})
260         this.delButton = elem('input',{type:'submit',value:"Del"})
261
262         var obj = this;
263         this.addButton.onclick = function() {
264                 obj.addDisplayItems(obj.inputWidget.getDisplayValue());
265         }
266
267         this.delButton.onclick = function(){obj.removeSelected()};
268
269         removeChildren(this.node);
270         this.inputWidget.draw();
271         this.node.appendChild(elem('br'))
272         this.node.appendChild(this.addButton);
273         this.node.appendChild(this.delButton);
274         this.node.appendChild(elem('br'))
275         this.node.appendChild(this.dest);
276 }
277
278 oilsRptSetWidget.prototype.addDisplayItems = function(list) {
279         if( list.constructor != Array ) list = [list];
280         for(var i = 0; i < list.length; i++) {
281                 var item = list[i];
282
283                 /* no dupes */
284                 var exists = false;
285                 iterate(this.dest.options, 
286                         function(o){if(o.getAttribute('value') == item.value) {exists = true; return;}});
287                 if(exists) continue;
288
289                 _debug('Inserting SetWidget values ' + js2JSON(item));
290                 insertSelectorVal(this.dest, -1, item.label, this.objToStr(item.value));
291         }
292 }
293
294 oilsRptSetWidget.prototype.removeSelected = function() {
295         oilsDelSelectedItems(this.dest);
296 }
297
298 oilsRptSetWidget.prototype.getValue = function() {
299         var vals = [];
300         var obj = this;
301         iterate(this.dest, function(i){vals.push(obj.strToObj(i.getAttribute('value')))});
302         return vals;
303 }
304
305 oilsRptSetWidget.prototype.objToStr = function(obj) {
306         if( typeof obj == 'string' ) return obj;
307         return ':'+obj.transform+':'+obj.params[0];
308 }
309
310 oilsRptSetWidget.prototype.strToObj = function(str) {
311         if( str.match(/^:.*/) ) {
312                 var tform = str.replace(/^:(.*):.*/,'$1');
313                 var param = str.replace(/^:.*:(.*)/,'$1');
314                 return { transform : tform, params : [param] };
315         }
316         return str;
317 }
318
319
320 /* --------------------------------------------------------------------- 
321         represents a widget that has start and end values.  start and end
322         are gather from start/end widgets
323         --------------------------------------------------------------------- */
324 function oilsRptBetweenWidget(args) {
325         this.node = args.node;
326         this.startWidget = new args.startWidget(args);
327         this.endWidget = new args.endWidget(args);
328 }
329 oilsRptBetweenWidget.prototype.draw = function() {
330         removeChildren(this.node);
331         this.startWidget.draw();
332         this.node.appendChild(elem('hr'));
333         this.node.appendChild(elem('div',
334                 {style:'text-align:center;width:100%;font-weight:bold'},' - And - '));
335         this.node.appendChild(elem('hr'));
336         this.endWidget.draw();
337 }
338 oilsRptBetweenWidget.prototype.getValue = function() {
339         return [
340                 this.startWidget.getValue(),
341                 this.endWidget.getValue()
342         ];
343 }
344
345
346
347
348 /* --------------------------------------------------------------------- 
349         ATOMIC WIDGETS
350         --------------------------------------------------------------------- */
351
352
353 /* --------------------------------------------------------------------- 
354         Atomic text input widget
355         --------------------------------------------------------------------- */
356 function oilsRptTextWidget(args) {
357         this.node = args.node;
358         this.dest = elem('input',{type:'text',size:12});
359 }
360 oilsRptTextWidget.prototype.draw = function() {
361         this.node.appendChild(this.dest);
362 }
363
364 /* returns the "real" value for the widget */
365 oilsRptTextWidget.prototype.getValue = function() {
366         return this.dest.value;
367 }
368
369 /* returns the label and "real" value for the widget */
370 oilsRptTextWidget.prototype.getDisplayValue = function() {
371         return { label : this.getValue(), value : this.getValue() };
372 }
373
374
375
376 /* --------------------------------------------------------------------- 
377         Atomic bool input widget
378         --------------------------------------------------------------------- */
379 function oilsRptBoolWidget(args) {
380         this.node = args.node;
381         this.selector = elem('select');
382         insertSelectorVal(this.selector, -1,'True','t');
383         insertSelectorVal(this.selector, -1,'False','f');
384 }
385
386 oilsRptBoolWidget.prototype.draw = function() {
387         this.node.appendChild(this.selector);
388 }
389
390 /* returns the "real" value for the widget */
391 oilsRptBoolWidget.prototype.getValue = function() {
392         return getSelectorVal(this.selector);
393 }
394
395 /* returns the label and "real" value for the widget */
396 oilsRptBoolWidget.prototype.getDisplayValue = function() {
397         var val = getSelectorVal(this.selector);
398         var label = 'True';
399         if (val == 'f') labal = 'False';
400         return { label : label, value : val };
401 }
402
403
404
405
406 /* --------------------------------------------------------------------- 
407         Atomic calendar widget
408         --------------------------------------------------------------------- */
409 function oilsRptCalWidget(args) {
410         this.node = args.node;
411         this.calFormat = args.calFormat;
412         this.input = elem('input',{type:'text',size:12});
413
414         if( args.inputSize ) {
415                 this.input.setAttribute('size',args.inputSize);
416                 this.input.setAttribute('maxlength',args.inputSize);
417         }
418 }
419
420 oilsRptCalWidget.prototype.draw = function() {
421         this.button = DOM.generic_calendar_button.cloneNode(true);
422         this.button.id = oilsNextId();
423         this.input.id = oilsNextId();
424
425         this.node.appendChild(this.button);
426         this.node.appendChild(this.input);
427         unHideMe(this.button);
428
429         _debug('making calendar widget with format ' + this.calFormat);
430
431         Calendar.setup({
432                 inputField      : this.input.id,
433                 ifFormat                : this.calFormat,
434                 button          : this.button.id,
435                 align                   : "Tl", 
436                 singleClick     : true
437         });
438 }
439
440 oilsRptCalWidget.prototype.getValue = function() {
441         return this.input.value;
442 }
443
444 oilsRptCalWidget.prototype.getDisplayValue = function() {
445         return { label : this.getValue(), value : this.getValue() };
446 }
447
448
449 /* --------------------------------------------------------------------- 
450         Atomic org widget
451         --------------------------------------------------------------------- */
452 function oilsRptOrgSelector(args) {
453         this.node = args.node;
454         this.selector = elem('select',
455                 {multiple:'multiple','class':'oils_rpt_small_info_selector'});
456 }
457
458 oilsRptOrgSelector.prototype.draw = function(org) {
459         if(!org) org = globalOrgTree;
460         var opt = insertSelectorVal( this.selector, -1, 
461                 org.shortname(), org.id(), null, findOrgDepth(org) );
462         if( org.id() == oilsRptCurrentOrg )
463                 opt.selected = true;
464         if( org.children() ) {
465                 for( var c = 0; c < org.children().length; c++ )
466                         this.draw(org.children()[c]);
467         }
468         this.node.appendChild(this.selector);
469 }
470
471 oilsRptOrgSelector.prototype.getValue = function() {
472         var vals = [];
473         iterate(this.selector,
474                 function(o){
475                         if( o.selected )
476                                 vals.push(o.getAttribute('value'))
477                 }
478         );
479         return vals;
480 }
481
482 oilsRptOrgSelector.prototype.getDisplayValue = function() {
483         var vals = [];
484         iterate(this.selector,
485                 function(o){
486                         if( o.selected )
487                                 vals.push({ label : o.innerHTML, value : o.getAttribute('value')});
488                 }
489         );
490         return vals;
491 }
492
493
494 /* --------------------------------------------------------------------- 
495         Atomic age widget
496         --------------------------------------------------------------------- */
497 function oilsRptAgeWidget(args) {
498         this.node = args.node;
499         this.count = elem('select');
500         this.type = elem('select');
501 }
502
503 oilsRptAgeWidget.prototype.draw = function() {
504         for( var i = 1; i < 25; i++ )
505                 insertSelectorVal(this.count, -1, i, i);
506         insertSelectorVal(this.type, -1, 'Day(s)', 'days');
507         insertSelectorVal(this.type, -1, 'Month(s)', 'months');
508         insertSelectorVal(this.type, -1, 'Year(s)', 'years');
509         this.node.appendChild(this.count);
510         this.node.appendChild(this.type);
511 }
512
513 oilsRptAgeWidget.prototype.getValue = function() {
514         var count = getSelectorVal(this.count);
515         var type = getSelectorVal(this.type);
516         return count+''+type;
517 }
518
519 oilsRptAgeWidget.prototype.getDisplayValue = function() {
520         var val = { value : this.getValue() };
521         var label = getSelectorVal(this.count) + ' ';
522         for( var i = 0; i < this.type.options.length; i++ ) {
523                 var opt = this.type.options[i];
524                 if( opt.selected )
525                         label += opt.innerHTML;
526         }
527         val.label = label;
528         return val;
529 }
530
531
532
533 /* --------------------------------------------------------------------- 
534         Atomic number picker
535         --------------------------------------------------------------------- */
536 function oilsRptNumberWidget(args) {
537         this.node = args.node;
538         this.size = args.size || 32;
539         this.start = args.start;
540         /*
541         var len = new String(this.size).length;
542         _debug('length = ' + len);
543         this.input = elem('input',{type:'text',size: len});
544         */
545         this.selector = elem('select');
546 }
547 oilsRptNumberWidget.prototype.draw = function() {
548         for( var i = this.start; i < (this.size + this.start); i++ )
549                 insertSelectorVal(this.selector, -1, i, i);
550         this.node.appendChild(this.selector);
551         //this.node.appendChild(this.input);
552         var obj = this;
553         /*
554         this.selector.onchange = function() {
555                 obj.input.value = getSelectorVal(obj.selector);
556         }
557         this.input.value = getSelectorVal(this.selector);
558         */
559 }
560
561 oilsRptNumberWidget.prototype.getValue = function() {
562         //return this.input.value;
563         return getSelectorVal(this.selector);
564 }
565
566 oilsRptNumberWidget.prototype.getDisplayValue = function() {
567         return { label : this.getValue(), value : this.getValue() };
568 }
569
570
571 /* --------------------------------------------------------------------- 
572         Relative dates widget
573         --------------------------------------------------------------------- */
574 function oilsRptTruncPicker(args) {
575         this.node = args.node;
576         this.type = args.type;
577         this.realSpan = elem('span');
578         this.relSpan = elem('span');
579         hideMe(this.relSpan);
580         args.node = this.realSpan;
581         this.calWidget = new oilsRptCalWidget(args);
582         args.node = this.node;
583
584         this.selector = elem('select');
585         insertSelectorVal(this.selector,-1,'Real Date',1);
586         insertSelectorVal(this.selector,-1,'Relative Date',2);
587
588         this.numberPicker = 
589                 new oilsRptNumberWidget({node:this.relSpan,size:24,start:1});
590
591         this.label = 'Day(s)';
592         if(this.type == 'month') this.label = 'Month(s)';
593         if(this.type == 'quarter') this.label = 'Quarter(s)';
594         if(this.type == 'year') this.label = 'Year(s)';
595         if(this.type == 'date') this.label = 'Day(s)';
596 }
597
598 oilsRptTruncPicker.prototype.draw = function() {
599         this.node.appendChild(this.selector);
600         this.node.appendChild(this.realSpan);
601         this.node.appendChild(this.relSpan);
602         this.calWidget.draw();
603         this.numberPicker.draw();
604         this.relSpan.appendChild(text(this.label+' ago'));
605
606         var obj = this;
607         this.selector.onchange = function() {
608                 if( getSelectorVal(obj.selector) == 1 ) {
609                         unHideMe(obj.realSpan);
610                         hideMe(obj.relSpan);
611                 } else {
612                         unHideMe(obj.relSpan);
613                         hideMe(obj.realSpan);
614                 }
615         }
616 }
617
618 oilsRptTruncPicker.prototype.getValue = function() {
619         if( getSelectorVal(this.selector) == 2) {
620                 var val = this.numberPicker.getValue();
621                 var tform = 'relative_' + this.type;
622                 return { transform : tform, params : ['-'+val] };
623         }
624         return this.calWidget.getValue();
625 }
626
627 oilsRptTruncPicker.prototype.getDisplayValue = function() {
628         if( getSelectorVal(this.selector) == 2) {
629                 var num = this.numberPicker.getValue();
630                 return { label : num +' '+this.label+' ago', value : this.getValue() };
631         }
632         return this.calWidget.getDisplayValue();
633 }
634
635
636 /* --------------------------------------------------------------------- 
637         Atomic remote object picker
638         --------------------------------------------------------------------- */
639
640 function oilsRptRemoteWidget(args) {
641         this.node       = args.node;
642         this.class      = args.class;
643         this.field      = args.field;
644         this.column = args.column;
645         this.source = elem('select',
646                 {multiple:'multiple','class':'oils_rpt_small_info_selector'});
647 }
648
649 oilsRptRemoteWidget.prototype.draw = function() {
650         var orgcol;
651         iterate(oilsIDL[this.class].fields,
652                 function(i) {
653                         if(i.type == 'link' && i.class == 'aou') 
654                                 orgcol = i.name;
655                 }
656         );
657
658         if(orgcol) _debug("found org column for remote widget: " + orgcol);
659
660         var orgs = [];
661         iterate(oilsRptMyOrgs,function(i){orgs.push(i.id());});
662         var req = new Request(OILS_RPT_MAGIC_FETCH, SESSION, {
663                 hint:this.class,
664                 org_column : orgcol,
665                 org : orgs
666         }); 
667
668         var obj = this;
669         this.node.appendChild(this.source);
670         req.callback(function(r){obj.render(r.getResultObject())});
671         req.send();
672 }
673
674 oilsRptRemoteWidget.prototype.render = function(objs) {
675         for( var i = 0; i < objs.length; i++ ) {
676                 var obj = objs[i];
677                 var label = obj[this.field.selector]();
678                 var value = obj[this.column]();
679                 _debug("inserted remote object "+label + ' : ' + value);
680                 insertSelectorVal(this.source, -1, label, value);
681         }
682 }
683
684 oilsRptRemoteWidget.prototype.getDisplayValue = function() {
685         var vals = [];
686         iterate(this.source,
687                 function(o){
688                         if( o.selected )
689                                 vals.push({ label : o.innerHTML, value : o.getAttribute('value')});
690                 }
691         );
692         return vals;
693 }
694
695 oilsRptRemoteWidget.prototype.getValue = function() {
696         var vals = [];
697         iterate(this.source,
698                 function(o){
699                         if( o.selected )
700                                 vals.push(o.getAttribute('value'))
701                 }
702         );
703         return vals;
704 }
705
706
707
708
709 /* --------------------------------------------------------------------- 
710         CUSTOM WIDGETS
711         --------------------------------------------------------------------- */
712
713 /* --------------------------------------------------------------------- 
714         custom my-orgs picker 
715         --------------------------------------------------------------------- */
716 function oilsRptMyOrgsWidget(node, orgid, maxorg) {
717         _debug('fetching my orgs with max org of ' + maxorg);
718         this.node = node;
719         this.orgid = orgid;
720         this.maxorg = maxorg || 1;
721         this.active = true;
722         if( maxorg < 1 ) {
723                 this.node.disabled = true;
724                 this.active = false;
725         }
726 }
727
728 oilsRptMyOrgsWidget.prototype.draw = function() {
729         if(!oilsRptMyOrgs) {
730                 var req = new Request(OILS_RPT_FETCH_ORG_FULL_PATH, this.orgid);
731                 var obj = this;
732                 req.callback(
733                         function(r) { obj.drawWidget(r.getResultObject()); }
734                 );
735                 req.send();
736         } else {
737                 this.drawWidget(oilsRptMyOrgs);
738         }
739 }
740
741 oilsRptMyOrgsWidget.prototype.drawWidget = function(orglist) {
742         var sel = this.node;
743         var started = false;
744         oilsRptMyOrgs = orglist;
745         for( var i = 0; i < orglist.length; i++ ) {
746                 var org = orglist[i];
747                 var opt = insertSelectorVal( this.node, -1, 
748                         org.name(), org.id(), null, findOrgDepth(org) );
749                 if( org.id() == this.orgid )
750                         opt.selected = true;
751                 if(!started) {
752                         if( org.id() == this.maxorg ) 
753                                 started = true;
754                         else opt.disabled = true;
755                 }
756         }
757 }
758
759 oilsRptMyOrgsWidget.prototype.getValue = function() {
760         return getSelectorVal(this.node);
761 }
762
763