6 root = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' WHERE parent_ou IS NULL ORDER BY name;';
7 q = 'SELECT * FROM ' _ table.findvalue('tablename') _ ' WHERE parent_ou = ? ORDER BY name;';
9 org_unit_type = DBI.tie('actor.org_unit_type', 'id')
13 <script language="javascript">
14 filters["[% input_prefix %]"] = "[% table_label _ ' -- ' _ field.findvalue('label') %]";
16 var multihier_[% table_alias %] = [];
18 function change_multihier_[% table_alias %] ( sel ) {
19 for (var i = 0; i < sel.options.length; i++) {
20 if (sel.options[i].selected) {
21 sel.options[i].selected = false;
22 for (var j in multihier_[% table_alias %]) {
23 if (multihier_[% table_alias %][j] == sel.options[i].id) {
24 sel.options[i].selected = true
35 WRAPPER select name=input_prefix multi="multi" onchange='change_multihier_' _ table_alias _ '(this);';
37 FOR f = DBI.query(root);
39 FOR v = current_value;
43 INCLUDE option value=f.id content=f.name selected=sel;
44 INCLUDE next_level parent_ou = f.id;
53 FOR f = s.execute(parent_ou);
56 logme(["can_have_vols for ou_t", ,org_unit_type.$ou_t.can_have_vols]);
58 IF org_unit_type.$ou_t.can_have_vols == 1;
60 <script language="javascript">
61 multihier_[% table_alias %].push("mh_[% f.id %]");
69 val = val _ ' ';
74 FOR v = current_value;
76 selected = 'selected';
80 INCLUDE option value=f.id content=val _ f.name id='mh_' _ f.id;
81 INCLUDE next_level parent_ou = f.id;
86 org_units = DBI.tie('actor.org_unit', 'id');
88 FOR o = current_value;
89 list.push(org_units.$o.name);